Orchestre-JS

A web tool to create dynamic music

Loading…

Something went wrong! You might need to try another browser?

Controls

Initialization

Initialize an orchestra by providing your song's BPM, then start adding players. Each player represents a musical layer that will play in loop. It needs a name, an audio file, and a length in beat.
const orchestre = new Orchestre(120);
await orchestre.addPlayers([
  {name: 'bass', url: './assets/bass.ogg', length: 16, absolute: true},
  {name: 'melody', url: './assets/melody.ogg', length: 8, absolute: false},
  // etc...
])
orchestre.start();

Play

Activate and deactivate your players to make them play in sync.
There are two kinds of players: absolute and relative. Play around with them to hear the difference!

Absolute

Will always stay on the same beats

Relative

Will play on the first beat when activated

orchestre.play('bass');
orchestre.stop('bass');
// alternate between play and stop
orchestre.toggle('bass');

Options

Orchestre-JS comes with several options to trigger audio layers in different ways.

Play or stop immediately with a fade in and fade out

Play only once

Schedule player on next 2 bars

(Scheduled…)

Stop loop but let the track end

orchestre.toggle('synth', {
  now: true,
  fade: 1.2
});
orchestre.play('jingle', {
  once: true
});
orchestre.schedule("shamisen", 8, "play", {
  absolute: true,
});
orchestre.stop("shamisen", {
  keep: true,
});
  

Events

Subscribe to events to trigger actions on beat.

EIGHT!

Called every two beats

off
await orchestre.wait(8);
let listenerId = orchestre.addListener(() => { playAnimation() }, 2);
orchestre.removeListener(listenerId);
View it on Github