Home AMX User Forum AMX Technical Discussion

Happy Friday... Oh, and Volume Ramp Request

GasHedGasHed Junior MemberPosts: 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

Comments

  • Chip MoodyChip Moody Junior Member Posts: 727
    Can't say I'd do it any differently. In fact, I did almost this exact same thing to ramp the volume on an LG plasma display recently.

    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
  • jjamesjjames Just another dude Posts: 2,906
    Pat,

    BTW, it's [ CODE ][ /CODE ] . . . without the spaces.
  • GasHedGasHed Junior Member Posts: 31
    Thanks

    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
Sign In or Register to comment.