Skip to content

Commit

Permalink
More helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Jan 12, 2021
1 parent 87a2bd4 commit 58c3130
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -67,15 +67,15 @@ by running `npm remove midi-test --save-dev`.

```html
<script src="https://cdn.jsdelivr.net/npm/jzz"></script> // the latest version, or
<script src="https://cdn.jsdelivr.net/npm/jzz@1.1.8"></script> // any particular version
<script src="https://cdn.jsdelivr.net/npm/jzz@1.1.9"></script> // any particular version
//...
```

##### CDN (unpkg)

```html
<script src="https://unpkg.com/jzz"></script> // the latest version, or
<script src="https://unpkg.com/jzz@1.1.8"></script> // any particular version
<script src="https://unpkg.com/jzz@1.1.9"></script> // any particular version
//...
```

Expand Down
5 changes: 3 additions & 2 deletions javascript/JZZ.js
Expand Up @@ -14,7 +14,7 @@
})(this, function() {

var _scope = typeof window === 'undefined' ? global : window;
var _version = '1.1.8';
var _version = '1.1.9';
var i, j, k, m, n;

var _time = Date.now || function () { return new Date().getTime(); };
Expand Down Expand Up @@ -1614,6 +1614,7 @@
sostenuto: function(c, b) { if (typeof b == 'undefined') b = true; return [0xB0 + _ch(c), 0x42, b ? 127 : 0]; },
soft: function(c, b) { if (typeof b == 'undefined') b = true; return [0xB0 + _ch(c), 0x43, b ? 127 : 0]; },
legato: function(c, b) { if (typeof b == 'undefined') b = true; return [0xB0 + _ch(c), 0x44, b ? 127 : 0]; },
ptc: function(c, n) { return [0xB0 + _ch(c), 0x54, _7b(MIDI.noteValue(n), n)]; },
dataIncr: function(c) { return [0xB0 + _ch(c), 0x60, 0]; },
dataDecr: function(c) { return [0xB0 + _ch(c), 0x61, 0]; },
nrpnLSB: function(c, n) { return [0xB0 + _ch(c), 0x62, _7b(n)]; },
Expand All @@ -1625,7 +1626,7 @@
localControl: function(c, b) { return [0xB0 + _ch(c), 0x7a, b ? 127 : 0]; },
allNotesOff: function(c) { return [0xB0 + _ch(c), 0x7b, 0]; },
omni: function(c, b) { if (typeof b == 'undefined') b = true; return [0xB0 + _ch(c), b ? 0x7d : 0x7c, 0]; },
mono: function(c, n) { if (!n) n = 0; return [0xB0 + _ch(c), 0x7e, _7b(n)]; },
mono: function(c, n) { if (typeof n == 'undefined') n = 1; return [0xB0 + _ch(c), 0x7e, _7b(n)]; },
poly: function(c) { return [0xB0 + _ch(c), 0x7f, 0]; },
};
var _helperNC = { // no channel
Expand Down
2 changes: 1 addition & 1 deletion minified/JZZ.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "jzz",
"version": "1.1.8",
"version": "1.1.9",
"description": "MIDI library for Node.js and web-browsers",
"main": "javascript/JZZ.js",
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions test/common.js
Expand Up @@ -255,6 +255,9 @@ describe('MIDI messages', function() {
assert.equal(JZZ.MIDI.legato(0, true).toString(), 'b0 44 7f -- Legato On/Off');
assert.equal(JZZ.MIDI.legato(0, false).toString(), 'b0 44 00 -- Legato On/Off');
});
it('ptc', function() {
assert.equal(JZZ.MIDI.ptc(0, 'C5').toString(), 'b0 54 3c -- Portamento Control');
});
it('data', function() {
assert.equal(JZZ.MIDI.data(0, 1, 2)[0].toString(), 'b0 06 01 -- Data Entry MSB');
assert.equal(JZZ.MIDI.data(0, 1, 2)[1].toString(), 'b0 26 02 -- Data Entry LSB');
Expand Down Expand Up @@ -343,8 +346,8 @@ describe('MIDI messages', function() {
assert.equal(JZZ.MIDI.omni(0, false).toString(), 'b0 7c 00 -- Omni Mode Off');
});
it('mono', function() {
assert.equal(JZZ.MIDI.mono(0).toString(), 'b0 7e 00 -- Mono Mode On');
assert.equal(JZZ.MIDI.mono(0, 1).toString(), 'b0 7e 01 -- Mono Mode On');
assert.equal(JZZ.MIDI.mono(0).toString(), 'b0 7e 01 -- Mono Mode On');
assert.equal(JZZ.MIDI.mono(0, 0).toString(), 'b0 7e 00 -- Mono Mode On');
});
it('poly', function() {
assert.equal(JZZ.MIDI.poly(0).toString(), 'b0 7f 00 -- Poly Mode On');
Expand Down

0 comments on commit 58c3130

Please sign in to comment.