신스 엔진을 실제 악기로 변환해 주는 12가지 악기 프리셋입니다. 하나를 클릭한 후 아래 키보드를 연주하거나(또는 MIDI 컨트롤러를 사용하세요). 각 프리셋은 파형, 엔벨로프, 필터, 유니즌, 비브라토를 설정합니다.
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);