Skip to content

Commit

Permalink
M2M1 rpm/nrpm
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Dec 4, 2023
1 parent 99bc6ae commit 6c42ec5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -68,15 +68,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.7.5"></script> // any particular version
<script src="https://cdn.jsdelivr.net/npm/jzz@1.7.6"></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.7.5"></script> // any particular version
<script src="https://unpkg.com/jzz@1.7.6"></script> // any particular version
//...
```

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

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

/* istanbul ignore next */
Expand Down Expand Up @@ -3470,7 +3470,13 @@
else if (t == 4) {
n = msg[1] >> 4;
c = msg[1] & 15;
if (n == 8 || n == 9) {
if (n == 2 || n == 3) {
this._emit(_grp(new MIDI([0xb0 + c, n == 2 ? 101 : 99, msg[2]]), g));
this._emit(_grp(new MIDI([0xb0 + c, n == 2 ? 100 : 98, msg[3]]), g));
this._emit(_grp(new MIDI([0xb0 + c, 6, msg[4] >> 1]), g));
this._emit(_grp(new MIDI([0xb0 + c, 38, (msg[4] & 1) * 64 + (msg[4] >> 2)]), g));
}
else if (n == 8 || n == 9) {
this._emit(_grp(new MIDI([msg[1], msg[2], _16_7(msg[4], msg[5])]), g));
}
if (n == 10) {
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.7.5",
"version": "1.7.6",
"description": "MIDI library for Node.js and web-browsers",
"main": "javascript/JZZ.js",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions test/common.js
Expand Up @@ -1587,6 +1587,15 @@ describe('JZZ.M2M1', function() {
port.connect(function(msg) { sample.compare(msg); });
port.umpProgram(0, 1, 32).umpProgram(0, 1, 64, 1, 2);
});
it('rpn/nrpm', function(done) {
var sample = new test.Sample(done, [
[0xb1, 0x65, 0x02], [0xb1, 0x64, 0x03], [0xb1, 0x06, 0x78], [0xb1, 0x26, 0x3c],
[0xb1, 0x63, 0x02], [0xb1, 0x62, 0x03], [0xb1, 0x06, 0x78], [0xb1, 0x26, 0x3c]
]);
var port = new JZZ.M2M1();
port.connect(function(msg) { sample.compare(msg); });
port.umpRPN(0, 1, 2, 3, 0xf0f0f0f0).umpNRPN(0, 1, 2, 3, 0xf0f0f0f0);
});
it('aftertouch/pressure', function(done) {
var sample = new test.Sample(done, [
[0xa1, 60, 80], [0xa1, 60, 0], [0xd1, 80]
Expand Down
2 changes: 1 addition & 1 deletion web-midi-api/package.json
Expand Up @@ -13,7 +13,7 @@
"web-midi-api"
],
"dependencies": {
"jzz": "^1.7.5"
"jzz": "^1.7.6"
},
"contributors": [
{
Expand Down

0 comments on commit 6c42ec5

Please sign in to comment.