const halfDuration = (fullSoundDurationMs: number) => fullSoundDurationMs * 16 / 32;
$x.startPlaybackSequence({
intro: [
[{ url: "intro1Melody.flac", durationMs: halfDuration }],
[{ url: "intro2Melody.flac", durationMs: halfDuration }, { url: "intro2Bass.flac" }],
],
loop: [
["loop1Melody.flac", "loop1Bass.flac"],
["loop2Melody.flac", "loop2Bass.flac"],
["loop3Melody.flac", "loop3Bass.flac"],
],
});
A definition of a sequence of sounds to be played. A typical use case would be to define a music which consist of an intro phase, then loops indefinitely. Another use case is to recreate the music composed in PICO-8 – it usually is built from many short samples, tied together. Moreover, the
BpxSoundSequence
allows to crop the sample, which might be useful for a PICO-8 music composed of samples shorter than default 32 bits, but exported as 33-bits long.