Happy Friday... Oh, and Volume Ramp Request
GasHed
Posts: 31
Happy Friday all,
First, how do you do that really cool posting of code in it's own text area with scroll bars? I tried <code></code> but that didn't work.
Second, does anyone have a good example of doing volume ramping with an RS232 device that takes VOL(0-255) commands? Right now, I have something like this:
ACTIVE(FIND_STRING(curFB,'VOL',1)):
{
REMOVE_STRING(curFB,'VOL',1)
VOLUME[1] = MVOLTOVOL(ATOI(curFB))
SEND_LEVEL vdvMAESTRO,1,VOLUME[1]
IF([vdvMAESTRO,24])
{
WAIT 1{CALL 'VOL_RAMP'(1, VOLUME[1], 1)}
}
IF([vdvMAESTRO,25])
{
WAIT 1{CALL 'VOL_RAMP'(0, VOLUME[1], 1)}
}
}
In a nutshell, I start the ramp with a VOL command, then when I recieve the ack back from the device, I send another VOL command, incremented or decremented by one if the ramp channel is still active. This works ok, but I'm curious as to what the 'standard' way or best practice way of doing volume ramps are in this case. I figured you geniuses would know A sample module that does this would be awesome!
Thanks,
Pat
First, how do you do that really cool posting of code in it's own text area with scroll bars? I tried <code></code> but that didn't work.
Second, does anyone have a good example of doing volume ramping with an RS232 device that takes VOL(0-255) commands? Right now, I have something like this:
ACTIVE(FIND_STRING(curFB,'VOL',1)):
{
REMOVE_STRING(curFB,'VOL',1)
VOLUME[1] = MVOLTOVOL(ATOI(curFB))
SEND_LEVEL vdvMAESTRO,1,VOLUME[1]
IF([vdvMAESTRO,24])
{
WAIT 1{CALL 'VOL_RAMP'(1, VOLUME[1], 1)}
}
IF([vdvMAESTRO,25])
{
WAIT 1{CALL 'VOL_RAMP'(0, VOLUME[1], 1)}
}
}
In a nutshell, I start the ramp with a VOL command, then when I recieve the ack back from the device, I send another VOL command, incremented or decremented by one if the ramp channel is still active. This works ok, but I'm curious as to what the 'standard' way or best practice way of doing volume ramps are in this case. I figured you geniuses would know A sample module that does this would be awesome!
Thanks,
Pat
0
Comments
The only thing I would add would be "check" code that prevents your routine from sending a ramp command when the volume is already all the way up or all the way down. You can link your button feedback off of that as well - makes it slick looking when your TP buttons "release", telling the user "I can't go any furhter - I'm done!".
- Chip
BTW, it's [ CODE ][ /CODE ] . . . without the spaces.
Thanks for the feedback...
Oh, and I check to see if I'm at the min or max volume in that VOL_RAMP function... but turning off the feedback is a neat idea.
Pat