npm install jzz-midi-gm
or yarn add jzz-midi-gm
or get the full development version and minified scripts from GitHub
<script src="JZZ.js"></script>
<script src="JZZ.midi.GM.js"></script>
//...
<script src="https://cdn.jsdelivr.net/npm/jzz"></script>
<script src="https://cdn.jsdelivr.net/npm/jzz-midi-gm"></script>
//...
<script src="https://unpkg.com/jzz"></script>
<script src="https://unpkg.com/jzz-midi-gm"></script>
//...
var JZZ = require('jzz');
require('jzz-midi-gm')(JZZ);
//...
import { JZZ } from 'jzz';
import { GM } from 'jzz-midi-gm';
GM(JZZ);
//...
require(['JZZ', 'JZZ.midi.GM'], function(JZZ, gm) {
// ...
});
JZZ.MIDI.programName(midi)
-
map MIDI program value to a General MIDI instrument name.
JZZ.MIDI.programName(midi, msb, lsb)
-
map MIDI program value and bank msb/lsb to a GM2/GS/XG instrument name.
JZZ.MIDI.groupName(midi)
-
map MIDI program value to a General MIDI group name.
JZZ.MIDI.percussionName(midi)
-
map MIDI note value to General a MIDI percussion name.
console.log(JZZ.MIDI.programName(60));
// => 'French Horn'
console.log(JZZ.MIDI.programName(24, 0, 1));
// => 'Ukulele' (GM2)
console.log(JZZ.MIDI.groupName(60));
// => 'Brass'
console.log(JZZ.MIDI.percussionName(60));
// => 'Hi Bongo'
JZZ.MIDI.programValue(str)
-
map instrument name to a MIDI program (GM only);
if there is no exact match, try the best guess.
JZZ.MIDI.noteValue(str)
-
map percussion name to a MIDI note number;
if there is no exact match, try the best guess.
JZZ.MIDI.guessValue(str)
-
map program or percussion name (whatever matches best) to a MIDI value;
if the return value is negative, it's the percussion note value with a minus sign, otherwise, it's the program value.
console.log(JZZ.MIDI.programName(JZZ.MIDI.programValue('piano')));
// => 'Acoustic Grand Piano'
console.log(JZZ.MIDI.percussionName(JZZ.MIDI.noteValue('snare')));
// => 'Acoustic Snare'
var n = JZZ.MIDI.guessValue('crash');
if (n < 0) console.log(JZZ.MIDI.percussionName(-n));
else console.log(JZZ.MIDI.programName(n));
// => 'Crash Cymbal 1'
allGM2() / allGS() / allXG()
-
return a complete list of GM2/GS/XG programs as an array of of triplets [program-number, bank-msb, bank-lsb]
.
note(...) / noteOn(...) / noteOff(...) / aftertouch(...) / program(...)
-
when the module is loaded, JZZ helper functions will understand the instrument names where appropriate.
JZZ().openMidiOut()
.ch(0).program('accordion').noteOn('C#6', 100)
.ch(9).noteOn('cowbell', 127);
https://jazz-soft.net/demo/GmGsXg.html
Please visit https://jazz-soft.net for more information.