diff --git a/javascript/JZZ.js b/javascript/JZZ.js index 8296970..fe2b567 100644 --- a/javascript/JZZ.js +++ b/javascript/JZZ.js @@ -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]; }, diff --git a/test/common.js b/test/common.js index 2dd3c76..6c9bdda 100644 --- a/test/common.js +++ b/test/common.js @@ -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');