One button for Audio File Player: Play (then auto-stop) - Play next...etc

Hi !
I need to be able to trigger clips (occasional soundscape ambiance in long progressive rock songs) and have them automatically stop at the end of each clip and be ready to play the next one right after that with the same command.
It would use only 1 button of my foot pedal. I would place it on the global rackspace with the right wav file order and I would not have to remember where to tap (if it would be a pad launcher).

Any idea? A script that modify the Gig performer integrated Audio File Player behaviour?
Or a VST plugin who could handle this exact behaviour?

Thanks in advance for your help

Mathieu

I would like this feature/function too.

Hi Mathieu,
i am just trying to do this stuff you’d like to have… since the audio player is a bit “special” in some of its functions it’ll be a mixture of quite a few widgets plus a script to control everything.
How many soundfiles max. do you need to be played per song? (Because one audio player instance only offers 8 lanes). Will 8 files be enough?

Hi, thanks for your answer, yes, 8 files it would be enough.
In the case I would need more than 8, I could also insert 1 system per Rackspace, no?
Thanks again for your help !

Bad news here… the audio player’s parameter setting doesn’t work as expected, so i am not able to set this up as it was needed. Seems that i have to discuss this with the devs and the beta-team… most probably this might then be improved in a later version.
A workaround could be, not to use one player with 8 tracks but rather 8 (or more) players with only one track, but i’d have to check this first before i can grant it for sure… sorry.

Ok, thanks for trying ! Any idea of a VST who could handle some external files ?

There is a player-vst from Mirax which looks promising at the first glance, but actually it doesn’t offer all of its functions as parameters (which we needed to properly use it in Gig Performer), and it looks (and behaves) quite buggy too… i guess it is some kind of abandon ware in the meantime.
No recommendation from my side.
Unfortunately i am not aware of any other existing plugin to be a simple file player (with something like a playlist, streaming from harddrive, etc…).
Maybe if someone will ever write a plugin like this, he will be a rich guy… :upside_down_face:

VLC media player may be a solution, I know the API exposure is very comprehensive, although it would be a stand aside application and almost certainly will need a bit of GP script magic. It is also cross platform so could be used on Windows or Mac

I use a script in rackspace to do this. I suppose it can be used in the same way in Global Rackspace by placing the script in the Global Racspace Script Editor. I attach the .gig file

Pressing a footswich starts playing a file in the audio file player.
The playback stops at the end of the file.
Pressing it again will play the next file, etc.

In the script, you just have to change the value of the CC parameter of the footswitch (in my script it is “24”).

You also have to insert a Midi In block in front of the audio file player.
Right click on this block, in OSC/GPScript Handle / Set Handle: give the name “TRIGTRACK” and check GPScript Enabled.
@Mathiross
Finally you have to create a widget mapped in the audio file player to the Play From Beginning function and in the Advanced tab give it the name “PLAY”.

I have adapted this script (written by a forum user) in my own way, which may be a bit messy as I don’t understand much about scripting.
The professionals may be able to correct this, but it works very well for me. :slightly_smiling_face:

And sorry for forgetting the name of the creator of this script that I’ve been using for years, I hope he will recognize himself.

AudioFilePayer-Trig.gig (147.9 KB)

3 Likes

This actually works… it’s very simple but it works. Not bad. :+1:
My planned layout was meant to be a bit more sophisticated with better visual feedback and stuff… that’s when i got stuck, because some functions didn’t work as expected.
I think, your example could eventually a bit improved, but that’d be no “must”.

I am just about to try a “multiplayer” workaround which seems to be working as planned. :wink:

1 Like

Just found it: I want to credit @pianopaul for the original script as well as @dhj for the improvements :slightly_smiling_face:
Scripting assistance

2 Likes

:slightly_smiling_face: So great !! I’ll try it very soon !

Thanks a lot ! :hugs:

1 Like

It works perfectly fine !! The Gig performer community is fantastic !
Thanks again to all of you guys, included @pianopaul and @dhj !

4 Likes

I needed something similar recently and came up with this. Since the effects were in one backing track and I didn’t want to separate them out, I built a player that plays them in succession by defining the start position and duration of each effect. The zip contains the gig and audio file.

AudioPlayer.zip (3.2 MB)

(Sorry there was an error in the original file)

1 Like

Hey ! I also like this method. It’s easier in my case and the reset button convinced me !
Would it be possible to edit the position and duration in Text label widgets ? It would avoid to enter the script editor. I know nothing about scripting but I imagine it could be possible, no ?

I found another issue the start/stop was being triggered by the timer setting the widget to 0. So I need to test that we are starting the next sound.

On WidgetValueChanged(newValue : double) from StartStop  
    if newValue == 1 then
        LAST_TIME = TimeSinceStartup()
        SetTimersRunning(true)
    else
        SetWidgetValue(PlayPosition, position[count]/188)
    end
End

Ok, here we go… it took me some time, but as so often when i’m about to solve a problem that caught my attention, i got lost in details and blingbling. :sweat_smile: :sunglasses: :nerd_face:
So… finally i got something which not only is an eye candy but also works the way it’s expected (at least i hope it).

This is the wiring view:

And this is the panel:

I used eight separate players (technical reasons), where on each player only the first track must be loaded with a file, and the first player must not be empty! (I also added a status box which will give you a hint what’s going on). But empty tracks in between are no problem - they will be automatically skipped!

  • Clicking on the grey boxes in the middle of a track will open the corresponding player to load a file.
    (You will have to change to another rackspace and back after you have loaded or emptied a player to make the changes take place - there seem to be some issues with status-updating between the audio player and connected widgets).
  • In the middle boxes you will see the filename of the sound which is loaded.
    Click them to open the players.
  • A colored field “READY #X” will inform you which track is played next.
  • While a track is playing, the respecting PLAY button will go green as well as the file-name box.
  • A green knob will show you the playing progress of each track.
  • Each track has a separate red knob to adjust its volume in the 16CH mixer.
  • The big green pad will step through the tracks that are loaded with a sound.
  • The big red pad will reset the playing sequence to start at #1 again.
  • There is a fader and a pair of VU meters for the overall volume.

The two big pads would ideally be MIDI learned to a controller of your choice

Here is the gigfile:
Step through 8.gig (895.4 KB)

I hope you enjoy it - have fun! :beers:
Cheers
Erik

And for anyone interested, here is the contained script:

Var
lblStatus, btnStepOn, btnResetToOne : Widget

btnPlayingAP1, btnPlayingAP2, btnPlayingAP3, btnPlayingAP4, btnPlayingAP5, btnPlayingAP6, btnPlayingAP7, btnPlayingAP8 : widget
lblReady1, lblReady2, lblReady3, lblReady4, lblReady5, lblReady6, lblReady7, lblReady8 : widget
lblFile1, lblFile2, lblFile3, lblFile4, lblFile5, lblFile6, lblFile7, lblFile8 : widget
ledLoaded1, ledLoaded2, ledLoaded3, ledLoaded4, ledLoaded5, ledLoaded6, ledLoaded7, ledLoaded8 : widget


ButtonsPlayingArray : widget array = [btnPlayingAP1, btnPlayingAP2, btnPlayingAP3, btnPlayingAP4, btnPlayingAP5, btnPlayingAP6, btnPlayingAP7, btnPlayingAP8]
LabelsReadyArray : widget array = [lblReady1, lblReady2, lblReady3, lblReady4, lblReady5, lblReady6, lblReady7, lblReady8]
filesArray : widget array = [lblFile1, lblFile2, lblFile3, lblFile4, lblFile5, lblFile6, lblFile7, lblFile8]
LoadMarkersArray : widget Array = [ledLoaded1, ledLoaded2, ledLoaded3, ledLoaded4, ledLoaded5, ledLoaded6, ledLoaded7, ledLoaded8]

activetrack : integer = 0 //counting starts at 0
colRed, colYellow, colGreen, colGrey : integer


//user function to set & color the active lane/track
function SetActiveLane (lane :integer)
var index : integer
    for index = 0; index < Size(LabelsReadyArray); index = index +1 Do
        if lane <> index then
            SetWidgetFillColor(LabelsReadyArray [index], colGrey)
        else
            SetWidgetFillColor(LabelsReadyArray [index], colYellow)
        end
    end
    SetWidgetLabel (lblStatus, "Ready to play Track#" + (lane+1))
End

Initialization
    colRed = RGBToColor(0.8, 0.0, 0.0, 1.0)
    colYellow = RGBToColor(0.8, 0.8, 0.0, 1.0)
    colGreen = RGBToColor(0.0, 0.8, 0.0, 1.0)
    colGrey = -12829636 //default "grey" value, read from a label widget with "GetWidgetFillColor(lblFile1)"
    
    SetActiveLane (0) //counting starts at 0
    SetWidgetLabel (lblStatus, "Click the large boxes in the middle to open the player and load a file!")
End

// Called when rackspace is activated
On Activate
    if GetWidgetLabel(LoadMarkersArray[0]) == "0.00" then
        SetActiveLane(0)
        SetWidgetLabel (lblStatus, "Track #1 must not be empty! Click the empty boxes to open the player and load a file! Then change the rackspace and come back.")
    else
        activetrack = 0
        SetActiveLane(activetrack)
    end
End

On WidgetValueChanged (bval : double) from btnStepOn
var actualtrack : integer =0
    if bval > 0.6 Then
        if GetWidgetLabel(LoadMarkersArray[0]) == "0.00" then
            SetActiveLane(0)
            SetWidgetLabel (lblStatus, "Track #1 must not be empty! Please load a file in Player1 / Lane 1!Then change the rackspace and come back.")
        else
            //Set the regarding play-button to ON
            SetWidgetValue(ButtonsPlayingArray[activetrack],1.0)
            actualtrack = activetrack // store actual track# for status message
            
            //check if we reached the end of the available track numbers
            //if not switch one further
            if activetrack == Size (LoadMarkersArray)-1 then
                activetrack = 0
            else
                activetrack = activetrack +1
            end
    
            //check if actual lane is loaded with a file, if not find the next loaded lane
            if GetWidgetLabel(LoadMarkersArray[activetrack]) == "0.00" then
                While activetrack < Size (LoadMarkersArray)-1 and GetWidgetLabel(LoadMarkersArray[activetrack]) == "0.00" Do
	                activetrack = activetrack +1
                end
            end
            
            if activetrack == 7 then activetrack =0 end
                
            SetActiveLane(activetrack)
            SetWidgetLabel (lblStatus, "Playing Track #" + (actualtrack+1) + " / Ready to play Track#" + (activetrack+1))
        end
    end
End

//pressing the Reset To One button
On WidgetValueChanged (bval : double) from btnResetToOne
    if bval >0.6 Then
        activetrack = 0
        SetActiveLane (0)
    end
End

//set label colors according to a track's play button's state
On WidgetValueChanged(w : Widget, index: integer, bval : double) from btnPlayingAP1, btnPlayingAP2, btnPlayingAP3, btnPlayingAP4, btnPlayingAP5, btnPlayingAP6, btnPlayingAP7, btnPlayingAP8
    if bval > 0.6 Then
        SetWidgetFillColor(LabelsReadyArray [index], colGreen)
        SetWidgetFillColor(filesArray [index], colGreen)
    else
        SetWidgetFillColor(LabelsReadyArray [index], colGrey)
        SetWidgetFillColor(filesArray [index], colGrey)
        if activetrack == 0 Then
            SetWidgetFillColor(LabelsReadyArray [0], colYellow)
        end
        SetWidgetLabel (lblStatus, "Ready to play Track#" + (activetrack+1))
    end
End


6 Likes

Hi !! thanks a lot.
You’re near the ultimate solution !
However, I have a big question: how to adapt it to the Global rack space?
In my case it’s the only way because some of my long soundscapes cross song parts and then, rackspace changes. So, the played sound find itself cut, even if I set the rackspace audio tail length to the maximum of 10 sc.
I tried it manually to export-import rack into the global one but as I expected, it’s breaking something in the script who doesn’t want to get compiled.
Is it long to adapt to the global rack space?

If it can be useful, I had fun to reshape the layout to make it more compact (it’s the only thing I can do to help…). It’s in attachment.

Step through 8 - custom layout.gig (800.7 KB)

Unfortunately, this rackspace won’t work correctly as a global rackspace, because of the mentioned “update-issue” of the audioplayer’s parameters. In a local rackspace it’s possible to “persuade” those parameters to update when you change to another rackspace and back, but since there is only one Global Rackspace there is no other to change to and thus no way to get all the parameters updated.
Though the filename labels do update when you change between local rackspaces while the global panel is also shown, the hidden LEDs (which i (ab)use for indicators if a file is loaded or not) will not change their values. This will cause a wrong status information about the loaded files/available tracks.

However, if you want to experiment with it, here is your gigfile with the player-panel as Global Rackspace. The Script had to be slightly corrected… there was a section for the “On Activate” function, which will only work/exist in local rackspaces. For the use in the Global Rackspace, this section could simply be deleted and then the script will recompile ok.

Step through 8 - custom in global.gig (802.3 KB)

2 Likes

I managed to get the global rackspace forced updated:
-load the audio files in the audio players.
-save and quit the project
-reload the project

Does it work for you?
I’m really satisfied with this solution ! Thanks @schamass for your help.

Could the Reset to #1 button restore the playhead position to the start ?
A last, it could be great to have 3 mores buttons:
-“Stop all” (if something goes not right) (I would map it to my existing “panic” footswitch)
-“Next” and “previous” function to be able to move the “ready to play” target. (In case I miss to trigger one of the sound)

EDIT: Rather than NEXT and PREVIOUS, it would be easier and more convenient to have on button per player.

1 Like