Automatic start of a midi file

Hi everybody, I’m new to GP and I’m trying to learn how to use GP; I cannot find a way to do the following thing:

I would like that, when switching from a part of a song to another - say from part Intro1 to part Intro2 -, to automatically start playing a midi file loaded into a Media Player…

Said another way, I can associate the press of a widget button to the action of playing the midi file, but not having that action to be performed automatically by GP when entering part Intro2…

Is this thing possible?

Thank you!

Luca

Try using the Save icon in the upper right corner of your song part to store the ‘press’ of the midi file player Play button

https://gigperformer.com/docs/GP4UserManual/how-to-capture-variation-edits.html

Example gig.gig (34.1 KB)

Here’s example gig file. The MIDI File Player starts playing when you activate the second song part.

2 Likes

Thank you rank13; it worked!

The problem now is that if I don’t switch to song part 2 (from song part 1) in perfect sync with the arpeggio that I’m producing using BlueArp by playing chords in my keyboard, the result is that the midi file played by the media palyer (which is a drum groove) is not in sync with the arpeggio itself :confused:

Is there a way in gig performer to force the switching to another song part when the next beat is reached? That would solve the problem I guess…

I mean, I trigger the switching to the next song part before the end of a beat, but GP actually performs the part switching only when the new beat is reached…

Thank you for your help!

Luca

When you completely automate with scripting, the switch to the next song part could be automatic.

Or do you want to press a button and with the next beat the song part is switched?

Check this out
SwitchPart.gig (24.9 KB)

Load the gig
Switch to SetList Mode
The 1st Song Part should be selected
Press Global Play
And when you press the widget then the next part is selected by the next 1st beat.

And this is the script used:

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   NPART : Widget
   SwitchPart : Boolean
//$</AutoDeclare>

initialization
 SwitchPart = false
end

// Called when a single widget value has changed
On WidgetValueChanged(newValue : double) from NPART
 if newValue == 1.0 then
   SwitchPart = true
 end  
End

// Called when beat changes
// Only beat number is valid for now
On BeatChanged(bar : integer, beat : integer)
 if beat == 1 and SwitchPart == true then
    SongNextPart()
    SwitchPart = false
 end   
end

Thank you npudar; I tried your gig file and it worked! :slightly_smiling_face:

Now the problem that I have is the following; given the following scenario:

  1. song part 1: I play chords in the midi keyboard that are captured by BlueArp VST that generates an arpeggio that goes to a bass sound preset in OB-XD VST.

  2. song part 2: the same as song part 1, with the addiction of a midi file played by a MediaPlayer that is a drum groove that goes into MT-Power DrumKit.

With the solution that you and rank13 proposed I can cause that when song part 2 is entered, the midi file gets played by the Media Palyer, but the problem now is that if I don’t switch perfectly in sync from song part 1 to song part 2, the result is that the bass arpeggio and the drum groove are not in sync with each other…

Is there a way in GP to delay the song part switching up until the next beat? That - I think - would solve the “not in sync problem” that I’m experiencing…

Thank you for your help!

Luca

I would like to press a pad in my midi keyboard to drive the switching to the following song part, but I would like that the actual switch were made by GP when the next beat is reached

Just Midi map your controller to the Widget.

What message is sent from you pad on the midi keyboard?

these are the midi events sent by the first row of the 8x2 pads of my novation sl mkiii…

I associated the press of such pads to the selection of 8 song parts in GP.

I dont’ know, maybe I’m pretending too much, I mean pretending features that are specific to DAWs rather than VST hosts…

Now you have a conflict.
Just for a test: Unassing the Midi Controller for Song Part 8 and map it to the widget in the gig I sent you.
Now you should be able to press that pad and with the next beat = 1 the next Song Part is switched.
Because you mapped this message Note Off C#6 it will never reach Gig Performer for further processing and the assignment forces the part you assigned to switched as soon as you send the message from your pad.

So you have to decide what you want.

But lets try first if this working what I described abovew :wink:

Please unman your Midi Controller from switching Song Parts.

Load this gig and when you send the Note On Message C6 – G8 then you can directly switch the song parts by the next beat.

SwitchPartDirect.gig (14.2 KB)

I cannot unserstand what you said above :pensive:
maybe I am still too a newbie on using GP…

Anyway, I tried your gig file and it works: clicking with the mouse on the green button widget causes the song part change to occur when the next beat is reached.

Then I unmapped the eighth pad (the one that was associated with the selection of song part 8) and then re-assigned it to the green button widget in your gig file, but strange things happen: the song automatically switchies from part1 to the following ones without pressing the pad…Maybe I made some mistake…

Ok Unmap the MIDI Controls from switching song parts directly and load the gig SwitchPartDirect

When you send the Note Off from your pads it should work

This is the script used.
The script listens min incoming Midi Messages
The Corresponding Note Off Message switches to the desired Song Part by the next beat.

/

/$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   SwitchPart : Boolean
   MIN : MidiInBlock
   nn  : Integer
//$</AutoDeclare>

initialization
 SwitchPart = false
end

//Called when a NoteOn message is received at some MidiIn block
On NoteEvent(m : NoteMessage) from MIN
 if IsNoteOff(m) then
 nn = GetNoteNumber(m)
 nn = nn - C6
 SwitchPart = true
 end
End



// Called when beat changes
// Only beat number is valid for now
On BeatChanged(bar : integer, beat : integer)
 if beat == 1 and SwitchPart == true then
    SetSongPart(nn)
    SwitchPart = false
 end   
end
1 Like

This works great!

What I don’t understand is how this script can avoid conflicts between midi note on off events generated by pads and midi note on off events generated by keys of my midi keyboard…

Please keep in Mind that this is a rackspace script.
So when you have song parts from different rackspaces then we have to change the script a little bit.

But as long as you are using Song Parts coming from different variations in the same rackspace this should would work perfect.

Maybe we should restrict to a range of revognizes notes.
AND: the Notes you are sending from your controller can not trigger any sound.

So the MIDI Device (I gave it the name MIN) you have change to your MIDI Controller.
Please do not use the MIDI In OMNI.
Use the dedicated MIDI Device from your controller and give it the OSC/GP Script handle called MIN

As long as you don’t do that the script will not work.

Or you take my gig File and replace the physical MIDI Device.

Use a MIDI In Block for controlling the Part Switch
and Use another MIDI Inb blok for your keyboard.

The MIDI IN Block assigned to you pad controller gets the OSC/GP Script Handle MIN
and in scripting it reacts on incoming notes specially from your pad controller.

The other MIDI In block is not known by GP scripting and just get Midi message from your keaboard and sends the message to the connected plugins.

When you connect your PAD Controller and your MIDI keyboard you should be able to see both MIDI In and include that in your rackspace.

SwitchPartDirect.gig (22.7 KB)

Load this gig and change the MIDI Device

Thank you pianopaul for your help, but I’m afraid that I must study in more detail the user’s manual if I want to use your suggestions understanding what I’m doing…
I’ve been using GP only for a few days now, and too optimistically I thought that it would have been easier to do the things I want to do (basically an easier tool than Ableton Live LIte to manage live performances)… :disappointed:

I seem I’m still lacking the understanding of some basic concepts of GP…

Luca

Did you try my last uploaded Gig and did the Midi Device assignment.
That all should be very easy - don’t be frustrated.

When you can work with my gig you claimed the 1st Dan :wink:

And yes, reading the user manual is allays a good idea.