-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Problem
I want to allow users to control the relative volume of the individual channels/instruments being played via UI controls.
Description
Simply said: I want to control the "mix volume" of the individual channels via an API. This custom volume should survive any volume changes which might be happening inside MIDI and the synthesizer.
An example: If the user selects a 50% volume for a Guitar on channel 0 it should always be played at 50% compared to how it would "normally" sound from a MIDI perspective. If the guitar gets louder or more silent via volume changes or via modulators it should still be played at 50% of that.
Alternatives
It is very tricky but possible to "monitor" the volume changes which might be coming from MIDI and always calculate an adjusted value. I need to remember for every channel the "MIDI volume" and adjust it to the "desired volume" before passing it to spessasynth.
Additional info
I think it should be as simple as respecting a separate "mix volume" here:
spessasynth_core/src/synthesizer/audio_engine/engine_components/dsp_chain/stereo_panner.ts
Lines 73 to 76 in 82cdd41
| const gain = | |
| this.synthProps.masterParameters.masterGain * | |
| this.synthProps.midiVolume * | |
| voice.gain; |