Audio Player Triggering Song Parts

Currently I am using Stage Traxx to play backing tracks. In stage tracks I can define midi commands to be sent based on the playhead position of the WAV file. So I am triggering song parts in GP based on time (in minutes and seconds) as the WAV files plays. It works well, but I would prefer not to have to run multiple apps.

I am trying to get the same functionality using GP’s Audio Player. But I can’t figure out how to get the audio player to trigger song parts at desired times in a single WAV file used as a backing track.

It looks like this may be possible using the midi metronome in Audio Player, but I haven’t been able to figure it out. Any help would be appreciated.

1 Like

Better is to use the callback
On BeatChanged

Just press the global play button and in this callback you can react on every beat

Thanks for the feedback and the link to the other thread. I was able to get this script working.

on BeatChanged(bar : integer, beat : integer, subbeat : integer)
if bar == 1 then
 SetSongPart(0)
elsif bar == 17 then
 SetSongPart(1)
elsif bar == 37 then
 SetSongPart(2)
elsif bar == 57 then
 SetSongPart(3)
elsif bar == 72 then
 SetSongPart(4)
elsif bar == 92 then
 SetSongPart(5)
end
end

The only issue is that the changes are not precise. The midi clock is not exactly synced with the wav file that’s playing in the audio player plugin. It’s close though. I think if I could add additional beat information along with the existing bar information, I could get the precision I am looking for.

Any ideas on what the syntax would look like?

Also, I would like to add a statement at the end, that is also triggered by beat and bar information, but that allows me to mute the song part. I could make a PC work for the muting if I understood the syntax.

Oops, you should really react on bar.beat
In your script you change every Song Part 4x as the bar remains the same and the beat goes from 1…4

Change it to

on BeatChanged(bar : integer, beat : integer, subbeat : integer)
   if beat == 1
     then
        if bar == 1 then SetSongPart(0)
           elsif bar == 17 then SetSongPart(1)
           elsif bar == 37 then SetSongPart(2)
           elsif bar == 57 then
              ///.... etc. etc
         end  // bar test
   end // Beat test
end // callback

This works great, thanks. Gives me a bit more control too.

I’m trying to embed a program change message in here too. I’m thinking this may work, but I don’t know the syntax.

GetProgramChangeNumber(m: ProgramChangeMessage ) Returns Integer
Returns the program change number of a ProgramChangeMessage MIDI event
Parameters
m (ProgramChangeMessage)
Return type Integer

Or…

MakeProgramChangeMessage(value: Integer ) Returns ProgramChangeMessage
Returns a new ProgramChange MIDI message with the specified value ranging from 0 to 127. The MIDI channel is 1

 Parameters:  value (Integer)
 Return type: ProgramChangeMessage

I decided to create a muted variation and just apply that to the last song part. It gets triggered by GSscript as noted above as an additional songpart. I trigger it at the last second of the song so I’m muted when the song ends. Works fine.

1 Like

Hi this is very interesting progress and I can see others are helping you to reach a successful conclusion. I too use Stage Traxx which I am using in the same way. I get it about using additional apps, however the big thing for me in Stage Traxx is the ability to view music scores (I have a terrible memory!) in pdf form and control when to change pages and go back to codas etc. I am aware GP can display lyrics and pdf’s but there does not seem to be any way to automatically display them, and unlikely to be able to perform page turns - just to say though, well done for developing the song automation, it’s going to be a boon to other users.