tomaslobosk
Active Member
Hey folks, I've been fooling around with a custom sustain pedal script for quite some time.
The script is working now for all tasks except when I'm sending two consecutive note-on messages (same-key, no note-off message, so active voices: 2)
It should trigger 2 release samples, and it's triggering only the newest voice release sample.
Any help will be extremely appreciated.
The script is working now for all tasks except when I'm sending two consecutive note-on messages (same-key, no note-off message, so active voices: 2)
It should trigger 2 release samples, and it's triggering only the newest voice release sample.
Code:
on release
if(%CC[64]<64)
get_event_ids(%ids)
count:=0
while (%ids[count]#0)
if (get_event_par(%ids[count],EVENT_PAR_NOTE)=EVENT_NOTE)
note_off(%ids[count])
wait(1)
end if
inc(count)
end while
disallow_group(ALL_GROUPS)
{allow release samples groups}
else
ignore_event(EVENT_ID)
end if
end on
on controller
if(CC_NUM=64)
if (%CC[64]<64 and lastcc64value>=64)
get_event_ids(%ids)
count:=0
while (%ids[count]#0)
if(KEY_DOWN[get_event_par(%ids[count],$EVENT_PAR_NOTE)]=0)
note_off(%ids[count])
end if
inc(count)
end while
end if
lastcc64value:=%CC[64]
end if
end on
Any help will be extremely appreciated.
Last edited: