From 398febb092135b340148f74592a3a3886dc01ae6 Mon Sep 17 00:00:00 2001 From: spessasus Date: Sat, 22 Jun 2024 12:42:07 +0200 Subject: [PATCH] tone down reverb a bit --- src/spessasynth_lib/soundfont/chunk/generators.js | 8 +++++--- .../worklet_system/worklet_utilities/stereo_panner.js | 2 +- src/spessasynth_lib/utils/byte_functions.js | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/spessasynth_lib/soundfont/chunk/generators.js b/src/spessasynth_lib/soundfont/chunk/generators.js index 0189974e..2698061c 100644 --- a/src/spessasynth_lib/soundfont/chunk/generators.js +++ b/src/spessasynth_lib/soundfont/chunk/generators.js @@ -1,6 +1,6 @@ import { ShiftableByteArray } from '../../utils/shiftable_array.js' import { RiffChunk } from './riff_chunk.js' -import { readByte, signedInt16 } from '../../utils/byte_functions.js' +import { signedInt16 } from '../../utils/byte_functions.js' /** * generators.js @@ -177,8 +177,10 @@ export class Generator{ */ constructor(dataArray) { // 4 bytes: - // type, value, type, value - let bytes = [readByte(dataArray), readByte(dataArray), readByte(dataArray), readByte(dataArray)]; + // type, type, type, value + const i = dataArray.currentIndex; + let bytes = [dataArray[i], dataArray[i + 1], dataArray[i + 2], dataArray[i + 3]]; + dataArray.currentIndex += 4; /** * @type {number} diff --git a/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/stereo_panner.js b/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/stereo_panner.js index 3979fa6f..cdf3784e 100644 --- a/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/stereo_panner.js +++ b/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/stereo_panner.js @@ -1,4 +1,4 @@ -export const WORKLET_SYSTEM_REVERB_DIVIDER = 200; +export const WORKLET_SYSTEM_REVERB_DIVIDER = 500; export const WORKLET_SYSTEM_CHORUS_DIVIDER = 500; /** * stereo_panner.js diff --git a/src/spessasynth_lib/utils/byte_functions.js b/src/spessasynth_lib/utils/byte_functions.js index ad886ffe..31c073fc 100644 --- a/src/spessasynth_lib/utils/byte_functions.js +++ b/src/spessasynth_lib/utils/byte_functions.js @@ -65,7 +65,11 @@ export function readBytesAsString(dataArray, bytes, encoding=undefined, trimEnd= let string = ""; for (let i = 0; i < bytes; i++) { let byte = readByte(dataArray); - if(byte < 32 || byte > 127 || finished) + if(finished) + { + continue; + } + if(byte < 32 || byte > 127) { if(trimEnd) { finished = true;