Home AMX User Forum NetLinx Studio

Biamp Nexia Programming Help

Hii Guys ,

I am working onBiamp Nexia with 4 microphones input.I would like to minimise my code and I need your suggestions.

Here is sample Volume Up code

BUTTON_EVENT[dvTP1,6] // Mic Volume UP
{
PUSH:
{
IF(nMuteMic1)
{
OFF[nMuteMic1]
TO[dvTP1,6]
SEND_STRING dvNexia,"'SET 1 FDRMUTE ',cBiampMic1,'1 0',10" // cBiampMic1 is the ID value
}
ELSE
{
snVolMic1 = MIN_VALUE(snMaxVolMic,snVolMic1+cBiampIncrement) // max volume set as 8dB
SEND_STRING dvNexia,"'SET 1 FDRLVL ',cBiampMic1,'1',ITOA(snVolMic1),10"
}
}
HOLD[3,REPEAT]:
{
snVolMic1 = MIN_VALUE(snMaxVolMic,snVolMic1+cBiampIncrement)
SEND_STRING dvNexia,"'SET 1 FDRLVL ',cBiampMic1,'1',ITOA(snVolMic1),10"
}
}


My question is how do I use the same code for other 3 mics

Is it like

DEFINE CALL ?VOL UP?(Mutestatus ,source,Vol,MaxVol)
{
BUTTON_EVENT[dvTP1,6] // Mic Volume UP
{
PUSH:
{
IF(Mutestatus)
{
OFF[Mutestatus]
TO[dvTP1,button.input.channel]
SEND_STRING dvNexia,"'SET 1 FDRMUTE ',Source,'1 0',10"
}
ELSE
{
Vol = MIN_VALUE(MaxVol,Vol+1)
SEND_STRING dvNexia,"'SET 1 FDRLVL ',Source,'1',ITOA(Vol),10"
}
}
}

}

So when I press other Mic ,for example button 10 for mic 2 volume up

BUTTON_EVENT[dvTP1,10]
{
PUSH:
{
CALL ?VOL UP?(Mic2Mute,Mic2,Vol,1)
}

HOLD[3,REPEAT]:
{
CALL ?VOL UP?(Mic2Mute,Mic2,Vol,1) // Vol is the fedd back from Nexia(string function and SINTEGER) and 1 dB is the Max Volume
}

}

Is it correct?


Because the site is in remote area and I don?t have enough time to work onsite.any ideas?

Comments

  • yuriyuri Posts: 861
    use a devchan for your volume up buttons, and one for your volume down buttons
    DEVCHAN dcUp{}=
    {
     {dvTP, 1},
     {dvTP, 2},
     {dvTP, 3}
    }
    
    DEVCHAN dcDown{}=
    {
     {dvTP, 11},
     {dvTP, 12},
     {dvTP, 13}
    }
    

    figure out which button is pressed last and send the correct string to the Nexia.
    You can increment and decrement the nexia using the 'INC 1 FDRLVL' or 'DEV 1 FDRLVL' commands, or you can keep track of the volume yourself and send it out using the SET 1 FDRLVL command...

    Good luck!
  • AMXJeffAMXJeff Posts: 450
    Module Available

    There is an AMX module that works quite well for the Nexia..
  • Thanks guys,
  • patbpatb Posts: 140
    While AMX has a module, I generally avoid AMX modules because typically they are bloated, slow and contain everything plus the kitchen sink when I just need a couple simple functions.

    I have written a simple Biamp subroutine for volume as follows:


    DEFINE_CALL 'SEND GAIN COMMAND'(integer nWhichVol, integer nLvl)
    {
    SEND_STRING dvAudio,"'SETL 1 FDRLVL ',InstID[nWhichVol],' 1 ',ITOA(nLvl*10),$0A"
    SEND_STRING 0,"'TO BIAMP: SETL 1 FDRLVL ',InstID[nWhichVol],' 1 ',ITOA(nLvl*10),$0A"
    }


    My button event for the vol up is as follows - works for multiple buttons (edited for simplicity - hold event is identical to push) dcVolUpBtns is a devchan array with all of the volume up buttons



    BUTTON_EVENT[dcVolUpBtns] // Vol Up
    {
    PUSH:
    {
    TO[BUTTON.INPUT]
    nCurVol = GET_LAST(dcVolUpBtns)
    IF(nVolLvl[nCurVol] < 100)
    {
    nVolLvl[nCurVol] = nVolLvl[nCurVol] + 1
    CALL 'SEND GAIN COMMAND'(nCurVol,nVolLvl[nCurVol])
    }
    }
    }
  • AMXJeffAMXJeff Posts: 450
    patb wrote: »
    While AMX has a module, I generally avoid AMX modules because typically they are bloated, slow and contain everything plus the kitchen sink when I just need a couple simple functions.

    The biamp amp module only uses the functions you intialize with the 'AUDIOPROCADD-' commands, so it will get only as bloated as the functionality you require. As far as simple, it does not get more simple then this UI code...
    dvBiamp = 5001:1:0;
    vdvDuet = 41001:1:0;
    dvTP = 10001:1:0;
    
    vdvFader1  = 41001:2:0;
    vdvFader2  = 41001:3:0;
    vdvFader3  = 41001:4:0;
    vdvFader4  = 41001:5:0;
    vdvFader5  = 41001:6:0;
    vdvFader6  = 41001:7:0;
    vdvFader7  = 41001:8:0;
    vdvFader8  = 41001:9:0;
    vdvFader9  = 41001:10:0;
    vdvFader10 = 41001:11:0;
    
    (***********************************************************)
    (*                STARTUP CODE GOES BELOW                  *)
    (***********************************************************)
    DEFINE_START
    
    // comm module
    DEFINE_MODULE 'Biamp_AudiaFlex_Comm_dr1_0_0' modBiampComm1(vdvDuet,dvBiamp)
    
    (***********************************************************)
    (*                THE EVENTS GO BELOW                      *)
    (***********************************************************)
    DEFINE_EVENT
    
    DATA_EVENT[vdvDuet]
    {
    	ONLINE:
    	{
    		WAIT 20 'SETTLE'
    		{
    			SEND_COMMAND vdvDuet,'PROPERTY-Baud_Rate,38400'
    				
    			// SET POLL TIMES 0 = OFF;	
    			SEND_COMMAND vdvDuet,'PROPERTY-Poll_Time,0'
    			SEND_COMMAND vdvDuet,'PROPERTY-Poll_Phonebook_Time,0'
    
    			// Add Audio Processor Components - Level Faders - Level & State Set Components
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-2,LEVELFADERS.FADER.SET:1.23.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-3,LEVELFADERS.FADER.SET:1.26.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-4,LEVELFADERS.FADER.SET:1.30.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-5,LEVELFADERS.FADER.SET:1.34.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-6,LEVELFADERS.FADER.SET:1.46.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-7,LEVELFADERS.FADER.SET:1.50.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-8,LEVELFADERS.FADER.SET:1.51.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-9,LEVELFADERS.FADER.SET:1.51.2.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-10,LEVELFADERS.FADER.SET:1.53.1.0'
    		  SEND_COMMAND vdvDuet,'AUDIOPROCADD-11,LEVELFADERS.FADER.SET:1.45.1.0'
    			
    			SEND_COMMAND vdvDuet,'REINIT'
    		}                                 
    	}
    }
    
    
    BUTTON_EVENT[dvTP,1] // FADER 1 RAMP UP
    {
    	PUSH:
    	{
    		TO[vdvFader1, 24]
    	}
    }
    
    BUTTON_EVENT[dvTP,2] // FADER 1 RAMP DOWN
    {
    	PUSH:
    	{
    		TO[vdvFader1, 25]
    	}
    }
    
    BUTTON_EVENT[dvTP,3] // FADER 1 MUTE / UNMUTE
    {
    	PUSH:
    	{
    		TO[vdvFader1, 26]
    	}
    }
    
    LEVEL_EVENT[vdvFader1,1]
    {
    	SEND_LEVEL dvTP, 1, LEVEL.VALUE
    }
    
    (***********************************************************)
    (*            THE ACTUAL PROGRAM GOES BELOW                *)
    (***********************************************************)
    DEFINE_PROGRAM
    
    // Volume up / down feedback
    [dvTP,1] = [vdvFader1, 24]
    [dvTP,2] = [vdvFader1, 25]
    
    // Mute feedback
    [dvTP,3] = [vdvFader1,199];
    (***********************************************************)
    (*                     END OF PROGRAM                      *)
    (*        DO NOT PUT ANY CODE BELOW THIS COMMENT           *)
    (***********************************************************)
    
    
  • orrrrrrrrrrrrrrrrrr

    code cut out :)
    sinteger MaxNexVol =  12
    sinteger MinNexVol = -60
    sinteger ndefaultaudio = -25
    sinteger nNexMicVolArray[8]
    sinteger nNexMicMuteStatArray[8]
    persistent sinteger NexProgVol
    persistent sinteger NexTxVol
    persistent sinteger NexRxVol
    persistent sinteger NexTelVol
    volatile char cKEYPAD_ENTRY[1]
    volatile char cPHONE_NUMBER[255]
    volatile integer nNexiaMicID[8]
    volatile integer nTelcoTXVolChanID  = 1
    volatile integer nTelcoRXVolChanID  = 11
    volatile integer nProgramVolChanID  = 9
    volatile integer nProgramVol2ChanID = 10
    (*Biamp ID*)
    char nNexiaTelco_ID = 36
    char nNexiaTXDEV_ID = 46
    char nNexiaRXDEV_ID = 2
    char nNexiaProgDEV_ID = 2
    volatile integer HowLong_Phone
    volatile integer NexProgMuteStat
    volatile integer NexTxMuteStat
    volatile integer NexRxMuteStat
    volatile integer nNexiaAllMicMuteLogix
    volatile integer iPHONE_OFF_HOOK
    volatile integer nMicMuteStatus[16]
    
    (*device string queing send*)
    define_function fnBiamp_StringQue()
    {
    	local_var char cCmd[500]
    	if(![dvnexia,nAudioBusy] && length_string(cAudioQue))
    	{
    		if(bClientOnline = 0)
    		{
    			ip_client_open(dvNexia.port,NexiaAddress,TelnetPort,Protocol)
    			wait_until(bClientOnline)
    			{
    				cCmd = Remove_String(cAudioQue,"$FF",1) 
    				set_length_string(cCmd,(Length_String(cCmd) - 1))
    				Send_String dvnexia,upper_string("cCmd") 
    				Send_String 0,"'Sent Nexia Command: ',cCmd" 
    				On[dvnexia,nAudioBusy] Wait 5 Off[dvnexia,nAudioBusy]
    			}
    		}
    		else
    		{
    			cCmd = Remove_String(cAudioQue,"$FF",1) 
    			set_length_string(cCmd,(Length_String(cCmd) - 1))
    			Send_String dvnexia,upper_string("cCmd") 
    			Send_String 0,"'Sent Nexia Command: ',cCmd" 
    			On[dvnexia,nAudioBusy] Wait 5 Off[dvnexia,nAudioBusy]
    		}
    	}
    	else if ([dvnexia,nAudioBusy] && length_string(cAudioQue))
    	{
    		if(bClientOnline = 0)
    		{
    			ip_client_open(dvNexia.port,NexiaAddress,TelnetPort,Protocol)
    			wait_until(bClientOnline)
    			{
    				wait_until(![dvnexia,nAudioBusy]) 
    				{
    					cCmd = Remove_String(cAudioQue,"$FF",1) 
    					set_length_string(cCmd,(Length_String(cCmd) - 1))
    					Send_String dvnexia,upper_string("cCmd") 
    					Send_String 0,"'Sent Nexia Command: ',cCmd" 
    					On[dvnexia,nAudioBusy] Wait 5 Off[dvnexia,nAudioBusy]
    				}
    			}
    		}
    		else
    		{
    			cCmd = Remove_String(cAudioQue,"$FF",1) 
    			set_length_string(cCmd,(Length_String(cCmd) - 1))
    			Send_String dvnexia,upper_string("cCmd") 
    			Send_String 0,"'Sent Nexia Command: ',cCmd" 
    			On[dvnexia,nAudioBusy] Wait 5 Off[dvnexia,nAudioBusy]
    		}
    	}
    	else
    	{
    		clear_buffer cCmd
    		clear_buffer cAudioQue
    	}
    }
    (*device pre-Que*)
    Define_Function AddtoNexiaQue (Char cCmd[500]) 
    {
    	cAudioQue = "cAudioQue,cCmd,$FF" 
    	Send_String 0,"'Added Nexia Command: ',cCmd" 
    }
    
    
    
    
    
    	    case 20:(* Program volume up *)
    				{ 
    					If ((NexProgVol >=MinNexVol)&&(NexProgVol <=MaxNexVol))	//check range
    					{
    						(*channel 9*)
    						NexProgVol = NexProgVol + nVolRate
    						AddtoNexiaQue("'SET 1 FDRLVL',' ',ITOA(nNexiaProgDEV_ID),' ',
    						ITOA(nProgramVolChanID),' ',ITOA(NexProgVol),'.0',$0A,$FF")
    						wait 5
    						(*channel 10*)
    						AddtoNexiaQue("'SET 1 FDRLVL',' ',ITOA(nNexiaProgDEV_ID),' ',
    						ITOA(nProgramVol2ChanID),' ',ITOA(NexProgVol),'.0',$0A,$FF")
    					}
    					if (NexProgMuteStat = 1)
    					{
    						(*channel 9*)
    						AddtoNexiaQue("'SET 1 FDRMUTE',' ',ITOA(nNexiaProgDEV_ID),' ',
    						ITOA(nProgramVolChanID),' ','0',$0A,$FF")
    						wait 5
    						(*channel 10*)
    						AddtoNexiaQue("'SET 1 FDRMUTE',' ',ITOA(nNexiaProgDEV_ID),' ',
    						ITOA(nProgramVol2ChanID),' ','0',$0A,$FF")
    						NexProgMuteStat = 0
    					}
    				}
    
    

    looks like a hot mess but you get the idea, I had this written long time ago for telnet control of biamp products with phonebook+speeddial+full keyboard support, and dont poll the biamp poll it on startup and shutdown thats it and use sinteger or a float to keep it in sinc they have a bit of hickups on polling too hard especially when you have multiple Audia devs.
  • Thanks you guys.Informative .I was looking for Patrik style of code , but quite happy with other logics.Thanks a lot
  • HedbergHedberg Posts: 671
    The biamp amp module only uses the functions you intialize with the 'AUDIOPROCADD-' commands, so it will get only as bloated as the functionality you require. As far as simple, it does not get more simple then this UI code...

    We have a Nexia on one of our current installations and today I decided to risk it and try the AMX module. My results were not good:

    1. It's big and fat even if you only use a couple functions.

    2. The biamp has increment and decrement commands but the module, as far as I can tell, doesn't use them. The module seems to use discrete level setting commands and does not query the device for the current levels before issuing the commands--it ignores the currently set levels. So, when you turn on the channel to "ramp" the gain, it's likely to make a big jump one way or the other before it starts to ramp. This is very bad, particularly when the device has increment and decrement commands, the use of which would prevent this. The gain seems to be adjustable only in steps of 3 which is a touch coarse.

    3. The Nexia telecon unit has a decent speed dial facility which is pretty intuitive and easy to use. The module's wrapper (called, inexplicably "PHONEBOOK") has a set of byzantine commands that I couldn't fathom. I could figure out how to modify a speed dial entry, but I couldn't figure out how to recall one. It looks to me as though the module is storing and manipulating the speed dial entries locally which makes absolutely no sense to me.

    As is the case with most of the modules that I have tried to use recently, in order to evaluate the module it's necessary to become familiar with the Nexia's protocol to the extent that it's easier to write code in that protocol than it is to learn the module's protocol. Then, the performance of the module does not meet minimum standards and I end up chucking it and using the device protocol anyway.
  • only use amx modules when its a small job and I have little time to do it, hit and run, 3 hrs to drop a panel, four projectors, a clearone telco and audio functions, sure modules FTW, but big projects no sir ill write mine, besides less memory consumption in comparison to big fat java lol :).
Sign In or Register to comment.