Skip to content

Commit

Permalink
Bug fixes for SC-8850 hardcoded performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed May 8, 2024
1 parent 9f90f7e commit 470513d
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/fakeSc8850/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,30 @@ let currentPerformance;
demoModes[9] = "gm";
let useMidiBus = false;

let generateSwitch = function (ch = 0) {
let generateSwitch = function (ch = 0, min, max) {
if (min != undefined && max == undefined) {
console.warn(`Invalid bounds for channel switch generation.`);
return;
};
let data = [67, 16, 73, 11, 0, 0, ch];
if (min != undefined) {
data.push(Math.floor(Math.log2(max - min + 1)), min);
};
return {
type: 15,
track: 0,
data
};
};
let generateString = function (text) {
let data = [67, 16, 76, 6, 0, 0];
for (let c = 0; c < text.length; c ++) {
data.push(text.charCodeAt(c));
};
return {
type: 15,
track: 0,
data: [67, 16, 73, 11, 0, 0, ch]
data
};
};

Expand Down

0 comments on commit 470513d

Please sign in to comment.