https://github.com/guichaguri/node-chiptune
Convert tracker music to PCM streams in Node.js (libopenmpt bindings)
https://github.com/guichaguri/node-chiptune
audio-decoder chiptune emscripten libopenmpt nodejs pcm
Last synced: 4 months ago
JSON representation
Convert tracker music to PCM streams in Node.js (libopenmpt bindings)
- Host: GitHub
- URL: https://github.com/guichaguri/node-chiptune
- Owner: Guichaguri
- License: lgpl-2.1
- Created: 2016-02-17T19:46:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-08-21T11:08:33.000Z (about 6 years ago)
- Last Synced: 2025-06-02T02:49:38.188Z (5 months ago)
- Topics: audio-decoder, chiptune, emscripten, libopenmpt, nodejs, pcm
- Language: JavaScript
- Homepage:
- Size: 1.44 MB
- Stars: 19
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-chiptune
[](https://nodei.co/npm/node-chiptune/)Convert tracker music to PCM streams in Node.js.
[Emscripten](https://github.com/kripken/emscripten) was used to translate [libopenmpt](http://lib.openmpt.org/libopenmpt) to Javascript.If you are looking for a HTML5 player to play tracker music, check out [Chiptune2.js](https://github.com/deskjet/chiptune2.js)
## Example
```javascript
var chiptune = require('node-chiptune');
var speaker = require('speaker');fs.readFile('file.mod', function(err, data) {
if(err != null) {
console.log(err);
} else {
// Create a chiptune readable stream
var chiptuneStream = chiptune(data, {
channels: 2, // 2 channels (stereo)
sampleRate: 48000 // 48,000 Hz sample rate
});
// We should be able to pipe the chiptune stream to the speaker
chiptuneStream.pipe(new Speaker());
}
});
```## Supported formats
Basically all the formats supported by libopenmpt, here is the list:`mod s3m xm it mptm stm nst m15 stk wow ult 669 mtm med far mdl ams dsm amf okt dmf ptm psm mt2 dbm digi imf j2b gdm umx plm mo3 xpk ppm mmcmp`
## Thanks to
* [Deskjet](https://github.com/deskjet) for helping me understand how libopenmpt works
* [OpenMPT](http://openmpt.org/) for their library that made this project possible