Hi all,
I was looking the other day for a plugin that could constrain the midi notes to a key.
I didn’t find something that was useable.
So today I decided to write a script to do it.
The idea is that for a selected key only notes in that key should be playable.
I realise that this is quite limiting as not even dominant 7th chords are then possible.
However in the context that I play (in church) this is often not needed.
Being a bit clumsy I can sometimes accidentally catch an adjacent key or if I am playing a bit more spontaneously and it’s not one the easier keys, I might play a note out of scale and this is quite disturbing in a worship environment.
Therefore by having a facility where I can select the key to restrict the available notes works quite well.
I know some will say that I should just practise more and get better but nevertheless…
I used the ‘lanes’ from my previous post on Drone Player but I hope you get the idea…I have a button
for each key and when the scale button is pressed then the midi notes are filtered.
Here’s the script:
On NoteEvent (m : NoteMessage) From MidiInOMNI
var
note: Integer
LanePlaying: Integer
//Print("LanePlaying=" + LanePlaying + "note=" + note + "C0=" + C0)
if GetWidgetValue(ScaleBtn) == 1.0 then
note = GetNoteNumber(m) % 12 + 24
LanePlaying = GetLanePlaying()
if LanePlaying == -1
or
(
(LanePlaying == 0 and // Key of C
(note == C0
or note == D0
or note == E0
or note == F0
or note == G0
or note == A0
or note == B0))
or (LanePlaying == 1 and // Key of C#
(note == C#0
or note == D#0
or note == F0
or note == F#0
or note == G#0
or note == A#0
or note == C0))
or (LanePlaying == 2 and // Key of D
(note == D0
or note == E0
or note == F#0
or note == G0
or note == A0
or note == B0
or note == C#0))
or (LanePlaying == 3 and // Key of D#
(note == D#0
or note == F0
or note == G0
or note == G#0
or note == A#0
or note == C0
or note == D0))
or (LanePlaying == 4 and // Key of E
(note == E0
or note == F#0
or note == G#0
or note == A0
or note == B0
or note == C#0
or note == D#0))
or (LanePlaying == 5 and // Key of F
(note == F0
or note == G0
or note == A0
or note == A#0
or note == C0
or note == D0
or note == E0))
or (LanePlaying == 6 and // Key of F#
(note == F#0
or note == G#0
or note == A#0
or note == B0
or note == C#0
or note == D#0
or note == F0))
or (LanePlaying == 7 and // Key of G
(note == G0
or note == A0
or note == B0
or note == C0
or note == D0
or note == E0
or note == F#0))
or (LanePlaying == 8 and // Key of G#
(note == G#0
or note == A#0
or note == C0
or note == C#0
or note == D#0
or note == F0
or note == G0))
or (LanePlaying == 9 and // Key of A
(note == A0
or note == B0
or note == C#0
or note == D0
or note == E0
or note == F#0
or note == G#0))
or (LanePlaying == 10 and // Key of A#
(note == A#0
or note == C0
or note == D0
or note == D#0
or note == F0
or note == G0
or note == A0))
or (LanePlaying == 11 and // Key of B
(note == B0
or note == C#0
or note == D#0
or note == E0
or note == F#0
or note == G#0
or note == A#0)))
then
SendNow(MidiInOMNI, m)
end
else
SendNow(MidiInOMNI, m)
end
End