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

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

Are you looking for something like this?

image

// Called when rackspace is activated
On Activate
//
m : midiMessage

//<statements>
m = MakeControlChangeMessage(<number : int>, <value : int>)
SendNow(m)       // <m : midiMessage>

End

For a lot of controllers that can receive MIDI for updating LEDs, they use the same MIDI CC that the button/switch is sending into GP. In this case, you can simply use the “Sync” button in the widget properties window (MIDI tab), which will enable this bidirectional sync.

Hi, thanks for the reply. Not exactly. The principle is that one, but i think it cannot be rack space activated but songpart. If is a rack space scriplet will only change when I switch rackspaces, but on the same song I may have different variations inside the racks space that will not activate with that approach

Hi, thanks. I’m using a sofstep 2. LED control is achieved through a sequence of three midi commands, one for the led selection, one for the color, and one for the blink type . Also the difficulty is not to achieve control of leds manually, but automatically when a song part changes. I want the scripted to “read” what is active on the song part and activate the corresponding leds.

I will keep looking

Am I mistaken? If the scriptlet is in each song part, does it not run when the song part becomes active? If so, you can send as many messages as needed from each song part. It could be unique for each part or it could be one for all that detects which part has been activated.

Scriptlets are not in Song Parts…you can’t have a plugin in a song part. A song part is simply a reference to some variation in some rackspace. Scriptlets (like any other plugins) live in rackspaces.

1 Like

Still learning here. So, to solve this problem, would you have a rackspace variation for each song part and then use
On Variation (oldVariation , newVariation )
to capture variation (song part) changes?

That would go into rackspace script instead of a scriptlet, right? In this case, you would not care what variation you came from. You would only need to know the new variation in order to send related parameters. Correct?

With this goal, any custom scripts should be linked to widgets that you have mapped to your foot controller buttons/switches. These scripts would be ‘rackspace scripts’ that will trigger when the widget changes.

Song parts simply reference a rackspace ''variation". So if you have variations that are changing the widgets, then the rackspace script will ensure the right midi messages are sent out to your controller to keep it in sync.

Scriptlets are another option: there are often multiple ways to achieve the same thing.