Jazz-Soft.net
We make it sound!
Home » Documentation » JZZ.js

JZZ.js: MIDI library for Node.js and web-browsers

Async MIDI made easy!

Get the latest release at GitHub or at npm.

JZZ.js is a JavaScript MIDI library that hides asynchronous calls behind the developer-friendly chaining syntax.

It works with Node.js and all major browsers in Linux, MacOS and Windows, and, with some limitations, on iOS and Android devices.

For the best user experience, it's highly RECOMMENDED (though not required) to install the latest version of Jazz-Plugin and browser extensions from Chrome Web Store or Mozilla Add-ons.

Features

"Getting Started" example

  // load JZZ in HTML:
  <script src="scripts/JZZ.js"></script>
  // or in Node.js:
  var JZZ = require('jzz');

  ...

  JZZ().or('Cannot start MIDI engine!')
       .openMidiOut().or('Cannot open MIDI Out port!')
       .wait(500).send([0x90,60,127])
       .wait(500).send([0x90,64,127])
       .wait(500).send([0x90,67,127])
       .wait(500).send([0x90,72,127])
       .wait(1000).send([0x90,60,0]).send([0x90,64,0]).send([0x90,67,0]).send([0x90,72,0])
       .and('thank you!');

  ...

Asynchronous example

async funcion playNote() {
    var port = await JZZ().openMidiOut(/Microsoft/); // Microsoft GS Wavetable Synth
    await port.noteOn(0,'C#5',127).wait(500).noteOff(0,'C#5');
    console.log('thank you!');
}

See also