All Projects → jazz-soft → Jzz

jazz-soft / Jzz

MIDI library for Node.js and web-browsers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jzz

Daw
GridSound (0.33.0) wants to be an open source online digital audio workstation following the new WebAudio API 🎛🎹🎵✨
Stars: ✭ 804 (+147.38%)
Mutual labels:  audio, webaudio, web-audio
Awesome Webaudio
A curated list of awesome WebAudio packages and resources.
Stars: ✭ 685 (+110.77%)
Mutual labels:  audio, midi, webaudio
Sonorous
Sonorous streamlines working with web audio, enabling easy audio integration into web apps and games.
Stars: ✭ 47 (-85.54%)
Mutual labels:  audio, webaudio, web-audio
Clubber
Application of music theory in audio reactive visualizations
Stars: ✭ 325 (+0%)
Mutual labels:  audio, midi, web-audio
Fsynth
Web-based and pixels-based collaborative synthesizer
Stars: ✭ 146 (-55.08%)
Mutual labels:  audio, midi, webaudio
Eternal
👾~ music, eternal ~ 👾
Stars: ✭ 323 (-0.62%)
Mutual labels:  midi, webaudio
Adlplug
FM Chip Synthesizer — OPL & OPN — VST/LV2/Standalone
Stars: ✭ 249 (-23.38%)
Mutual labels:  audio, midi
webaudio-synth
WebAudio Polyphonic Synthesizer
Stars: ✭ 83 (-74.46%)
Mutual labels:  midi, webaudio
fastidious-envelope-generator
Envelope generator (aka ADSR) for the Web Audio API that aims to be free of artifacts and handle edge cases well
Stars: ✭ 56 (-82.77%)
Mutual labels:  webaudio, web-audio
Midiplayerjs
♬ Midi parser & player engine for browser or Node. As a parser converts MIDI events into JSON. Works well with single or multitrack MIDI files.
Stars: ✭ 199 (-38.77%)
Mutual labels:  audio, midi
Shape-Your-Music
A web application for drawing music.
Stars: ✭ 106 (-67.38%)
Mutual labels:  midi, webaudio
midi
An Observable based library for the use of Web MIDI API with Angular
Stars: ✭ 35 (-89.23%)
Mutual labels:  midi, webaudio
Videojs Wavesurfer
video.js plugin that adds a navigable waveform for audio and video files
Stars: ✭ 242 (-25.54%)
Mutual labels:  audio, webaudio
Mt32 Pi
🎹🎶 A baremetal kernel that turns your Raspberry Pi 3 or later into a Roland MT-32 emulator and SoundFont synthesizer based on Circle, Munt, and FluidSynth.
Stars: ✭ 231 (-28.92%)
Mutual labels:  audio, midi
Chataigne
Artist-friendly Modular Machine for Art and Technology
Stars: ✭ 251 (-22.77%)
Mutual labels:  audio, midi
Midir
Cross-platform realtime MIDI processing in Rust.
Stars: ✭ 221 (-32%)
Mutual labels:  audio, midi
jamhub
low-latency jamming space for musicians
Stars: ✭ 29 (-91.08%)
Mutual labels:  midi, webaudio
glicol
(Audio) graph-oriented live coding language and music DSP library written in Rust
Stars: ✭ 853 (+162.46%)
Mutual labels:  webaudio, web-audio
PicoAudio.js
A JavaScript library for playing MIDI (Standard MIDI File) on Web.
Stars: ✭ 28 (-91.38%)
Mutual labels:  midi, webaudio
Standardized Audio Context
A cross-browser wrapper for the Web Audio API which aims to closely follow the standard.
Stars: ✭ 300 (-7.69%)
Mutual labels:  audio, web-audio

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

nodejs firefox chrome opera safari msie edge windows macos linux raspberry pi ios android
npm npm jsDelivr Build Status Coverage Try jzz on RunKit

JZZ.js allows sending, receiving and playing MIDI messages in Node.js and all major browsers in Linux, MacOS and Windows. Some features are available on iOS and Android devices.

JZZ.js enables Web MIDI API in Node.js and those browsers that don't support it, and provides additional functionality to make developer's life easier.

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 or Apple App Store.

Features

  • MIDI In/Out
  • User-defined MIDI nodes
  • MIDI files
  • MPE
  • SMPTE
  • Additional modules

Install

npm install jzz --save
or bower install jzz
or yarn add jzz
or get the full development version and minified scripts from Github

Note: in the (unlikely) case you get into trouble installing the midi-test module, that requires special system configuration, you can safely remove it from the devDependencies by running npm remove midi-test --save-dev.

Usage

Plain HTML
<script src="JZZ.js"></script>
//...
CDN (jsdelivr)
<script src="https://cdn.jsdelivr.net/npm/jzz"></script>       // the latest version, or
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> // any particular version
//...
CDN (unpkg)
<script src="https://unpkg.com/jzz"></script>       // the latest version, or
<script src="https://unpkg.com/[email protected]"></script> // any particular version
//...
CommonJS (Browserify and Node.js command line applications)
var JZZ = require('jzz');
//...
AMD
require(['JZZ'], function(JZZ) {
  //...
});
TypeScript
import * as JZZ from 'jzz';
//...

Web MIDI API

(Node.js example)
var navigator = require('jzz');
navigator.requestMIDIAccess().then(onSuccess, onFail);
// ...
navigator.close(); // This will close MIDI inputs,
                   // otherwise Node.js will wait for MIDI input forever.
// In browsers the funcion is neither defined nor required.

JZZ API

MIDI Output/Input
JZZ().or('Cannot start MIDI engine!')
     .openMidiOut().or('Cannot open MIDI Out port!')
     .wait(500).send([0x90,60,127]) // note on
     .wait(500).send([0x80,60,0]);  // note off
JZZ().openMidiIn().or('Cannot open MIDI In port!')
     .and(function() { console.log('MIDI-In: ', this.name()); })
     .connect(function(msg) { console.log(msg.toString()); })
     .wait(10000).close();
Connecting MIDI nodes
var input = JZZ().openMidiIn();
var output = JZZ().openMidiOut();
var delay = JZZ.Widget({ _receive: function(msg) { this.wait(500).emit(msg); }});
input.connect(delay);
delay.connect(output);
Helpers and shortcuts
// All calls below will do the same job:
port.send([0x90, 61, 127]).wait(500).send([0x80, 61, 0]);   // arrays
port.send(0x90, 61, 127).wait(500).send(0x80, 61, 0);       // comma-separated
port.send(0x90, 'C#5', 127).wait(500).send(0x80, 'Db5', 0); // note names
port.noteOn(0, 'C#5', 127).wait(500).noteOff(0, 'B##4');    // helper functions
port.note(0, 'C#5', 127, 500);                              // another shortcut
port.ch(0).noteOn('C#5').wait(500).noteOff('C#5');          // using channels
port.ch(0).note('C#5', 127, 500);                           // using channels
Asynchronous calls
// in the environments that support async/await:
async function playNote() {
  var midi = await JZZ();
  var port = await midi.openMidiOut();
  await port.noteOn(0, 'C5', 127);
  await port.wait(500);
  await port.noteOff(0, 'C5');
  await port.close();
  console.log('done!');
}
// or:
async function playAnotherNote() {
  var port = await JZZ().openMidiOut();
  await port.noteOn(0, 'C5', 127).wait(500).noteOff(0, 'C5').close();
  console.log('done!');
}
Virtual MIDI ports
var logger = JZZ.Widget({ _receive: function(msg) { console.log(msg.toString()); }});
JZZ.addMidiOut('Console Logger', logger);

// now it can be used as a port:
var port = JZZ().openMidiOut('Console Logger');
// ...

// substitute the native MIDIAccess
// to make virtual ports visible to the Web MIDI API code:
navigator.requestMIDIAccess = JZZ.requestMIDIAccess;
Frequency / MIDI conversion
JZZ.MIDI.freq('A5'); // => 440
JZZ.MIDI.freq(69);   // => 440
JZZ.MIDI.freq(69.5); // => 452.8929841231365

JZZ.MIDI.midi(440);  // => 69
JZZ.MIDI.midi(450);  // => 69.38905773230853

Additional modules

Check the Getting Started page and the API reference for more information.
Your questions and comments are welcome here.

We would really appreciate your support!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].