Skip to content

Commit

Permalink
add locale for bank offset
Browse files Browse the repository at this point in the history
use decoded midi name for file name
fix rmid expecting to have encoding
  • Loading branch information
spessasus committed Aug 5, 2024
1 parent f85951b commit f80f390
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SpessaSynth",
"version": "3.11.0",
"version": "3.11.1",
"type": "module",
"scripts": {
"start": "node src/website/server/server.js",
Expand Down
4 changes: 4 additions & 0 deletions src/website/js/sequencer_ui/sequencer_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ class SequencerUI
// use encoding suggested by the rmidi if available
if(data.isEmbedded)
{
if(data.RMIDInfo[RMIDINFOChunks.encoding] === undefined)
{
return;
}
const dec = new TextDecoder();
const encoding = dec.decode(data.RMIDInfo[RMIDINFOChunks.encoding].buffer).replace(/\0$/, '');
this.changeEncoding(encoding);
Expand Down
4 changes: 4 additions & 0 deletions src/website/locale/locale_files/locale_ja/export_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export const exportAudio = {
quality: {
title: "圧縮品質",
description: "圧縮の品質です。高いほど良い"
},
bankOffset: {
title: "銀行の相殺",
description: "ファイルのバンク オフセット。値 0 が推奨されます。何をしているのかわかっている場合にのみ変更してください。",
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/website/locale/locale_files/locale_pl/export_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ export const exportAudio = {
quality: {
title: "Jakość kompresji",
description: "Jakość skompresowanych próbek. Im wyższa tym lepsza"
},
bankOffset: {
title: "Przesunięcie banku",
description: "Przesunięcie banku w pliku. Zalecane 0. Zmień tylko jeśli wiesz co robisz.",
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/website/manager/export_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export async function _doExportAudioData(normalizeAudio = true, additionalTime =
await new Promise(r => setTimeout(r, ANIMATION_REFLOW_TIME));
if(!separateChannels)
{
this.saveBlob(audioBufferToWav(buf, normalizeAudio), `${this.seq.midiData.midiName || 'unnamed_song'}.wav`);
this.saveBlob(audioBufferToWav(buf, normalizeAudio), `${this.seqUI.currentSongTitle || 'unnamed_song'}.wav`);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/website/manager/export_midi.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export async function exportMidi()
// export modified midi and write out
const file = writeMIDIFile(mid);
const blob = new Blob([file], { type: "audio/mid" });
this.saveBlob(blob, `${mid.midiName || "unnamed_song"}.mid`)
this.saveBlob(blob, `${this.seqUI.currentSongTitle || "unnamed_song"}.mid`)
}
2 changes: 1 addition & 1 deletion src/website/manager/export_rmidi.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export async function _exportRMIDI()

const rmidBinary = writeRMIDI(newFont, mid, font, bankOffset, this.seqUI.encoding);
const blob = new Blob([rmidBinary.buffer], {type: "audio/rmid"})
this.saveBlob(blob, `${mid.midiName || "unnamed_song"}.rmi`);
this.saveBlob(blob, `${this.seqUI.currentSongTitle || "unnamed_song"}.rmi`);
message.textContent = this.localeManager.getLocaleString(localePath + "done");
closeNotification(notification.id);
SpessaSynthGroupEnd();
Expand Down
30 changes: 15 additions & 15 deletions src/website/minified/demo_main.min.js

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions src/website/minified/local_main.min.js

Large diffs are not rendered by default.

0 comments on commit f80f390

Please sign in to comment.