Kindergarten level programming
scottyp100
Posts: 1
Hi,
Anyone willing to help?
I'm trying to make an AMX TP button ramp an amp channel up whilst it's pressed.
If I send the string once, it increments the volume 1db at a time. So I've tried to create a TO Command to repeat the sending.
DEFINE_CALL 'Surround Amp Up'
{
IF(SURROUND_AMP_UP)
WAIT 2
SEND_STRING dvSURROUND, "$50, $43, $53, $45, $4E, $44, $02, $04, $80, $70, $C7, $38, $47, $48"
}
BUTTON_EVENT[dvTP1,11]
{
PUSH:
{
TO[dvTP1,11]
TO[SURROUND_AMP_UP]}
}
I'm a novice, playing at home, so be nice please
Anyone willing to help?
I'm trying to make an AMX TP button ramp an amp channel up whilst it's pressed.
If I send the string once, it increments the volume 1db at a time. So I've tried to create a TO Command to repeat the sending.
DEFINE_CALL 'Surround Amp Up'
{
IF(SURROUND_AMP_UP)
WAIT 2
SEND_STRING dvSURROUND, "$50, $43, $53, $45, $4E, $44, $02, $04, $80, $70, $C7, $38, $47, $48"
}
BUTTON_EVENT[dvTP1,11]
{
PUSH:
{
TO[dvTP1,11]
TO[SURROUND_AMP_UP]}
}
I'm a novice, playing at home, so be nice please
0
Comments
When needing to ramp volume like this I use timelines.
I made couple small changes. I got rid of the integer variable because it is redundant, and I added a guard against runaway volume if a button release is missed (habit from R4 days).
BUTTON_EVENT [dvKP,9] // SELECT Volume Up KEYPAD BUTTON (#9)
{
HOLD[2,REPEAT]:
{
IF (nVol_Lvl < 100)
{
PUT YOUR STRING HERE
nVol_Lvl = nVol_Lvl + 1
ON [dvKP,9]
}
}
RELEASE:
{
OFF [dvKP,9]
}
}