Session
Scribbletune can create a session that can contain multiple channels which can have a single clip or even multiple clips of musical ideas.
Note: tone.js must be loaded in the browser via SCRIPT tag before Scribbletune (or your compiled app - with Scribbletune) is loaded.
You can view this stackblitz app that uses React and Scribbletune to create a simple scale player in the browser.
A session is a simplistic example of Ableton Live's session view. Scribbletune provides just a basic interface to simulate something like that. Here's a cool browser app built using this interface, and this is the repo.
const scribble = require('scribbletune/browser');
const session = new scribble.Session();
Now you can add channels. Here's a kick drum channel:
session.createChannel({
sample: 'https://scribbletune.com/sounds/kick.wav',
clips: [
{ pattern: 'x' },
{ pattern: 'xxx[xx]' },
{ pattern: 'x' },
{ pattern: 'xxx[-x]' }
]
});
And a bass channel:
session.createChannel({
sample: 'https://scribbletune.com/sounds/kick.wav',
clips: [
{ pattern: '[-x]' },
{ pattern: '[--xx]' },
{ pattern: '[-xxx]' },
{ pattern: 'xxx' }
]
});
To play the second row (clip) in all channels:
session.startRow(1);
As always, make sure Tone is loaded and its Transport is started:
Tone.context.resume().then(() => Tone.Transport.start());
Get a list of channels:
session.channels;