Skip to content

Commit

Permalink
Fix XG RMI exporting
Browse files Browse the repository at this point in the history
and remove version check
  • Loading branch information
spessasus committed Sep 2, 2024
1 parent 578721b commit ea7d1ea
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 86 deletions.
3 changes: 2 additions & 1 deletion src/spessasynth_lib/midi_parser/rmidi_writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ export function writeRMIDI(
consoleColors.info);
} else {
// there is a preset with this bank. add offset. For drums add the normal offset.
const newBank = (bank === 128 ? 0 : realBank) + bankOffset;
let drumBank = system === "xg" ? 127 : 0;
const newBank = (bank === 128 ? drumBank : realBank) + bankOffset;
channel.lastBank.messageData[1] = newBank;
SpessaSynthInfo(`%cPreset %c${bank}:${e.messageData[0]}%c exists. Changing bank to ${newBank}.`,
consoleColors.info,
Expand Down
10 changes: 0 additions & 10 deletions src/spessasynth_lib/synthetizer/synthetizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import { SoundfontManager } from './synth_soundfont_manager.js'
* @property {boolean|undefined} oneOutput - if synth should use one output with 32 channels (2 audio channels for each midi channel). this disables chorus and reverb.
*/

const CURRENT_SPESSASYNTH_VERSION = "3.20.10";

export const WORKLET_PROCESSOR_NAME = "spessasynth-worklet-system";

export const VOICE_CAP = 450;
Expand Down Expand Up @@ -325,14 +323,6 @@ export class Synthetizer {
SpessaSynthWarn(new Error(messageData));
this.eventHandler.callEvent("soundfonterror", messageData);
break;

case returnMessageType.identify:
if(messageData !== CURRENT_SPESSASYNTH_VERSION)
{
this.stopAll(true);
this.worklet.disconnect();
throw new Error(`Outdated worklet_processor.min.js! version: ${messageData}. Please update it to ${CURRENT_SPESSASYNTH_VERSION}`);
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/spessasynth_lib/synthetizer/worklet_processor.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ import { interpolationTypes } from './worklet_utilities/wavetable_oscillator.js'
* purpose: manages the synthesizer (and worklet sequencer) from the AudioWorkletGlobalScope and renders the audio data
*/

const WORKLET_PROCESSOR_VERSION = "3.20.10";

export const MIN_NOTE_LENGTH = 0.07; // if the note is released faster than that, it forced to last that long

export const SYNTHESIZER_GAIN = 1.0;
Expand Down Expand Up @@ -227,10 +225,6 @@ class SpessaSynthProcessor extends AudioWorkletProcessor

stbvorbis.isInitialized.then(() => {
this.postReady();
this.post({
messageType: returnMessageType.identify,
messageData: WORKLET_PROCESSOR_VERSION
});
SpessaSynthInfo("%cSpessaSynth is ready!", consoleColors.recognized);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/website/manager/export_rmidi.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export async function _exportRMIDI()
const songTitle = n.div.querySelector("input[name='song_title']").value;
const comment = n.div.querySelector("input[name='comment']").value;
const genre = n.div.querySelector("input[name='genre']").value;
const bankOffset = n.div.querySelector("input[name='bank_offset']").value;
const bankOffset = parseInt(n.div.querySelector("input[name='bank_offset']").value);
const adjust = n.div.querySelector("input[name='adjust']").checked;

/**
Expand Down
64 changes: 32 additions & 32 deletions src/website/minified/demo_main.min.js

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions src/website/minified/local_main.min.js

Large diffs are not rendered by default.

0 comments on commit ea7d1ea

Please sign in to comment.