From 04c199770921f7d3c9a34ad31f6450e754e0adcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lumi=C3=A8re=20=C3=89lev=C3=A9?= <88174309+PoneyClairDeLune@users.noreply.github.com> Date: Sun, 28 Jul 2024 17:26:41 +0000 Subject: [PATCH] Supported voice level retrieval from banks. --- data/map/xg.10.tsv | 39 +++++++++++++++++++++++++++++++++++++++ data/map/xg.12.tsv | 29 ++++++++++++++++++++++++++++- data/map/xg.24.tsv | 13 +++++++++++++ src/basic/index.mjs | 4 ++++ src/state/bankReader.js | 16 +++++++++++++--- 5 files changed, 97 insertions(+), 4 deletions(-) diff --git a/data/map/xg.10.tsv b/data/map/xg.10.tsv index 6a71ef2..1efffa7 100644 --- a/data/map/xg.10.tsv +++ b/data/map/xg.10.tsv @@ -497,12 +497,51 @@ Rev.Kick Rev. Kick RConBaDr RvConBaDrm Rev. Tom ReverseTom Rev.Tom2 Rev. Tom 2 +MtdClavi MutedClavi +DstnFire DistntFire +Lightnin Lightning +TinKettl Tin Kettle BlineHrd Hard Bline +TnglCaos TinglChaos +VanAllen Van Allen +BlowNoiz Blow Noise +K/S Ana. K/S Analog +Monastry Monastery +Incontnc Incontince Prcesion Precession +K/S Hum. K/S Humid +IncntClk IncntClick RndmWalk RandomWalk +Lust St. StereoLust +K/S Slap Kk/Sn Slap +CheapOsc CheapOsci. RandmRun Random Run +SoftHit+ Soft Hit + +Rvr/Crsh Rev./Crash +NastyCut Nasty Cut +CheapOc+ CheapOsci+ +CalcOrg1 CalcOrgan1 +NstyCtSt NastyCutSt NstOrSpl NastyOrSpl +CalcOrg2 CalcOrgan2 +Xe Xenon +SprClick SuperClick +CalcOrg3 CalcOrgan3 +Ruin St. StereoRuin +OrganHit Organ Hit +ChoCalcO ChorCalcOr Malfnctn Malfnction +OrgnHit+ Organ Hit+ +ChoirSpl SplitChoir +UnvrsSwp UniversSwp +VaporVox VaporVoice +Xe + Xenon + +VoxShoot VoiceShoot +SemiacOr SemiAcouOr +Refusal+ Refusal + +EnvyShrt Short Envy +DoubtDbl DoublDoubt +Glocken+ Glocken + CutNoise Cut Noise CutNoiz2 CutNoise 2 DstCutNz DstCutNoiz diff --git a/data/map/xg.12.tsv b/data/map/xg.12.tsv index aef2d2e..a8c4d7d 100644 --- a/data/map/xg.12.tsv +++ b/data/map/xg.12.tsv @@ -395,9 +395,36 @@ Rev.Kick Reverse Kick RConBaDr RevConBaDrum Rev. Tom Reverse Tom Rev.Tom2 ReverseTom 2 +MtdClavi Muted Clavi. +DstnFire Distant Fire +BlineHrd Hard Beeline +TnglCaos Tingle&Chaos +K/S Ana. Kk/Sn Analog +K/S Hum. Kk/Sn Humid +IncntClk IncontiClick RndmWalk Random Walk -NstOrSpl NastyOrSplit +Lust St. Stereo Lust +K/S Slap Kik/Snr Slap +CheapOsc Cheap Oscil. +Rvr/Crsh Rev. / Crash +CheapOc+ Cheap Oscil+ +CalcOrg1 Calc Organ 1 +NstyCtSt St.Nasty Cut +NstOrSpl SplitNastyOr +CalcOrg2 Calc Organ 2 +SprClick Super Click +CalcOrg3 Calc Organ 3 +Ruin St. Stereo Ruin +ChoCalcO ChorusCalcOr Malfnctn Malfunction +OrgnHit+ Organ Hit + +ChoirSpl Split Choir +UnvrsSwp Universe Swp +VaporVox Vapour Voice +VoxShoot Voice Shoot +SemiacOr SemiAcouOrgn +DoubtDbl Double Doubt +Glocken+ Glocknspiel+ CutNoiz2 Cut Noise 2 DstCutNz DistCutNoise Str.Slap String Slap diff --git a/data/map/xg.24.tsv b/data/map/xg.24.tsv index 8a41990..97eb73d 100644 --- a/data/map/xg.24.tsv +++ b/data/map/xg.24.tsv @@ -307,8 +307,21 @@ RevSnare Reverse Snare RvSnare2 Reverse Snare 2 RConBaDr Rev. Concert Bass Drum Rev.Tom2 Reverse Tom 2 +MtdClavi Muted Clavinet Voodoo Voodoo Drums +TnglCaos Tingle & Chaos +K/S Ana. Analog Kick / Snare +K/S Hum. Humid Kick / Snare +IncntClk Incontience Click +K/S Slap Slap Kick / Snare +CheapOsc Cheap Oscillator +Rvr/Crsh Reverse / Crash +CheapOc+ Cheap Oscillator + +NstyCtSt Stereo Nasty Cut NstOrSpl Split Nasty Organ +ChoCalcO Chorus Calc Organ +UnvrsSwp Universe Sweep +SemiacOr Semi Acoustic Organ Glocken+ Glockenspiel + CutNoise Cutting Noise CutNoiz2 Cutting Noise 2 diff --git a/src/basic/index.mjs b/src/basic/index.mjs index d2b644f..81dfe47 100644 --- a/src/basic/index.mjs +++ b/src/basic/index.mjs @@ -379,6 +379,10 @@ let RootDisplay = class extends CustomEventSource { getTempo() { return this.#noteTempo; }; + eachVoice(iter) { + let upThis = this; + upThis.#voiceCache.forEach(iter); + }; sendCmd(raw) { this.device.runJson(raw); }; diff --git a/src/state/bankReader.js b/src/state/bankReader.js index eb5b3af..188d912 100644 --- a/src/state/bankReader.js +++ b/src/state/bankReader.js @@ -29,7 +29,7 @@ let VoiceBank = class { get(msb = 0, prg = 0, lsb = 0, mode) { let sid = [msb, prg, lsb]; let bankName; - let bankPoly = 1, bankType = 0, bankDrum; + let bankPoly = 1, bankType = 0, bankDrum, bankLevel; let args = Array.from(arguments); switch (mode) { case "xg": { @@ -426,6 +426,7 @@ let VoiceBank = class { bankPoly = bankObject?.poly || bankPoly; bankType = bankObject?.type || bankType; bankDrum = bankObject?.drum; + bankLevel = bankObject?.level; } else { if (!this.strictMode) { /* if (mode != "gs" && mode != "ns5r") { @@ -480,6 +481,7 @@ let VoiceBank = class { bankPoly = bankObject?.poly || bankPoly; bankType = bankObject?.type || bankType; bankDrum = bankObject?.drum; + bankLevel = bankObject?.level; } else { bankName = ""; ending = "*"; @@ -683,6 +685,7 @@ let VoiceBank = class { poly: bankPoly, type: bankType, drum: bankDrum, + level: bankLevel, iid, eid, sid, @@ -709,7 +712,7 @@ let VoiceBank = class { debugger; }; } else { - let msb = 0, prg = 0, lsb = 0, name, poly = 1, type = 0, drum; + let msb = 0, prg = 0, lsb = 0, name, poly = 1, type = 0, level, drum; assign.forEach(async function (e1, i1) { switch (i1) { case sig[0]: { @@ -742,6 +745,12 @@ let VoiceBank = class { drum = e1; break; }; + case sig[6]: { + if (e1?.constructor) { + level = parseInt(e1); + }; + break; + }; }; }); upThis.#bankInfo[prg] = upThis.#bankInfo[prg] || []; @@ -753,7 +762,8 @@ let VoiceBank = class { name, poly, type, - drum + drum, + level }; /*if (loadCount > 889 && loadCount < 910) { console.debug(e);