Skip to content

Commit

Permalink
umpPitchBend()
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Dec 17, 2023
1 parent 611368a commit 793009f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions javascript/JZZ.js
Original file line number Diff line number Diff line change
Expand Up @@ -3082,6 +3082,12 @@
[0x40 + _4b(g), 0xc0 + _ch(c), 0, 0, _7bn(n), 0, 0, 0] :
[0x40 + _4b(g), 0xc0 + _ch(c), 0, 1, _7bn(n), 0, _7bn(msb), _7bn(lsb)];
},
umpPitchBend: function(g, c, x, y, z, w) {
return [0x40 + _4b(g), 0xe0 + _ch(c), 0, 0].concat(_32a(x, y, z, w));
},
umpPnPitchBend: function(g, c, n, x, y, z, w) {
return [0x40 + _4b(g), 0x60 + _ch(c), _7bn(n), 0].concat(_32a(x, y, z, w));
},
umpRPN: function(g, c, b, n, x, y, z, w) {
return [0x40 + _4b(g), 0x20 + _ch(c), _7b(b), _7b(n)].concat(_32a(x, y, z, w));
},
Expand Down
2 changes: 1 addition & 1 deletion minified/JZZ.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,12 @@ describe('UMP messages', function() {
assert.equal(JZZ.UMP.umpRPN(1, 2, 3, 4, 5).toString(), '41220304 00000005 -- Registered Controller');
assert.equal(JZZ.UMP.umpRPN(1, 2, 3, 4, 5, 6, 7, 8).toString(), '41220304 05060708 -- Registered Controller');
});
it('umpPitchBend', function() {
assert.equal(JZZ.UMP.umpPitchBend(1, 2, 3, 4, 5, 6).toString(), '41e20000 03040506 -- Pitch Bend');
});
it('umpPnPitchBend', function() {
assert.equal(JZZ.UMP.umpPnPitchBend(1, 2, 'C5', 3, 4, 5, 6).toString(), '41623c00 03040506 -- Per-Note Pitch Bend');
});
it('umpNRPN', function() {
assert.equal(JZZ.UMP.umpNRPN(1, 2, 3, 4, 5).toString(), '41320304 00000005 -- Assignable Controller');
assert.equal(JZZ.UMP.umpNRPN(1, 2, 3, 4, 5, 6, 7, 8).toString(), '41320304 05060708 -- Assignable Controller');
Expand Down

0 comments on commit 793009f

Please sign in to comment.