New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-chiptune

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-chiptune

Convert tracker music to PCM streams

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-chiptune

NPM

Convert tracker music to PCM streams in Node.js. Emscripten was used to translate libopenmpt to Javascript.

If you are looking for a HTML5 player to play tracker music, check out Chiptune2.js

Example

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 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 for helping me understand how libopenmpt works
  • OpenMPT for their library that made this project possible

Keywords

FAQs

Package last updated on 17 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc