12 Instrumenten-Presets, die die Synth-Engine in echte Instrumente verwandeln. Klicken Sie auf eines und spielen Sie dann auf dem Keyboard unten (oder verwenden Sie Ihren MIDI-Controller). Jedes Preset konfiguriert Wellenform, Hüllkurve, Filter, Unisono und 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);