Strange problem with linked widgets and audio players

I want to use an audio file player (AFP, because it can play several tracks simultaneously), and a streaming audio file player (SAFP, because of its markers possibilities), both in the same rackspace.
They must be started/paused and stopped simultaneously. To achieve this I am using 2 pairs of linked widget buttons:
-one button mapped to SAFP Play and another mapped to AFP Play/Stop, both linked via widget link A
-one button mapped to SAFP Stop and another mapped to AFP Playhead Position, both linked via widget link B
This works well and I can start, pause, restart, sop/rewind both players in synchronism.
EXCEPT that after a delay, players suddenly stop ! I observed that this delay corresponds to the sum of the durations of both audio files divided by two. Problem happens with any audio file of any length (mp3 and/or wav).
There is no script, no plugin in the rackspace except the two audio players and no marker in the SAFP. So no ‘external’ potential cause of problem. Note that if I remove the link between buttons mapped to Stop, problem disappears (but I cannot stop players in sync :sleepy_face: ).

Of course, I could replace widget links by scripts (in fact I did this and it works) but that would be a pity not to be able to use this linked widget feature so much it is easy.

Could it be a bug, or am I doing something wrong ?

Could you upload a minimal gig file? Saves me the trouble trying to get the same config.

And also:
How do you expect this to work:

  1. Both start playing from the beginning. Each player plays until the end of its file
  2. Both start playing from the beginning. Both players stop whenever one of both has reached the end.
  3. You tell me :slight_smile:

What happens when you sync both players to global play and press the global play button, no use of widgets

I will upload the gig tomorrow. It is too late tonight for me.

Just a question as I am new here. Do I put my small gig on a server like Google Drive or Giga and post the link here, or there is a place here where I can upload it ?

To answer your question , I want both players start from the beginning, but also to be paused/restarted, stop together when I press a button or when the end of audio is reached. Except the problem I mention, it works exactly like this. What is strange is this delay before stopping that is half of the sum of both files durations. So audio players are involved. But I made a short script to replace the widegt link on the stop buttons and in this case it works well. So Widget link seems also involved. Also with exactly the same panel but replacing the AFP by an SAFP, it works. So it seems also that the combination SAFP + AFP is involved. Etc… I spent a full day at that but could not find any logical answer.

As said, I have workaround but I still though useful to report this strange behaviour.

I am a bit new with GP and I still ignore many things. For example, what do you mean with “Global Play” and Global Play button ?

Normally it should be possible to drag and drop the gig file in a post here on the forum, but sometimes permissions have to be adjusted (@npudar?)

He should be able to ZIP it and upload it here (up to 10 MB).

1 Like

He should be good to upload.

Switch these on:

And here’s the global play button (you can automate this using the ‘System Actions’ plugin, but for a first test, I think that’s not needed):

Just to be complete:

3 Likes

Here is the gig

I reduced it to the minimum. You can use any audio file in players. Mines were 2’54 each (approx) and with these files players stop at 1’29” . It will be different with if files are longer or shorter.

test-8.gig (65.7 KB)

So I just tried the Global Play, including widget/System action. It works well of course.

The only point with this method is that it does not allow to Pause/Restart the players that I can do with my linked widgets as the players allow it.

With the real rackspace, I am using this to be able to play a Backing track in the SAFP, while having the raw lead guitar in AFP together with original recording. This allows me to tune the patch by playing either BT+lead (going through the patch) or the original recording and comparing. Pause is useful as it allows to tune the patch then restart, etc..

I have a workaround with script however, but this strange behaviour when linked widgets are used was deserving some reporting in my opinion.

However, many thanks for your help ! I learnt another thing today. G.P has so many nice features that I discover new ones everyday :star_struck:

If you can fix it yourself then that’s the best way: you gain the knowledge and enjoy the results :+1:

I can reproduce the issue, and used a scripted workaround as follows:

  • Remove widget link B ( which are the widgets that control Playhead Position in the Audio File Player and the Stop parameter in the Streaming Audio File Player
  • Add a script to the rackspace (The widget for the Stop parameter in the Streaming Audio File Player has handle of StopSAFP and the widget for the Playhead Position in the Audio File Player has a handle of PositionAFP)
Var
   StopSAFP : Widget
   PositionAFP : Widget

On WidgetValueChanged(newValue : double) from  StopSAFP
    SetWidgetValue(PositionAFP,0)
End

Using this method you don’t have to use Global Play and the players remain in sync.

It is what I had done to make it work as it was the linked Stop buttons that were causing the issue. It is better than Global play as it allows to pause/restart both players, which is what I want. Thanks you for your time Ed and have a nice end of year.

1 Like

Please see your private messages!

I think I may have figured out what is happening in your original report.
As I recall, the issue was that the audio files stopped halfway into the playback.

In your gig file, you have a widget mapped to the Player Position parameter of the Audio File Player. That button is also widget-linked to the Stop parameter of the Streaming Audio File Player.

The issue ( I think) is that with the widgets linked, relative generic widget integer values between 0 and 127(or between 0 and 1 float values) are interchanged (to stay in sync). I believe that the Stop parameter of the Streaming Audio File Player will engage when that generic widget value reaches its halfway point. So what I think is happening is, the Player Position parameter is calculating the total length of the song, and then scaling the reporting of its widget value based on that calculation. When the position reaches the halfway point of the song, it is reporting that generic widget value via widget link to the other widget (the Stop widget of the SAFP). This activates the Stop widget – because the value is at its halfway point, it now turns on. This in turn stops both players.
I don’t think it’s a bug per se, just a result of how the widgets of these two parameters interact when assigned via widget link. It’s an odd circumstance, but I don’t necessarily think anything is broken or wrong.

My 2 cent hypothesis.

1 Like

Just to sweeten a bit this naggy problem, i just fed Suno AI with the following prompt:
“a song in electropop style about running only the half way is enough, refuse to go the full distance, press the stop button at 50%, causing the world to a halt. the song ends with a sudden stop”

…and got this amazing result (which can also be used to have a common audio base, since it’s non commercially AI-generated).

Lyrics:
[Verse 1]
Started the race
Then I liked the view
Halfway there
I was done with “push through”
Saw the signs
“Keep going” in red
I hit pause
Let the rest run ahead

[Pre-Chorus]
Every staircase
Doesn’t need the top
Every timeline
Doesn’t need the drop
If the bar says
“Higher” every time
I pull the plug
Right before the climb

[Chorus]
Fifty percent stop
I’m freezing the frame
Half a heartbeat
Still counts the same
If I cut the cord
The circuits all stall
Pressing stop at halfway
Takes the world with my fall
Takes the world
Takes it all

[Verse 2]
People shout
“You’re wasting your prime”
But who decided
What’s a finished line?
If the wheel spins
It can also stay still
One small click
Overrules their will

[Pre-Chorus]
Every engine
Only runs if I
Feed it seconds
Let the numbers fly
So I hold back
Let the countdown hang
Leave the last half
Dangling on a bang

[Chorus]
Fifty percent stop
I’m freezing the frame
Half a heartbeat
Still counts the same
If I cut the cord
The circuits all stall
Pressing stop at halfway
Takes the world with my fall
[Chorus]

[Bridge]
[low vocal register] Mid-breath
Mid-word
Mid-kiss
Mid-turn
I choose
This cliff
Half-built
Half-burned
[whispered vocals] One thumb
One touch
No more
[staccato synth hits]

3 Likes

You could say that. :rofl:
Fun though.

2 Likes

I apologize :anguished_face:
For some reason, I was not notified of your last answer in this thread. Also, as this discussion was pursued in another thread, where I was proposed other solutions, I stood with the idea that initial problem had not received explanation. Sorry for that.

I have not understood everything of your last answer above especially this “halfway point”, but what you explain seems logical and corresponds to what is observed. (stop in the middle). So I agree that this is not a bug per se and only an odd coincidence. But I will remember to avoid this kind of construction.
Than you for your time to analyze this.

1 Like

The thing is: You learned the varying “floating” value of the song position (will climb at very little steps from 0 to 1.0) to a button widget which only knows two states OFF (0) or ON(1.0), while every value below 0.5 means OFF and as soon as the value climbs over 0.5 it will turn to ON (rounding between the two possible states).
So it should be clear that as soon as the song position goes over 0.5, the button will be triggered!

You can try this by linking a knob widget to a button widget (the knob simulates the incoming value of the song position)… as soon as you pass the 50% mark, the linked button will change its state!
position2button

So, maybe we would need a “end of track reached” parameter or something like that, which will be set if… well, the track has reached its end. Could also be an optional marker setting within the SAFP → feature request! :wink:

1 Like