Skip to content

Commit

Permalink
umpFineTuningF()
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Feb 2, 2024
1 parent 851e0e4 commit 835144e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions javascript/JZZ.js
Original file line number Diff line number Diff line change
Expand Up @@ -3134,6 +3134,9 @@
umpFineTuning: function(g, c, x, y, z, w) {
return _helperGC.umpRPN(g, c, 0, 1, x, y, z, w);
},
umpFineTuningF: function(g, c, x) {
return _helperGC.umpFineTuning(g, c, MIDI.to32b(_01((x % 1 + 1) / 2, x)));
},
umpCoarseTuning: function(g, c, n) {
return [0x40 + _4b(g), 0x20 + _ch(c), 0, 2, _7b(n) * 2, 0, 0, 0];
},
Expand Down
5 changes: 5 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,11 @@ describe('UMP messages', function() {
});
it('umpFineTuning', function() {
assert.equal(JZZ.UMP.umpFineTuning(1, 2, 0x80000000).toString(), '41220001 80000000 -- Registered Controller: Fine Tuning');
assert.equal(JZZ.UMP.umpFineTuningF(1, 2, -.9999999999).toString(), '41220001 00000000 -- Registered Controller: Fine Tuning');
assert.equal(JZZ.UMP.umpFineTuningF(1, 2, -.5).toString(), '41220001 40000000 -- Registered Controller: Fine Tuning');
assert.equal(JZZ.UMP.umpFineTuningF(1, 2, 0).toString(), '41220001 80000000 -- Registered Controller: Fine Tuning');
assert.equal(JZZ.UMP.umpFineTuningF(1, 2, .5).toString(), '41220001 c0000000 -- Registered Controller: Fine Tuning');
assert.equal(JZZ.UMP.umpFineTuningF(1, 2, .9999999999).toString(), '41220001 ffffffff -- Registered Controller: Fine Tuning');
});
it('umpCoarseTuning', function() {
assert.equal(JZZ.UMP.umpCoarseTuning(1, 2, 3).toString(), '41220002 06000000 -- Registered Controller: Coarse Tuning');
Expand Down

0 comments on commit 835144e

Please sign in to comment.