From fce646065a01e8d93136c5d2f79b747c95cf658c Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 14 Jul 2026 11:50:34 +0200 Subject: [PATCH] Update data access in collectEffects to use fxData instead of fxFile.data --- src/lib/parsers.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/lib/parsers.ts b/src/lib/parsers.ts index 12feb84..7c27a76 100644 --- a/src/lib/parsers.ts +++ b/src/lib/parsers.ts @@ -602,31 +602,32 @@ export function collectEffects(files: TarFile[]) { }; } - const effectType = fxFile.data[4]; + const fxData = fxFile.data; + const effectType = fxData[4]; const param1 = bytesToFloat32( - fxFile.data.slice(12 + (effectType - 1) * 4, 16 + (effectType - 1) * 4), + fxData.slice(12 + (effectType - 1) * 4, 16 + (effectType - 1) * 4), ); const param2 = bytesToFloat32( - fxFile.data.slice(76 + (effectType - 1) * 4, 80 + (effectType - 1) * 4), + fxData.slice(76 + (effectType - 1) * 4, 80 + (effectType - 1) * 4), ); const outputCompressor = - fxFile.data.length >= 144 + fxData.length >= 144 ? { - drive: bytesToFloat32(fxFile.data.slice(136, 140)), - speed: bytesToFloat32(fxFile.data.slice(140, 144)), + drive: bytesToFloat32(fxData.slice(136, 140)), + speed: bytesToFloat32(fxData.slice(140, 144)), } : undefined; const sidechain = - fxFile.data.length >= 152 + fxData.length >= 152 ? { - length: bytesToFloat32(fxFile.data.slice(144, 148)), - shape: bytesToFloat32(fxFile.data.slice(148, 152)), + length: bytesToFloat32(fxData.slice(144, 148)), + shape: bytesToFloat32(fxData.slice(148, 152)), routing: - fxFile.data.length >= 160 + fxData.length >= 160 ? (Object.fromEntries( projectGroups.map((group, index) => { const offset = 152 + index * 2; - const rawValue = fxFile.data[offset] | (fxFile.data[offset + 1] << 8); + const rawValue = fxData[offset] | (fxData[offset + 1] << 8); const routing: SidechainGroupRouting = { rawValue, sourcePadMask: rawValue & 0x0fff, @@ -640,7 +641,7 @@ export function collectEffects(files: TarFile[]) { : undefined; return { - rawData: fxFile.data, + rawData: fxData, effectType, param1, param2,