Fade out custom script occasionally mutes session

I’m running a custom script that fades out transition tracks and skips to the next song. Sometimes, after the skip, only the click track plays while all other tracks remain silent until I pause and resume playback. All other tracks are set at 0db. Here’s the script if you might find anything wrong. This may be an ableton issue but not sure.

sendOsc("/mixer/transitions/fadeTo", 0);
await sleep(200);
await waitForOscChange("/mixer/transitions/isFading");

sendOsc("/global/stop");
await waitForOscChange("/global/isPlaying");

sendOsc("/setlist/jumpBySongs", 1);
sendOsc("/mixer/transitions/volume", 0.85); 
sendOsc("/global/play")

Hey @Combo,

Here’s a script you can try and see if it fits your workflow:

sendOsc("/mixer/transitions/fadeTo", 0);
// wait for fade to start, then finish
await waitForOscChange("/mixer/transitions/isFading");
while (osc("/mixer/transitions/isFading")) {
await sleep(50);
}
sendOsc("/global/stop");
if (osc("/global/isPlaying")) {
await waitForOscChange("/global/isPlaying");
}
sendOsc("/setlist/jumpBySongs", 1);
await waitForOscChange("/setlist/activeSongName");
sendOsc("/mixer/transitions/volume", 0.85);
await sleep(50);
sendOsc("/global/play");

Let me know if this solves the issue!

1 Like

It seems to have worked! Could you clue me in on how the changes worked as opposed to my code. I’m really new to this and pieced mine from previous post. Also how would i adjust the fade length? Im assuming its the first sleep command

Hey @Combo,

Glad to hear it worked!

In your original script, the main issue was timing.

It was fading, stopping, jumping, and playing again in very quick succession. On top of that, it did not explicitly wait for the jump to fully complete before sending /global/play. That could create a small race condition where playback restarts while AbleSet is still processing the song change, which can result in only the click playing until you manually pause and resume.

The updated version fixes that by:

• Waiting for the fade to fully complete
• Making sure playback is actually stopped
• Waiting for /setlist/activeSongName to change after the jump
• Only then triggering /global/play

So everything happens in the correct order.

About fade length:

The fade duration is controllable directly in the fadeTo command.

The format is:

/mixer/[group name]/fadeTo [volume] [speed]

Volume can be a value between 0 and 1, or "previous" if you want to restore the group to its previous level.
Speed is optional and acts as a multiplier.

By default, when speed is 1, it takes about 5 seconds to fade from -Inf to +6 dB.

If you want a faster fade, use a higher value.

Hope that clarifies it!

1 Like