I must admit I’ve not thought about using the GP plugin presets as a way to load files per song. But it does work…
- ‘Gig Scripts’ can detect when a song has changed, but this level of script cannot interact directly with widgets or plugins.
- So instead, you can get the Gig Script to send an OSC message that contains the selected song name.
- This OSC message is received back by GP, and detected within the ‘Global Rackspace Script’ (which CAN interact with plugins).
- The Global Rackspace Script then loads the AFP plugin preset that has the same name as the selected song.
-
Activate OSC in the GP Options
-
Add this to the Gig Script editor (Window menu) and click Compile
// Called when you switch to another song
On Song(oldSongIndex : integer, newSongIndex : integer)
OSC_SendStringSpecific("/GP/Song", GetSongName(newSongIndex), "127.0.0.1", OSC_GetGPListeningPort())
End
-
Add an Audio File Player plugin to the Global Rackspace and add an OSC/GPScript Handle (via right-click menu). Call it “AFP” and tick the box for “Use in GPScript”
-
Add this to the Global Rackspace script editor and click Compile
Var
AFP : PluginBlock
// Called when a specific osc message is received
On OSCMessageReceived(m : OSCMessage) Matching "/GP/Song"
LoadGPPreset( AFP, OSC_GetArgAsString(m, 0))
End
- Now, when you switch songs, the AFP will attempt to load a plugin preset that matches the name of the selected song. You will see a confirmation (or error) in the header/title area of GP if it finds a matching preset and successfully loads it.