Skip to content

Commit

Permalink
XG-style (XG, NS5R) drum setup SysEx support. #18
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Sep 18, 2023
1 parent eab31b3 commit 0c9dfe4
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/state/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2345,24 +2345,33 @@ let OctaviaDevice = class extends CustomEventSource {
let note = msg[0], offset = msg[1];
msg.subarray(2).forEach((e, i) => {
let ri = i + offset;
let drumOff = drumId * allocated.dpn;
let commitSlot = -1;
if (ri < 16) {
([() => {
// coarse tune
commitSlot = 24;
}, () => {
// fine tune
commitSlot = 25;
}, () => {
// level
commitSlot = 26;
}, () => {
// exclusive group
// Postponed until 0.5.1 or 0.6.
}, () => {
// panpot
commitSlot = 28;
}, () => {
// reverb
commitSlot = 29;
}, () => {
// chorus
commitSlot = 30;
}, () => {
// variation
commitSlot = 31;
}, () => {
// assign mode (single/multi)
// behaviour not yet documented
Expand All @@ -2374,37 +2383,54 @@ let OctaviaDevice = class extends CustomEventSource {
// no plans for support yet
}, () => {
// LPF cutoff
commitSlot = 20;
}, () => {
// LPF resonance
commitSlot = 21;
}, () => {
// attack rate
commitSlot = 22;
}, () => {
// decay rate
commitSlot = 23;
}, () => {
// decay 2 rate
// behaviour not yet documented
}][ri] || (() => {
console.debug(`Unknown XG-style drum param ${ri} on set ${drumId + 1}.`);
}))();
} else if (ri < 32) {} else if (ri < 40) {
} else if (ri < 32) {
} else if (ri < 40) {
([() => {
// EQ bass gain
commitSlot = 48;
}, () => {
// EQ treble gain
commitSlot = 49;
}, false, false, () => {
// EQ bass freq
commitSlot = 52;
}, () => {
// EQ treble freq
commitSlot = 53;
}][ri - 32] || (() => {
console.debug(`Unknown XG-style drum param ${ri} on set ${drumId + 1}.`);
}))();
} else if (ri < 80) {} else {
} else if (ri < 80) {
} else {
([() => {
// HPF cutoff
commitSlot = 36;
}][ri - 80] || (() => {
console.debug(`Unknown XG-style drum param ${ri} on set ${drumId + 1}.`);
}))();
};
if (commitSlot >= 0) {
getDebugState() && console.debug(drumOff, commitSlot, note, e);
upThis.#drum[(drumOff + dnToPos[commitSlot]) * allocated.dnc + note] = e;
} else {
getDebugState() && console.debug(`XG-style drum param ${ri} has no writes.`);
};
});
};
let sysExDrumsR = function (drumId, msg) {
Expand Down

0 comments on commit 0c9dfe4

Please sign in to comment.