Skip to content

Commit

Permalink
Expanded the bank selection range to 8 bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Jul 9, 2024
1 parent c1d0000 commit 30756db
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 51 deletions.
122 changes: 83 additions & 39 deletions data/bank/s90es.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MSB LSB PRG NME
063 017 009 Agresive
063 017 010 HousePno
063 017 011 OldBlues
063 017 012 1968
063 017 012 1968 Pno
063 017 013 MonoComp
063 017 014 78rpmPno
063 017 015 BaladKey
Expand All @@ -36,7 +36,7 @@ MSB LSB PRG NME
063 017 034 SoftCase
063 017 035 Early70s
063 017 036 Vintg’74
063 017 037 Sweet
063 017 037 Sweetnes
063 017 038 VintgFas
063 017 039 Max Tine
063 017 040 EarlyFsn
Expand Down Expand Up @@ -95,61 +95,61 @@ MSB LSB PRG NME
063 017 093 Log&Drum
063 017 094 TmpBlGlk
063 017 095 VelOrPrc
063 017 096 Petit
063 017 096 PetitOrg
063 017 097 Imprompt
063 017 098 Mixture
063 017 098 MixtureO
063 017 099 St. Paul
063 017 100 FlutyPpe
063 017 101 St.Peter
063 017 102 Clean
063 017 102 CleanOrg
063 017 103 ReedSplt
063 017 104 Tradi
063 017 105 Sunday
063 017 104 TradiOrg
063 017 105 SundayOr
063 017 106 BrthPipe
063 017 107 ReedPipe
063 017 108 Medieval
063 017 109 Prelude
063 017 109 PreludeO
063 017 110 OohPipes
063 017 111 GreenTea
063 017 112 BassWalk
063 017 113 Amped
063 017 113 AmpedOrg
063 017 114 VintageC
063 017 115 Dave’s B
063 017 116 2nd Perc
063 017 117 1685&13
063 017 118 Jazzy 1
063 017 119 Jazzy 2
063 017 120 Glassy
063 017 118 JazzyOr1
063 017 119 JazzyOr2
063 017 120 GlassyOr
063 017 121 Slow Jam
063 017 122 Greasy
063 017 123 Swishie
063 017 122 GreasyOr
063 017 123 SwishieO
063 017 124 Ful/Cvib
063 017 125 Mellow
063 017 125 MellowPp
063 017 126 Nu Shade
063 017 127 Cool Cat
063 018 000 Flutey
063 018 000 FluteyOr
063 018 001 LeftMnl.
063 018 002 DrawCtrl
063 018 003 GospSplt
063 018 004 Soulemn
063 018 005 Fully
063 018 004 SoulemnO
063 018 005 FullyOrg
063 018 006 Progress
063 018 007 Crunchy
063 018 008 Rocky
063 018 007 CrunchyO
063 018 008 RockyOrg
063 018 009 DistFull
063 018 010 EarlyBrd
063 018 011 AnaDrwOr
063 018 012 Tiny
063 018 013 Paddy
063 018 012 TinyOrgn
063 018 013 PaddyOrg
063 018 014 MellowOr
063 018 015 RezDrwOr
063 018 016 OrganPad
063 018 017 Panther
063 018 017 PantherO
063 018 018 SawCombo
063 018 019 1967Keys
063 018 020 YD-45C
063 018 021 Compact
063 018 022 Esp.Gtr
063 018 021 CompactO
063 018 022 Espa.Gtr
063 018 023 Nyln+Hrm
063 018 024 SimpStlG
063 018 025 StlCmprG
Expand Down Expand Up @@ -186,10 +186,10 @@ MSB LSB PRG NME
063 018 056 PaddyCln
063 018 057 Policia
063 018 058 Rokabily
063 018 059 Rotator
063 018 059 RotatrGt
063 018 060 Baby Gtr
063 018 061 TouchWah
063 018 062 Mega Cln
063 018 062 MegaClnG
063 018 063 OvrDrivn
063 018 064 TexBoogy
063 018 065 Dyna.Amp
Expand Down Expand Up @@ -252,15 +252,15 @@ MSB LSB PRG NME
063 018 122 Viola 2
063 018 123 Cello 1
063 018 124 Cello 2
063 018 125 Solo 1
063 018 126 Solo 2
063 018 125 SoloStr1
063 018 126 SoloStr2
063 018 127 SolSpict
063 019 000 Contraba
063 019 001 2Violins
063 019 002 2 Violas
063 019 003 2 Cellos
063 019 004 Cel.Duet
063 019 005 2 Solos
063 019 005 2SoloStr
063 019 006 CelloEns
063 019 007 ViolaEns
063 019 008 ViolnEns
Expand Down Expand Up @@ -393,7 +393,7 @@ MSB LSB PRG NME
063 020 007 IndiaFli
063 020 008 WhereAmI
063 020 009 Sakura
063 020 010 Nomad
063 020 010 NomadGtr
063 020 011 Ney
063 020 012 Kawala
063 020 013 Shukran
Expand Down Expand Up @@ -650,15 +650,15 @@ MSB LSB PRG NME
063 022 008 BaglmArp
063 022 009 Salsalic
063 022 010 SprnoSft
063 022 011 Mini 3
063 022 011 Mini3 Ld
063 022 012 ChrchOoh
063 022 013 Cwncarn
063 022 014 Lazerzz
063 022 015 Mocha
063 022 016 ElegantS
063 022 017 R&B Soft
063 022 018 NuPhasin
063 022 019 Sunday
063 022 019 SundayOr
063 022 020 Nyln+Hrm
063 022 021 GroovArp
063 022 022 SolSpict
Expand Down Expand Up @@ -688,9 +688,9 @@ MSB LSB PRG NME
063 022 046 The Gate
063 022 047 Engineer
063 022 048 FulGrand
063 022 049 Sweet
063 022 049 Sweetnes
063 022 050 Twinkle
063 022 051 Amped
063 022 051 AmpedOrg
063 022 052 JazGtMel
063 022 053 Slapper
063 022 054 MediumEn
Expand All @@ -699,7 +699,7 @@ MSB LSB PRG NME
063 022 057 HevnSent
063 022 058 Hip Bari
063 022 059 PlsWound
063 022 060 Analog
063 022 060 AnalogPd
063 022 061 Glacy
063 022 062 Insanity
063 022 063 Bass&Pad
Expand All @@ -719,7 +719,7 @@ MSB LSB PRG NME
063 022 077 CsmcRain
063 022 078 NeverRpt
063 022 079 SimpSize
063 022 080 1968
063 022 080 1968 Pno
063 022 081 Bell DX
063 022 082 NoizRezz
063 022 083 Cool Cat
Expand Down Expand Up @@ -754,7 +754,7 @@ MSB LSB PRG NME
063 022 112 Pno&Str
063 022 113 WurliAmp
063 022 114 PluckBel
063 022 115 Compact
063 022 115 CompactO
063 022 116 OvrDaTop
063 022 117 KickBass
063 022 118 VP Soft
Expand Down Expand Up @@ -863,14 +863,58 @@ MSB LSB PRG NME
063 024 029 UserKt30
063 024 030 UserKt31
063 024 031 UserKt32
063 028 000 FulGrand
063 028 028 R&B Soft
063 028 075 BazrBels
063 029 021 Espa.Gtr
063 029 028 MegaStlG
063 029 032 Mega12St
063 029 039 2CoilAm1
063 029 040 2CoilAm2
063 029 049 AltRockr
063 029 058 RotatrGt
063 029 059 Baby Gtr
063 029 061 MegaClnG
063 029 062 OvrDrivn
063 029 074 59 Combo
063 029 078 OvrDaTop
063 029 079 Beater
063 029 093 GnarlyBa
063 029 116 MegaFrtl
063 030 016 PizzSect
063 030 027 BeautyHp
063 030 052 SlwSuckr
063 030 063 Trombone
063 030 079 BigBrtBr
063 030 081 VeloFall
063 031 004 Kotoun
063 031 014 NomadGtr
063 031 016 Kawala
063 031 017 Shukran
063 031 027 Tabla
063 031 061 BackPdMW
063 031 098 Whisperr
063 032 006 Dark Uni
063 032 014 BobbyBas
062 032 016 Mini Sub
063 032 017 Fundmntl
063 032 020 SinglOsc
063 032 068 HellFire
063 032 105 Talker
063 032 122 PWM Perc
063 033 002 British
063 033 003 Wave Pan
063 033 010 TrncHook
063 033 012 MaydayLd
063 033 027 TrncMelo
063 033 031 BassPedl
063 033 037 DoomBass
063 033 040 TranceBa
063 033 107 PolyTrnc
063 033 042 DeepPtBa
063 033 050 Dirtbox
063 033 052 ProtoTpe
063 033 056 AmbiBite
063 033 077 ShneChrd
063 033 088 FourSkid
063 033 107 PolyTrnc
063 033 124 MyRealty
49 changes: 37 additions & 12 deletions src/state/bankReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ import {ccToPos} from "../state/index.mjs";

const sgCrit = ["MSB", "PRG", "LSB", "NME", "ELC", "DRM"];

const noVoxStdPool = {
"krs": "KR",
"s90es": "ES",
"motif": "ES"
};

let halfHex = function (n) {
let segA = Math.floor(n / 10), segB = n % 10;
return `${segA.toString(16)}${segB}`;
};

let VoiceBank = class {
#bankInfo;
get bankInfo() {
return this.#bankInfo;
};
strictMode = false;
get(msb = 0, prg = 0, lsb = 0, mode) {
let sid = [msb, prg, lsb];
Expand Down Expand Up @@ -119,6 +128,9 @@ let VoiceBank = class {
break;
};
case "s90es": {
if (msb == 0) {
break;
};
if (lsb < 8) {
args[2] += 17;
} else if (lsb < 32) {
Expand All @@ -129,6 +141,9 @@ let VoiceBank = class {
break;
};
case "motif": {
if (msb == 0) {
break;
};
if (lsb < 8) {
args[2] += 28;
} else if (lsb < 32) {
Expand Down Expand Up @@ -396,11 +411,11 @@ let VoiceBank = class {
let iid = [args[0], args[1], args[2]];
// Bank read
while (!(bankName?.length >= 0)) {
bankName = this.#bankInfo[args[1] || 0][(args[0] << 7) + args[2]]?.name;
bankName = this.#bankInfo[args[1] || 0][(args[0] << 8) + args[2]]?.name;
//console.debug("Result of the current round of bank fetch: ", bankName);
//console.debug(`${args}`);
if (bankName) {
let bankObject = this.#bankInfo[args[1] || 0][(args[0] << 7) + args[2]];
let bankObject = this.#bankInfo[args[1] || 0][(args[0] << 8) + args[2]];
bankPoly = bankObject?.poly || bankPoly;
bankType = bankObject?.type || bankType;
bankDrum = bankObject?.drum;
Expand All @@ -412,7 +427,7 @@ let VoiceBank = class {
}; */
if (args[0] == 0 && args[1] == 0 && args[2] == 0) {
bankName = "Unloaded";
} else if (!this.#bankInfo[args[1] || 0][args[0] << 7]) {
} else if (!this.#bankInfo[args[1] || 0][args[0] << 8]) {
if (msb == 48) {
args[0] = 0;
args[2] = 0;
Expand Down Expand Up @@ -451,10 +466,10 @@ let VoiceBank = class {
} else {
args[1] %= 7;
};
bankName = this.#bankInfo[args[1] || 0][(args[0] << 7) + args[2]]?.name;
bankName = this.#bankInfo[args[1] || 0][(args[0] << 8) + args[2]]?.name;
if (bankName) {
ending = " ";
let bankObject = this.#bankInfo[args[1] || 0][(args[0] << 7) + args[2]];
let bankObject = this.#bankInfo[args[1] || 0][(args[0] << 8) + args[2]];
bankPoly = bankObject?.poly || bankPoly;
bankType = bankObject?.type || bankType;
bankDrum = bankObject?.drum;
Expand Down Expand Up @@ -642,9 +657,19 @@ let VoiceBank = class {
};
};
if (ending != " ") {
if (mode == "krs" || self.debugMode) {
bankName = "";
standard = "KR";
switch (mode) {
case "krs":
case "s90es":
case "motif": {
bankName = "";
standard = noVoxStdPool[mode];
break;
};
default: {
if (self.debugMode) {
bankName = "";
};
};
};
};
return {
Expand Down Expand Up @@ -714,7 +739,7 @@ let VoiceBank = class {
});
upThis.#bankInfo[prg] = upThis.#bankInfo[prg] || [];
let writeArray = upThis.#bankInfo[prg];
if (!writeArray[(msb << 7) | lsb] || allowOverwrite) {
if (!writeArray[(msb << 8) | lsb] || allowOverwrite) {
let voiceObject = {
msb,
prg,
Expand All @@ -725,10 +750,10 @@ let VoiceBank = class {
drum
};
//console.debug(voiceObject);
writeArray[(msb << 7) | lsb] = voiceObject;
writeArray[(msb << 8) | lsb] = voiceObject;
loadCount ++;
} else {
//console.debug(`Skipped overwriting ${msb},${prg},${lsb}: [${upThis.#bankInfo[prg][(msb << 7) | lsb]?.name}] to [${assign[3]}]`);
//console.debug(`Skipped overwriting ${msb},${prg},${lsb}: [${upThis.#bankInfo[prg][(msb << 8) | lsb]?.name}] to [${assign[3]}]`);
};
allCount ++;
};
Expand All @@ -742,7 +767,7 @@ let VoiceBank = class {
msb = options.msb != undefined ? (options.msb.constructor == Array ? options.msb : [options.msb, options.msb]) : [0, 127],
lsb = options.lsb != undefined ? (options.lsb.constructor == Array ? options.lsb : [options.lsb, options.lsb]) : [0, 127];
for (let cMsb = msb[0]; cMsb <= msb[1]; cMsb ++) {
let precalMsb = cMsb << 7;
let precalMsb = cMsb << 8;
for (let cLsb = lsb[0]; cLsb <= lsb[1]; cLsb ++) {
let precalBnk = precalMsb + cLsb;
for (let cPrg = prg[0]; cPrg <= prg[1]; cPrg ++) {
Expand Down

0 comments on commit 30756db

Please sign in to comment.