Override sustain pedal on a per-pitch basis with velocity = 1 note events

I have this very simple script working fine below but it's only able to send note-offs for all note events. I want to be able to only send note-offs to note events of the same pitch as the note event with velocity = 1, the instant that note is played.
on init declare polyphonic $v declare polyphonic $notenumber end on on note $v := get_event_par($EVENT_ID,$EVENT_PAR_VELOCITY) $notenumber := get_event_par($EVENT_ID,$EVENT_NOTE) if($v = 1) note_off($ALL_EVENTS) end if end on
The $notenumber part of the script isn't doing anything but I want it to. Somehow I need to filter $ALL_EVENTS to only include note events of the same pitch as the velocity = 1 note.
Seems like it should be really simple and I'm just missing something basic. Thanks in advance!
Comments
-
if the velocity = 1 why do you need to kill these events?
one tool you are missing is the function get_event_ids ()
with it you can scan through the active events, check their EVENT_PAR_NOTE and EVENT_PAR_VELOCITY, if they match to your specifications, you can kill them.
1 -
Is this for MalletKAT?
1 -
Thanks for your reply. I would use a velocity of 0, but in Logic Pro, the lowest you can drag the velocity down to is 1. So I'm giving up the ability to use velocity 1 notes and instead using them to mute sounding notes. I'll experiment with the get_event_ids () function. Thanks again.
I should also clarify, i don't want to kill notes with a velocity of 1. I want to use notes with a velocity of 1 to trigger note-offs for all singing notes with that same pitch. Imagine a complicated vibraphone passage with the sustain pedal active. And just one or two notes sound bad with the next chord. All I want to do is sequence mutes for those notes only and leave the sustain pedal active. Hope that makes sense.
0 -
Sort of. I'm sequencing MIDI for vibraphone in Logic, and then importing it into Sibelius. I just want to use an X notehead on Sibelius to act as mallet mutes that will override the status of the sustain pedal.
Do you know of a script that already does something similar?
0 -
Something like this? (EDIT, sorry this is a mute, my mistake, change the fade_out to a note_off...)
on init declare $count declare %array[512] end on on note if ($EVENT_VELOCITY < 2 ) get_event_ids(%array) $count := 0 while($count < 512 and %array[$count] # 0) if( get_event_par(%array[$count], $EVENT_PAR_NOTE) = $EVENT_NOTE ) fade_out(%array[$count], 300000, 1) end if inc($count) end while end if end on
1 -
Even the fade-out works great!!!!!
Please message me directly so I can pay you.
1 -
While you're here, I did try replacing
fade_out(%array[$count], 300000, 1)
with
note_off(%array[$count])
and it won't work. But in case you're busy the fadeout works fine for now, I'll just shorten it a bit. :)
Been trying to figure this out for 3-4 days straight so will happily send you some thank you cash if you message me.
0 -
Haha... you don't have to pay me, it's just something I did for MalletKat a while back.
Not sure why note_off isn't working for you, maybe some other part of the script is affecting the release?
1 -
Hmm, it could be several things. I'll experiment and come back if I figure it out. This gets me 99% there though, so thanks so much for your knowledge!
0 -
Thanks for a very instructive thread.
The principal problem is overriding the sustain pedal which I don't think can be done (note_off obviously won't release the note if the pedal is down). Fade_out is a brilliant workaround.
1 -
That makes sense.
So far, the fade_out is working fine. There's literally not a single bug or issue with this script and it's clean and tiny.
If someone really needs the note_off() function though, one could change the sustain pedal with the 'on controller' callback before the 'on note' callback. Make it so note_off($ALL_EVENTS) will replace C64,0, and ignore note-offs for all note events before the if($EVENT_VELOCITY < 2). I'm not good enough yet to figure out the proper order of things but I imagine it could be done.
0 -
Ah - remember cc64=0 doesn't release all notes, only those which have had a note-off.
1 -
If you need the note_off to work while the sustain pedal is down, I'd say you're going to need to write your own sustain pedal routine, and SET_CONDITION(NO_SYS_SCRIPT_PEDAL)
1 -
That makes sense. Still making sense of this stuff. Thank you!
Will give that a try! Thanks very much!
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 791 Tech Talks
- 4.1K Native Access
- 16.6K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.8K Kontakt
- 1.6K Reaktor
- 381 Battery 4
- 850 Guitar Rig & FX
- 430 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.4K Traktor
- 7.4K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators