Wav Player functionality

I want to hit a key to start the player, and if I hit that key again I want it to stop. Then, whenever it is stopped, I want it to always start from the beginning (as opposed to continue from where I stopped).
Is that possible?

Some (or all) of what you’re asking may be available only going thru scripting
https://gigperformer.com/docs/Userguide36/gpscriptintro.html

Besides, there are users that have already created scripts addressing some of the functionality you have in. mind; a quick search on the forum can get you closer?

I also can take a look later over to some scripts I have.

Here’s a little script to accomplish that task. I set up two Toggle Switch widgets, assigned one to Play From Beginning and the other to Play/Pause (both are functions of the Media Player). I named them PLAY and PAUSE in the GP Script name field under the Advanced tab of widget properties. Set up the PAUSE widget to respond to whatever key you want to use to trigger the player.

Var

PLAY : Widget
PAUSE : Widget
A : Double

On WidgetValueChanged(newValue : double) from PAUSE
A = GetWidgetValue(PAUSE)
If A == 1.0 then SetWidgetValue(PLAY,1.0)
End

2 Likes

There is no need for any script to do this.

Simply enable the “SYNC” button in the audio file player and then the global play will play it and when you stop and play again - it will start from the beginning.

You can also learn the midi command for the global play if you wanted to.

That’s only going to be useful if you aren’t keeping the global play engaged all the time. Otherwise, scripting will be required.

Thank you. Probably good to have something easy like that to get some scripting experience.
BTW, my old VSampler is still my workhorse player (32bit with jbridge). Because I like how easy it is to setup a playback using the same note to trigger, and stop, a sample, and… always starts from beginning.

@djogon
So using your suggested method, then on any, or all, racks I can have multiple wav files, each triggered from a different midi note (or midi button). And each note “toggles” the playback on/off, AND always starts from the beginning… right?
(NOTE: To be clear, I want the wav files to be unique to, and change with the current active rack so I can use same note(s) on different songs to be triggering the wav relevant to that song. Your mention of “global play” makes me wonder about that)

@dougalex - I am talking about the global play button which can be controlled with a MIDI event assigned to it in global options.

If you want to have a kind of a backing track player - I suggest you actually create a second instance of GP just for that purpose and independantly control things.

I typically use a button widget connected to the “Play/Stop” parameter of the audio file player, then another button connected to the “Play from Beginning” parameter and a horizontal slider for playhead position.

IMPORTANT: for the Play/Stop button I go into the “value” properties of that widget and set the value on load to be 0.0, then also check the button that says “Also on rackspace activation”

This has the effect of the playback always being halted when you switch to a new rackspace and you have to push play to start the play.

Here’s a really, really simple gig file with 5 rackspaces (just copied the first one). You’ll have to load your mp3 or wav files into the players to get sound.

simple-playback.gig (34.6 KB)

1 Like