12 instrument presets that transform the synth engine into real instruments. Click one, then play the keyboard below (or use your MIDI controller). Each preset configures waveform, envelope, filter, unison, and vibrato.
const synth = new ChiptuneSynth();
await synth.init();
// Load instruments onto tracks
synth.loadInstrument('violin', 0); // Track 0 = Violin
synth.loadInstrument('piano', 1); // Track 1 = Piano
// Play a chord
synth.playNoteByName('A', 4, 0, 2); // Violin A4
synth.playNoteByName('C', 4, 1, 2); // Piano C4
synth.playNoteByName('E', 4, 1, 2); // Piano E4
// List all instruments
console.log(ChiptuneSynth.getInstrumentNames());
// ['piano','violin','cello','flute','organ','brass',
// 'harmonica','synthLead','synthPad','synthBass','marimba','electricGuitar']
// Enable MIDI controller
const devices = await synth.enableMIDI({ track: 0 });
console.log('MIDI devices:', devices);