Home AMX User Forum NetLinx Studio

Volume Adjustng on a Nexia

Hello Everyone:
I have a newbie question that hopefully someone can point me in the right direction. I have a NI-700 controlling a Nexia CS. I am writing a new module from scratch, mostly just getting the feel for how all of this works. Right now I can mute, unmute, mute with pink noise, and unmute it. What I seem to be struggling with is volume adjustment. It could be that I am thinking about it wrong, but I could use a little push in the right direction.

To adjust the volume, I want to get the current value of the full scale output for the channel/device for each output channel. If you're pressing volume up, then bump it to the next level. If you're pressing down, bump it down.

The problem I'm having is getting the current full scale value for each channel. I've seen some people using create_buffer within the data event but I'm not sure if I need to get that complicated or maybe there's an easier way.

The other thing I thought about is if I create a data event for the entire Nexia device like what I have seen in others' examples, couldn't you possibly inadvertently increase/decrease the volume level when some other data event happens for that device? The way I understand it, any time you send/recieve commands to the device, you're going to create a data event.

Thanks,
Brian

Comments

  • yuriyuri Posts: 861
    To adjust the volume, I want to get the current value of the full scale output for the channel/device for each output channel. If you're pressing volume up, then bump it to the next level. If you're pressing down, bump it down.

    The problem I'm having is getting the current full scale value for each channel. I've seen some people using create_buffer within the data event but I'm not sure if I need to get that complicated or maybe there's an easier way.

    Well, in this instance, the Nexia also support INCREMENT and DECREMENT. This will solve your problem, but not all audio processors allow this...
    The other thing I thought about is if I create a data event for the entire Nexia device like what I have seen in others' examples, couldn't you possibly inadvertently increase/decrease the volume level when some other data event happens for that device? The way I understand it, any time you send/recieve commands to the device, you're going to create a data event.

    Thanks,
    Brian

    You would create a DATA_EVENT for a specific device, like so:
    DATA_EVENT[dvNexia]
    {
         STRING:
         {
              //handle strings from nexia here
         }
    }
    

    Now every string to gets sent from the Nexia will get "trapped" in your DATA_EVENT.

    The DATA_EVENT itself is ONLY used for strings to are received from the device...

    Hope this helps :)
  • bdavis04bdavis04 Posts: 2
    Thanks!

    Yeah, that did the trick.... Thanks.

    The only thing I have left to do is figure out which button (volume up, volume down) was pressed. I was thinking of setting a flag in the push button event so I'll know which was which.

    Thanks!

    Brain
  • LawrieavLawrieav Posts: 8
    bdavis04 wrote: »
    Yeah, that did the trick.... Thanks.

    The only thing I have left to do is figure out which button (volume up, volume down) was pressed. I was thinking of setting a flag in the push button event so I'll know which was which.

    Thanks!

    Brain


    GET_LAST()
  • yuriyuri Posts: 861
    Lawrieav wrote: »
    GET_LAST()

    to elaborate:
    (* volume up *)
    BUTTON_EVENT[dvTP, 101]
    {
       PUSH:
       {
          (* do this or that *)
       }
    }
    

    or
    BUTTON_EVENT[dcVolumeControl]
    {
       PUSH:
       {
          nLastVolume = GET_LAST(dcVolumeControl)
          SWITCH(nLastVolume)
          {
             (* volume up *)
             CASE 1:
             {
    
             }
             (* volume down *)
             CASE 2:
             {
    
             }
          }
       }
    }
    

    where dcVolumeControl is:
    DEVCHAN dcVolumeControl[]=
    {
       {dvTP, 101},
       {dvTP, 102}
    }
    
Sign In or Register to comment.