diff --git a/javascript/JZZ.js b/javascript/JZZ.js index 7cb9cf5..296fd8d 100644 --- a/javascript/JZZ.js +++ b/javascript/JZZ.js @@ -2994,9 +2994,7 @@ var _helpersUmp = {}; function _copyHelperNN(name, func) { - UMP[name] = function() { - return new UMP(func.apply(this, arguments)); - }; + UMP[name] = function() { return new UMP(func.apply(this, arguments));}; _helpersUmp[name] = function() { return this.send(func.apply(this, arguments)); }; } function _copyHelperGC(name, func) { @@ -3013,6 +3011,11 @@ if (typeof this._gr != 'undefined') args = [this._gr].concat(args); return new UMP(func.apply(this, args)); }; + _helpersUmp[name] = function() { + var args = Array.prototype.slice.call(arguments); + if (typeof this._gr != 'undefined') args = [this._gr].concat(args); + return this.send(func.apply(this, args)); + }; } function _umpseqstat(n, i) { return n == 1 ? 0 : i == 0 ? 0x10 : i == n - 1 ? 0x30 : 0x20; } function _sliceSX(gr, m) { diff --git a/test/common.js b/test/common.js index bb897bb..7b4dd1b 100644 --- a/test/common.js +++ b/test/common.js @@ -1277,6 +1277,15 @@ describe('JZZ.Widget2', function() { port2.connect(function(msg) { sample.compare(msg); }); port1.gr().gr(1).gr(1).gr().noop(); }); + it('umpBPM', function(done) { + var sample = new test.Sample(done, [ + [209, 16, 0, 0, 2, 250, 240, 128, 0, 0, 0, 0, 0, 0, 0, 0], + [210, 16, 0, 0, 2, 250, 240, 128, 0, 0, 0, 0, 0, 0, 0, 0] + ]); + var port = JZZ.Widget2(); + port.connect(function(msg) { sample.compare(msg); }); + port.umpBPM(1, 120).gr(2).umpBPM(120); + }); }); describe('JZZ.Context', function() {