Skip to content

Commit

Permalink
umpControl()
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Nov 29, 2023
1 parent 4277fc7 commit 5dc64ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions javascript/JZZ.js
Original file line number Diff line number Diff line change
Expand Up @@ -3065,6 +3065,11 @@
x = _32b(x);
return [0x40 + _4b(g), 0xa0 + _ch(c), _7bn(n), 0, (x >> 24) & 255, (x >> 16) & 255, (x >> 8) & 255, x & 255];
},
umpControl: function(g, c, n, x) {
if ([0, 6, 32, 38, 98, 99, 100, 101].includes(n)) _throw(n);
x = _32b(x);
return [0x40 + _4b(g), 0xb0 + _ch(c), _7b(n), 0, (x >> 24) & 255, (x >> 16) & 255, (x >> 8) & 255, x & 255];
},
umpPressure: function(g, c, x) {
x = _32b(x);
return [0x40 + _4b(g), 0xd0 + _ch(c), 0, 0, (x >> 24) & 255, (x >> 16) & 255, (x >> 8) & 255, x & 255];
Expand Down
2 changes: 1 addition & 1 deletion minified/JZZ.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,10 @@ describe('UMP messages', function() {
it('umpPressure', function() {
assert.equal(JZZ.UMP.umpPressure(1, 2, 0xf0f0f0f0).toString(), '41d20000 f0f0f0f0 -- Channel Pressure');
});
it('umpControl', function() {
assert.equal(JZZ.UMP.umpControl(1, 2, 3, 0xf0f0f0f0).toString(), '41b20300 f0f0f0f0 -- Control Change');
assert.throws(function() { JZZ.UMP.umpControl(1, 2, 0, 0xf0f0f0f0); });
});
it('umpProgram', function() {
assert.equal(JZZ.UMP.umpProgram(1, 2, 3).toString(), '41c20000 03000000 -- Program Change');
assert.equal(JZZ.UMP.umpProgram(1, 2, 3, 4, 5).toString(), '41c20001 03000405 -- Program Change');
Expand Down

0 comments on commit 5dc64ff

Please sign in to comment.