high performance MIDI parser and WAV encoder
npm install synth-jsbash
$ npm link synth-js
`
$3
`bash
$ npm install --save synth-js
`
$3
`html
`
After including the file from dst/synth.min.js, the global variable synth will be initialized.
Usage
$3
`bash
assuming song.mid in cwd
$ synth -i song
now song.wav contains raw audio data for song.mid
`
$3
`js
const synth = require('synth-js');
const fs = require('fs');
let midBuffer = fs.readFileSync('song.mid');
// convert midi buffer to wav buffer
let wavBuffer = synth.midiToWav(midiBuffer).toBuffer();
fs.writeFileSync('song.wav', wavBuffer, {encoding: 'binary'});
`
$3
`html
Download
`
See the demo [here][browser-demo].
FAQ
$3
Currently, documentation only exists for the command-line utility.
To access it, use man:
`bash
$ man synth
`
For Node or JavaScript, refer to the src/ directory for accessible APIs:
* synth.WAV()
* synth.MIDIStream()
* synth.midiToWav()`