Conditional Tracks

Both instrument and speech tracks support the activeWhen option that determines when the track should play.

This option can either be a function callback or a configuration object. By default a track is always active, but by setting this option it can be configured to only play at certain times.

Below is a demo showing how this can be used to create "zones" in the chart with different configurations for different areas of the chart.

Next Steps

Conditional tracks is also one of the ways to create audio notifications and earcons, which is the topic we will explore next.