setTrackVolume

Built-ins

Canonical ID: media.setTrackVolume. Nederlands: zetSpoorVolume.

Sets a named track volume from 0 to 100. It can prepare a track before playback starts; master and track gains multiply.

Signature

setTrackVolume(track, percentage)

Example

# language: en
setTrackVolume("bass", 30)
startMelody("bass", "C3:2 G2:2", 120, "pluck")
wait(2)

Values and host support

Audio calls return None and do not block. Volumes are finite numbers from 0 to 100. Track names are case-sensitive text, 1–64 Unicode code points, with no control characters and not only whitespace. There are at most 16 named tracks and 32 simultaneous voices. Notes use C4, C#4, Bb3 or R; a score adds :beats. Beats range from 1/64 to 64; tempo is 20–400. Instruments include chip, bell, pluck, flute, drums and the 128 exact gm. instrument IDs in the instrument picker. See the music guide for score bounds and lifetime.

Sounds use packaged project paths, not arbitrary files or URLs. A WAV example requires that asset in the .bipli project. Native Windows/Linux/Pi supports bounded PCM WAV; other codecs depend on the IDE/browser. Synthesis requires no asset. The text-only CLI and phone preview do not play this audio.

Music and sound