Skip to content

Channel Mix Volume #49

@Danielku15

Description

@Danielku15

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:

const gain =
this.synthProps.masterParameters.masterGain *
this.synthProps.midiVolume *
voice.gain;

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions