MIDI Live Performance Question - Tempo Change?

Have you looked at the MIDISequence object and associated functions in GP Script in Gig Performer 3? :slight_smile:

Here’s an example of something I created to manually step through a sequence in one song I play with a Steely Dan Tribute band. I don’t have time to clean it up right now but if someone wants to dissect it, it might be feasible for this purpose.

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   Keyboard : MidiInBlock
   Bass : MidiInBlock
   LeadSynth : MidiInBlock
//$</AutoDeclare>

var
   cs : MidiSequence
   trackCount : integer
   
initialization
   trackCount := MidiSequence_LoadMidiFile(cs, "your midi file here.mid")
   Print(trackCount)
   MidiSequence_Quantize(cs, 2)
   MidiSequence_MapOutputChannel(cs, 2, 4)
end

// Use this as a finger clock -- pressing C0/D0 one after the other
// continuously behaves like a manual clock to sequence through the events
// Pressing B-1 resets the sequence to the beginning
On NoteEvent(m : NoteMessage) Matching [C0..D0], B-1 from Keyboard        
var
   notes : MidiMessage Array
   aNote : MidiMessage
   index : integer
   trackIndex : integer

   if IsNoteOn(m)
      then
        if MidiSequence_EndOfSong(cs) or m.GetNoteNumber() == B-1
            then MidiSequence_ResetToStart(cs)
        end
            
        MidiSequence_CollectEventsNow(cs);

        notes = MidiSequence_GetCurrentEvents(cs, 3) // Lead synth

        for index = 0; index < Size(notes); index = index + 1 do
          aNote = notes[index]
            
          LeadSynth.SendNow(aNote)
        end                                  
   end            
End


On NoteEvent(m : NoteMessage) Matching A-1 from Keyboard
   MidiSequence_ResetToStart(cs)
   //Panic() // Stop any sounds that were being held
   AllNotesOff(LeadSynth)
end
6 Likes