Midi message by SongPart

Hello,
I try to understand GP scripting, but… well i don’t.
I 'm trying to send a midi message when I activate a song part.
Song part 1: Midi message 1
Song part 2: Midi message 2
Song part 3: Midi message 3 ect…

(I know there is a fonction for that, but i want it to be by default, and the same for every song) I want to use it to light up Leds to know which song part i’m at without looking my computer screen.

I wrote that, but… i don’t really know what i’m doing.

var SongPartNumber : Integer

On Songpart(oldSongpartIndex : Integer, newSongpartIndex : Integer)
SongPartNumber = GetCurrentSongPart()
End
On Songpart(oldSongpartIndex : Integer, newSongpartIndex : Integer)
if SongPartNumber = 1
then MakeControlChangeMessageEx(1, 127, 3)
End

Why do you need scripting? Why can’t you just configure the first song part of a song to send a message?

Then export that song to file so you can use it as a template for all your other songs and the first song part will have the MIDI message in it.

Yes thay a solution for New songs

But i already have 50+ songs.
It means i need to enter manualy each midi messages to Every song variation.
(My midi messages are 1 for the light on and 9 to turn off Any other lights)
And if i change midi contrôler. I need to start all over again.
I think it would Take me hours to do that.
That’s the reson why i was looking into GP scripts

OK, what exact message have to be sent when a song is changed?

You can try this Gig Script

// Called when you switch to another songpart
var mm : NoteMessage
On Songpart(oldSongpartIndex : integer, newSongpartIndex : integer)
 if newSongpartIndex == 0 then
  mm = MakeNoteMessage(65, 100)
  SendNowToMidiOutDevice("IAC-Treiber Bus 2", mm)
  mm = MakeNoteMessage(65, 0)
  SendNowToMidiOutDevice("IAC-Treiber Bus 2", mm)
 end 
End

You have to give your present physical MIDI Output Port and the desired note number

Hmm, be very careful using IAC ports - make sure there’s no MIDI In Omni plugin or you will get feedback

Therefore I wrote that the present physical device has to be used.

1 Like

Hello, sorry for the late answer. I used your code @pianopaul. and it’s perfect. Exactly what i needed.
I used it on a few rehearsal and it’s flawless. Thank a lot.

The actual code for my use:

// Called when you switch to another songpart
var mm : ControlChangeMessage
On Songpart(oldSongpartIndex : integer, newSongpartIndex : integer)
if newSongpartIndex == 0 then
mm = MakeControlChangeMessageEx(11,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 1 then
mm = MakeControlChangeMessageEx(11,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 2 then
mm = MakeControlChangeMessageEx(11,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 3 then
mm = MakeControlChangeMessageEx(11,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 4 then

mm = MakeControlChangeMessageEx(11,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 5 then
mm = MakeControlChangeMessageEx(11,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 6 then
mm = MakeControlChangeMessageEx(11,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 7 then

mm = MakeControlChangeMessageEx(11,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

if newSongpartIndex == 8 then

mm = MakeControlChangeMessageEx(11,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

 if newSongpartIndex == 9 then

mm = MakeControlChangeMessageEx(11,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(12,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(13,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(14,127,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
mm = MakeControlChangeMessageEx(15,0,2)
SendNowToMidiOutDevice(“OpenDeck | pico”, mm)
end

End

1 Like

(post deleted by author)

sorry to hijack this thread, but it seems that I’m looking for something similar but done in a different way, and cannot find a way around it.

I want to send midi messages out whenever changing to a new songpart. However, I want to do it with a scriplet to simplify the creation of rackspaces and variations. The goal and mental scheme for it are:

(GOAL) - Send midi commands to a foot controller to turn on / off the LEDs, providing in this way feedback to the plugins that are “on”

(Idea - eventually overdone)

1 - create a rackspace module with button widgets that correspond to each of the footcontroller switches. Associate each of the button widgets to available effects / plugins on the variation. This would “monitor” which effects are “on/off” in each variation
2 - Create a scriplet that links to the widgets and sends the corresponding On / Off Midi commands to controller the footcontroller - The reason for the scriplet is to avoid the need to compile a rackspace script for every variation / song part.
3 - Trigger the scriplet function everytime I select a new song part, reading the values of the new song part and updating the footcontroller accordingly.

The issues I’m facing though is that it doesn’t seem possible to have both widgets and “on Songpart” on the same script in an easy way:

  • “On Songpart” doesn’t seem to be accepted in scriplets
  • Widgets don’t seem to be accepted in SongPart , or gig script
  • “Songpart” is not accepted in rackspaces

Wonder if i’m missing something, or if there is a better way to have live feedback from the plugin status
thanks,

Pedro