Performing some function at the end of playback in Audio File Player

I use the Audio File Player for backing tracks. Everything is a one-shot, no looping. All lanes assigned play at the same time. I would love to have a way to know when I’m at the end of the master lane (the longest), so I can control some things, like change the lighting to my default scene at the end of playback. I know I can do this in a script by manually stopping the playhead at the end which could trigger the callback and I can go from there, but I was looking for something more automatic. I could not find anything in the scripting information that could do that. Any ideas would be welcome.

The audio file player includes a parameter for the position/progress of the file. I think you could map a widget to this, and then have a second switch widget that you add to the same widget group.

Using the widget value scaling feature on the switch widget, you could set a custom curve that was a flat line at 0, which only jumps up to 100 right at the far right of the x axis. This would only activate the switch widget when the file player is at the end of the file.

…just a thought - I haven’t tried this yet.

For a scripting solution there are callbacks that detect a parameter change. You would use this callback for this same position parameter mentioned above. When the value is 1.0 you can trigger what you want or send a midi message etc.

1 Like

I did and it works very well.
Also a good solution for some automatic fadeouts I need. :wink:

1 Like