Hi, I used SongMaster Pro to generate a midifile which contain one regular midi track with note-on and note-off messages as well as a ‘meta’ track with other messages like ‘set_tempo’, ‘marker’, and ‘cue_marker’.
If I view the midi file using the mido package in Python it looks like the following (truncated to a few lines of the ‘meta’ track only).
Input:
midi_file = mido.MidiFile(‘midifile.midi’)
midi_file.tracks
Output:
[MidiTrack([
MetaMessage(‘track_name’, name=‘meta’, time=0),
MetaMessage(‘key_signature’, key=‘B’, time=0),
MetaMessage(‘time_signature’, numerator=4, denominator=4, clocks_per_click=1, notated_32nd_notes_per_beat=96, time=0),
MetaMessage(‘set_tempo’, tempo=554376, time=0),
MetaMessage(‘marker’, text=‘Intro’, time=3800),
MetaMessage(‘set_tempo’, tempo=560181, time=3840),
MetaMessage(‘cue_marker’, text=‘Key change’, time=77),
MetaMessage(‘set_tempo’, tempo=557281, time=3763),
…
Dragging the midifile to the Midi Player in GP, both tracks can be seen. In the Midi Monitor however, I see only CC and NoteOn NoteOff messages, not the Tempo Changes and ‘marker’.
The ‘cue_marker’ metamessage represents the text strings in SongMaster in the “Notes-track” (could be used to indicate when a new section starts or, as in the example above, a key change). The ‘marker’ metamessage seem to represent the ‘Sections’ track in SongMaster (e.g. Intro, Verse, Chorus etc.).
My idea is to program a scriptlet with a callback (e.g. having the scriptlet sending a midi note-on message in response to a specific ‘cue-marker’ or ‘marker’ in the incoming midi metamessage). I am new to the GPScript and in my first attempt I can only get GPScript to respond to regular midi events such as note-on note-off etc, not the metamessages in the ‘meta’ track. However, I have seen that I can have the GP global tempo being adjusted from the tempo changes in the midifile.
My question is therefore, would it be possible to do this with GPScript?