I used this script over the weekend and it worked great. I did notice one small problem, maybe you guys can give me some insight on how to fix this. It seems like for every song and song part change GP considers it a system actions parameter song key change even when the song didn’t change key from the previous song. So what ends up happening is if I leave TRIGGER_DRONE_PAD on and the key didn’t change it will still carry out the ParameterValueChanged callback.
I tried to fix this by adding the below.
&& GetSongKeySignature(GetCurrentSongIndex()) != GetSongKeySignature(GetCurrentSongIndex()-1)
It seems to work partially, if the song key didn’t change it won’t carry out the callback from song to song, but it will still carry out the callback from song part to song part which has me confused. I tried using GetCurrentSongPart both instead of and in conjunction with GetCurrentSongIndex but that had weird results. Any ideas?
Var
Global_MIDI : MidiInBlock
TRIGGER_DRONE_PAD: Widget
SysActions : PluginBlock // References to a system actions plugin block
On WidgetValueChanged(newValue : double) from TRIGGER_DRONE_PAD
var
MM : MidiMessage
songKey : string
If GetWidgetValue(TRIGGER_DRONE_PAD) == 0.0
then AllNotesOff(Global_MIDI)
else
songKey = GetParameterText(SysActions, 68) // 68 is the parameter number for the song key
Print(songKey)
select
songKey == "C Major" do
MM = MakeNoteMessage (60,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (67,64)
SendNow(Global_MIDI, MM)
songKey == "C#/Db Major" do
MM = MakeNoteMessage (61,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (68,64)
SendNow(Global_MIDI, MM)
songKey == "D Major" do
MM = MakeNoteMessage (62,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (69,64)
SendNow(Global_MIDI, MM)
songKey == "D#/Eb Major" do
MM = MakeNoteMessage (63,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (70,64)
SendNow(Global_MIDI, MM)
songKey == "E Major" do
MM = MakeNoteMessage (64,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (71,64)
SendNow(Global_MIDI, MM)
songKey == "F Major" do
MM = MakeNoteMessage (65,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (72,64)
SendNow(Global_MIDI, MM)
songKey == "F#/Gb Major" do
MM = MakeNoteMessage (66,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (73,64)
SendNow(Global_MIDI, MM)
songKey == "G Major" do
MM = MakeNoteMessage (67,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (74,64)
SendNow(Global_MIDI, MM)
songKey == "G#/Ab Major" do
MM = MakeNoteMessage (68,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (75,64)
SendNow(Global_MIDI, MM)
songKey == "A Major" do
MM = MakeNoteMessage (69,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (76,64)
SendNow(Global_MIDI, MM)
songKey == "A#/Bb Major" do
MM = MakeNoteMessage (70,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (77,64)
SendNow(Global_MIDI, MM)
songKey == "B Major" do
MM = MakeNoteMessage (71,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (78,64)
SendNow(Global_MIDI, MM)
End // Select
End // If
End // WidgetValueChanged
On ParameterValueChanged(index : integer, value : double) from SysActions
var
MM : MidiMessage
songKey : string
If index == 68 && GetWidgetValue(TRIGGER_DRONE_PAD) > 0.0 && GetSongKeySignature(GetCurrentSongIndex()) != GetSongKeySignature(GetCurrentSongIndex()-1)
then
songKey = GetParameterText(SysActions, 68) // 68 is the parameter number for the song key
Print(songKey)
AllNotesOff(Global_MIDI)
select
songKey == "C Major" do
MM = MakeNoteMessage (60,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (67,64)
SendNow(Global_MIDI, MM)
songKey == "C#/Db Major" do
MM = MakeNoteMessage (61,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (68,64)
SendNow(Global_MIDI, MM)
songKey == "D Major" do
MM = MakeNoteMessage (62,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (69,64)
SendNow(Global_MIDI, MM)
songKey == "D#/Eb Major" do
MM = MakeNoteMessage (63,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (70,64)
SendNow(Global_MIDI, MM)
songKey == "E Major" do
MM = MakeNoteMessage (64,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (71,64)
SendNow(Global_MIDI, MM)
songKey == "F Major" do
MM = MakeNoteMessage (65,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (72,64)
SendNow(Global_MIDI, MM)
songKey == "F#/Gb Major" do
MM = MakeNoteMessage (66,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (73,64)
SendNow(Global_MIDI, MM)
songKey == "G Major" do
MM = MakeNoteMessage (67,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (74,64)
SendNow(Global_MIDI, MM)
songKey == "G#/Ab Major" do
MM = MakeNoteMessage (68,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (75,64)
SendNow(Global_MIDI, MM)
songKey == "A Major" do
MM = MakeNoteMessage (69,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (76,64)
SendNow(Global_MIDI, MM)
songKey == "A#/Bb Major" do
MM = MakeNoteMessage (70,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (77,64)
SendNow(Global_MIDI, MM)
songKey == "B Major" do
MM = MakeNoteMessage (71,64)
SendNow(Global_MIDI, MM)
MM = MakeNoteMessage (78,64)
SendNow(Global_MIDI, MM)
End // Select
End // If
End // ParameterValueChanged