Gathering detailed insights and metrics for jzz
Gathering detailed insights and metrics for jzz
Gathering detailed insights and metrics for jzz
Gathering detailed insights and metrics for jzz
npm install jzz
Typescript
Module System
Node Version
NPM Version
78.8
Supply Chain
99
Quality
86.5
Maintenance
100
Vulnerability
100
License
JavaScript (98.51%)
HTML (1.49%)
Total Downloads
222,057
Last Day
54
Last Week
761
Last Month
7,618
Last Year
58,325
529 Stars
626 Commits
28 Forks
13 Watching
1 Branches
6 Contributors
Latest Version
1.8.7
Package Id
jzz@1.8.7
Unpacked Size
371.42 kB
Size
58.78 kB
File Count
13
NPM Version
8.4.1
Node Version
20.12.1
Publised On
30 Nov 2024
Cumulative downloads
Total Downloads
Last day
-58.5%
54
Compared to previous day
Last week
-32%
761
Compared to previous week
Last month
6.2%
7,618
Compared to previous month
Last year
26.9%
58,325
Compared to previous year
2
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.
npm install jzz --save
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
.
1<script src="JZZ.js"></script> 2//...
1<script src="https://cdn.jsdelivr.net/npm/jzz"></script> // the latest version, or 2<script src="https://cdn.jsdelivr.net/npm/jzz@1.8.7"></script> // any particular version 3//...
1<script src="https://unpkg.com/jzz"></script> // the latest version, or 2<script src="https://unpkg.com/jzz@1.8.7"></script> // any particular version 3//...
1var JZZ = require('jzz'); 2//...
1import { JZZ } from 'jzz'; 2//...
1require(['JZZ'], function(JZZ) { 2 //... 3});
1var navigator = require('jzz'); 2navigator.requestMIDIAccess().then(onSuccess, onFail); 3// ... 4navigator.close(); // This will close MIDI inputs, 5 // otherwise Node.js will wait for MIDI input forever. 6// In browsers the funcion is neither defined nor required.
1JZZ().or('Cannot start MIDI engine!') 2 .openMidiOut().or('Cannot open MIDI Out port!') 3 .wait(500).send([0x90,60,127]) // note on 4 .wait(500).send([0x80,60,0]); // note off 5JZZ().openMidiIn().or('Cannot open MIDI In port!') 6 .and(function() { console.log('MIDI-In: ', this.name()); }) 7 .connect(function(msg) { console.log(msg.toString()); }) 8 .wait(10000).close();
1var input = JZZ().openMidiIn(); 2var output = JZZ().openMidiOut(); 3var delay = JZZ.Widget({ _receive: function(msg) { this.wait(500).emit(msg); }}); 4input.connect(delay); 5delay.connect(output);
1// All calls below will do the same job: 2port.send([0x90, 61, 127]).wait(500).send([0x80, 61, 0]); // arrays 3port.send(0x90, 61, 127).wait(500).send(0x80, 61, 0); // comma-separated 4port.send(0x90, 'C#5', 127).wait(500).send(0x80, 'Db5', 0); // note names 5port.noteOn(0, 'C#5', 127).wait(500).noteOff(0, 'B##4'); // helper functions 6port.note(0, 'C#5', 127, 500); // another shortcut 7port.ch(0).noteOn('C#5').wait(500).noteOff('C#5'); // using channels 8port.ch(0).note('C#5', 127, 500); // using channels
1// in the environments that support async/await: 2async function playNote() { 3 var midi = await JZZ(); 4 var port = await midi.openMidiOut(); 5 await port.noteOn(0, 'C5', 127); 6 await port.wait(500); 7 await port.noteOff(0, 'C5'); 8 await port.close(); 9 console.log('done!'); 10} 11// or: 12async function playAnotherNote() { 13 var port = await JZZ().openMidiOut(); 14 await port.noteOn(0, 'C5', 127).wait(500).noteOff(0, 'C5').close(); 15 console.log('done!'); 16}
1var logger = JZZ.Widget({ _receive: function(msg) { console.log(msg.toString()); }});
2JZZ.addMidiOut('Console Logger', logger);
3
4// now it can be used as a port:
5var port = JZZ().openMidiOut('Console Logger');
6// ...
7
8// substitute the native MIDIAccess
9// to make virtual ports visible to the Web MIDI API code:
10navigator.requestMIDIAccess = JZZ.requestMIDIAccess;
1JZZ.MIDI.freq('A5'); // => 440
2JZZ.MIDI.freq(69); // => 440
3JZZ.MIDI.freq(69.5); // => 452.8929841231365
4// from frequency:
5JZZ.MIDI.midi(440); // => 69
6JZZ.MIDI.midi(450); // => 69.38905773230853
7// or from name:
8JZZ.MIDI.midi('A5'); // => 69
MIDI2()
is an adapter that enables MIDI 2.0 in all subsequent chained calls.
MIDI1()
returns the operation back to MIDI 1.0.
Note that the downstream MIDI nodes don't require any special actions to receive and transfer MIDI 2.0 messages:
1var first = JZZ.Widget(); 2var second = JZZ.Widget(); 3var third = JZZ.Widget(); 4first.connect(second); 5second.connect(third); 6third.connect(function (msg) { console.log(msg.toString()); }); 7 8first 9 .send([0x90, 0x3c, 0x7f]) // 90 3c 7f -- Note On 10 .MIDI2() // enable MIDI 2.0 11 .send([0x20, 0x90, 0x3c, 0x7f]) // 20903c7f -- Note On 12 .MIDI1() // reset to MIDI 1.0 13 .send([0x90, 0x3c, 0x7f]) // 90 3c 7f -- Note On
When used with MIDI 2.0, most of MIDI 1.0 helpers require group
as an additional first parameter
and produce MIDI 1.0 messages wrapped into UMP packages.
Most of the new MIDI 2.0 helpers don't have corresponding MIDI 1.0 messages.
Use gr()
, ch()
and sxId()
calls to set default group
, channel
and SysEx ID
for the subsequent calls.
MIDI2()
and MIDI1()
clear off default group
, channel
, SysEx ID
and MPE
settings:
1first 2 .noteOn(5, 'C5', 127) // 95 3c 7f -- Note On 3 .ch(5).noteOn('C5', 127) // 95 3c 7f -- Note On 4 .MIDI2() 5 .noteOn(2, 5, 'C5', 127) // 22953c7f -- Note On 6 .gr(2).noteOn(5, 'C5', 127) // 22953c7f -- Note On 7 .ch(5).noteOn('C5', 127) // 22953c7f -- Note On 8 .MIDI2() 9 .noteOn(2, 5, 'C5', 127) // 22953c7f -- Note On 10 .ch(5).noteOn(2, 'C5', 127) // 22953c7f -- Note On 11 .MIDI2() 12 .umpNoteOn(2, 5, 'C5', 127) // 42953c00 007f0000 -- Note On 13 .gr(2).umpNoteOn(5, 'C5', 127) // 42953c00 007f0000 -- Note On 14 .ch(5).umpNoteOn('C5', 127) // 42953c00 007f0000 -- Note On
More on MIDI 2.0 support...
Check the Getting Started page and the API reference for more information...
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More