ShutDown a track

Hi, Id like to know how shut down a track:
I know that to silence it i could mute it, but id like to know which should be the best approach to save cpu resources. I’d like also that this process should be speed because I’d like to turn on and off the tracks a lot of time during performance

You should use mute. It will stop processing the track upstream. There is an option Edit::processMutedTracks that defaults to false. The only exception is tracks that are a sidechain source will process while muted.

Note: Using the mute property of a Volume & Pan plugin is not the same as muting a track. It will just drop level to 0 and keep processing.

1 Like

ok You’re right! I can use mute of volume & pan plugin to mute track but continuing to process signal and mute of track with Edit::processMutedTracks to shutdown the track. Thank you!

Sorry to all, it’s again me, in my app finally I decided to have 3 buttons: enable(mute track and doesn’t process plugin of track), mute(mute track and process plugins of track) and solo.

For clarity I’d like to set Edit::processMutedTracks to false and add a cachedValue in my track called enabled that if enabled achieve the same result only for that track of set Edit::processMutedTracks to true.

So the question is: what is done in the track (and so what changes) changing Edit::processMutedTracks? I’d like to implement a method ‘setEnable(bool)’ that mutes the track without processing.

Thankyou!

Not quite following that you are trying to do. But I think your best option is:

When you want a track to not process, use Track::setProcessing().

Set Edit::processMutedTracks to true

Use mute to stop a track but keep it processing. Does that cover all your cases?

1 Like

Yes it covers, but to understand, where track performs somethig as ‘nextAudioBlock’? Or who performs it for this track?

Any item in the Edit that can process audio implements a function createAudioNode() which returns an object that does the audio processing.

When creating the main audio node we loop over the tracks and check if they are processing, and if they are, then create an audio node for them.

There is a TrackMutingAudioNode created by the track. This checks the mute status, if not mute, it calls the inputs nodes to get their input. Otherwise it just returns. (There is also a bit of logic to avoid clicks and stuck midi notes)

1 Like

Thank you!