Skip to content

Commit

Permalink
Annotate Master Tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Oct 13, 2021
1 parent 1f6474f commit 005ba35
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
7 changes: 4 additions & 3 deletions javascript/JZZ.js
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,7 @@
MIDI.prototype.isXgReset = function() {
return this.match([0xf0, 0x43, [0x10, 0xf0], 0x4c, 0, 0, 0x7e, 0, 0xf7]);
};
MIDI.prototype.match = function(a, n) {
MIDI.prototype.match = function(a) {
var i, m;
for (i = 0; i < a.length; i++) {
m = a[i][1];
Expand Down Expand Up @@ -2533,6 +2533,7 @@
if (msg[0] == 0xff) { this._clear(); return msg; }
var ch = msg[0] & 15;
var st = msg[0] >> 4;
var s;
if (st == 12) {
msg._bm = this._cc[ch].bm;
msg._bl = this._cc[ch].bl;
Expand Down Expand Up @@ -2563,8 +2564,8 @@
else if (msg.isFullSysEx()) {
if (msg[1] == 0x7f) {
if (msg[3] == 4) {
if (msg[4] == 1) msg.label('Master Volume');
else if (msg[4] == 2) msg.label('Master Balance');
s = { 1: 'Master Volume', 2: 'Master Balance', 3: 'Master Fine Tuning', 4: 'Master Coarse Tuning' }[msg[4]];
if (s) msg.label(s);
}
}
else if (msg[1] == 0x7e) {
Expand Down
2 changes: 1 addition & 1 deletion minified/JZZ.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"jazz-midi": "^1.7.5"
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint": "^8.0.0",
"grunt": "^1.4.1",
"grunt-contrib-jshint": "^3.1.1",
"grunt-contrib-uglify": "^5.0.1",
Expand Down
18 changes: 18 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,24 @@ describe('JZZ.Context', function() {
ctxt._receive(msg);
assert.equal(msg.toString(), 'f0 7f 7f 04 02 7f 7f f7 (Master Balance)');
});
it('master fine tuning', function() {
var ctxt = JZZ.Context();
var msg = JZZ.MIDI([0xf0, 0x7f, 0x7f, 0x04, 0x03, 0x7f, 0x7f, 0xf7]);
ctxt._receive(msg);
assert.equal(msg.toString(), 'f0 7f 7f 04 03 7f 7f f7 (Master Fine Tuning)');
});
it('master coarse tuning', function() {
var ctxt = JZZ.Context();
var msg = JZZ.MIDI([0xf0, 0x7f, 0x7f, 0x04, 0x04, 0x7f, 0x7f, 0xf7]);
ctxt._receive(msg);
assert.equal(msg.toString(), 'f0 7f 7f 04 04 7f 7f f7 (Master Coarse Tuning)');
});
it('unknown 04 xx', function() {
var ctxt = JZZ.Context();
var msg = JZZ.MIDI([0xf0, 0x7f, 0x7f, 0x04, 0x7f, 0x7f, 0x7f, 0xf7]);
ctxt._receive(msg);
assert.equal(msg.toString(), 'f0 7f 7f 04 7f 7f 7f f7');
});
it('etc', function() {
var msg;
var ctxt = JZZ.Context();
Expand Down

0 comments on commit 005ba35

Please sign in to comment.