12 predefinições de instrumentos que transformam o mecanismo de sintetizador em instrumentos reais. Clique em uma delas e toque no teclado abaixo (ou use seu controlador MIDI). Cada predefinição configura a forma de onda, o envelope, o filtro, o uníssono e o 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);