fix: stereo sample downmix in track panners which causes the sampled sounds (both MIDI and audio tracks) are quieter than it should be

This commit is contained in:
Xiaohan-Tian
2026-05-24 00:04:19 -07:00
parent 7ee4a7458e
commit 77fb0e4c1f
7 changed files with 19 additions and 6 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import { FLUIDR3_INSTRUMENT_MAP } from '../../constants/generalMidiConstants';
import type { InstrumentType } from '../track/KGMidiTrack';
import { KGToneBuffersPool } from './KGToneBuffersPool';
import { KGToneSamplerFactory } from './KGToneSamplerFactory';
import { createStereoTrackPanner } from './createStereoTrackPanner';
// InstrumentType is defined in KGMidiTrack and re-used here
@@ -100,7 +101,7 @@ export class KGAudioBus {
]);
// Create the audio bus instance
const panner = new Tone.Panner(pan);
const panner = createStereoTrackPanner(pan);
sampler.connect(panner);
const audioBus = new KGAudioBus(sampler, audioBuffers, instrument, panner, volume, pan, muted, solo);