Skip to content

Commit

Permalink
umpPitchBendF()
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Dec 27, 2023
1 parent 32eec49 commit 410c727
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -3095,9 +3095,15 @@
umpPitchBend: function(g, c, x, y, z, w) {
return [0x40 + _4b(g), 0xe0 + _ch(c), 0, 0].concat(_32a(x, y, z, w));
},
umpPitchBendF: function(g, c, x) {
return _helperGC.umpPitchBend(g, c, _f_32((x + 1) / 2));
},
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));
},
umpPnPitchBendF: function(g, c, n, x) {
return _helperGC.umpPnPitchBend(g, c, n, _f_32((x + 1) / 2));
},
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.

4 changes: 4 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,13 @@ describe('UMP messages', function() {
});
it('umpPitchBend', function() {
assert.equal(JZZ.UMP.umpPitchBend(1, 2, 3, 4, 5, 6).toString(), '41e20000 03040506 -- Pitch Bend');
assert.equal(JZZ.UMP.umpPitchBendF(1, 2, -1).toString(), '41e20000 00000000 -- Pitch Bend');
assert.equal(JZZ.UMP.umpPitchBendF(1, 2, 0).toString(), '41e20000 80000000 -- Pitch Bend');
assert.equal(JZZ.UMP.umpPitchBendF(1, 2, 1).toString(), '41e20000 ffffffff -- Pitch Bend');
});
it('umpPnPitchBend', function() {
assert.equal(JZZ.UMP.umpPnPitchBend(1, 2, 'C5', 3, 4, 5, 6).toString(), '41623c00 03040506 -- Per-Note Pitch Bend');
assert.equal(JZZ.UMP.umpPnPitchBendF(1, 2, 'C5', 0).toString(), '41623c00 80000000 -- Per-Note Pitch Bend');
});
it('umpNRPN', function() {
assert.equal(JZZ.UMP.umpNRPN(1, 2, 3, 4, 5).toString(), '41320304 00000005 -- Assignable Controller');
Expand Down

0 comments on commit 410c727

Please sign in to comment.