Open qcapen opened 1 year ago
In audio processing terms, auto-ducking is basically sidechain compression where the signal of one audio track is used to attenuate the signal of another track (Dynamic Range Compression, ). Unlike automatic ducking in audio/video editors which can analyze prerecorded audio signals and apply the effect appropriately, the MPF-MC audio engine uses real-time processing to generate its audio signals. Since sounds are generated by an event-driven system, real-time signal processing must be used to analyze and generate an automatic ducking effect. This kind of signal processing is not trivial to implement, meaning this is not a simple feature to add to the MPF-MC and would certainly add some processing overhead.
I simpler implementation could just use a common ducking envelope (set of ducking settings) and apply them to every sound played on a track when auto ducking is enabled (or perhaps set an auto ducking flag on each sound that should be ducked). This would just require setting the ducking settings on each sound instance by copying the settings from the master ducking envelope. No other changes would be necessary. This is much easier than doing realtime audio analysis and processing and would lead to similar results.
Discussed in https://github.com/orgs/missionpinball/discussions/106