I would like to move a physical slider assigned to cc16 on my keyboard so when between values:
cc1-11 hold note C2,
cc12 to cc23 release C2 → hold note C#2.
cc24 to cc35 release c#2 → hold note D2
…
cc116 to cc126 release A → hold note A#2
cc127 release A#2
The purpose is to use a slider to keyswitch for a VST that requires you to hold down the keyswitch notes.
The incoming trigger is any value set qq to value.
Then I look at the value of local variable ‘qq’ to determine the value of global variable ‘ga’ which is an index value that we will use to calculate the outgoing note number.
We then at a value to the index to get the desired note number to play. You may need to adjust this value as note names are not standardized in MIDI.
We look look if the note playing is the same as last played (global variable ‘gb’ . If it is the same note number, then we do nothing as we don’t want repeated notes.
However if it a different note number, then we turn off the last note played and turn on the new note. We keep the value of the last note played in the global variable ‘gb’ for the next iteration.
We then use raw MIDI to both turn off the last note and turn on the next notes
Here are the rules.
if qq<1 then exit rules, skip Outgoing Action
// lets start with higher notes and
// go down from there
// Add higher notes if desired
if qq<36 then ga=3
if qq<24 then ga=2
if qq<12 then ga=1
// Set note to play.
pp=ga+47
// get last note played into tt
tt=gb
// next iteration set last note played
if pp!=tt then gb=pp
// if last note played is same as current note, skip
if pp==tt then exit rules, skip Outgoing Action
//Log "Log Note off %tt% - Playing note %pp%"
The outgoing action raw MIDI is show below. This turns of note tt and turns on note pp. In this case note-on and off are on MIDI CH 1.
Thank you! It will be fun testing this out - will report back how I make out. This is for another pedal steel plugin that I have been practicing with goal to perform the most common pedal steel idioms in real time using the first 5 sliders on my Axiom 61 1st gen controller. Translating the 10 strings of an E9 pedal steel guitar plus the movement of the steel bar and the string bends from the pedals to a MIDI controller is challenging - this helps get all the controls in one place.