spessasus / SpessaSynth

MIDI SoundFont/DLS synthesizer library written in JavaScript.
https://spessasus.github.io/SpessaSynth/
Other
96 stars 12 forks source link

MIDI channel panning should have minimal effect (if any) on reverb #60

Closed mrbumpy409 closed 1 month ago

mrbumpy409 commented 1 month ago

Is your feature request related to a problem? Please describe. In SpessaSynth, when a MIDI channel is panned, the reverb is also panned in the same way. However, this is not how acoustic spaces work. A hard-panned reverb sounds unnatural. Most MIDI synths simply send a mono mixdown of the MIDI playback into the reverb engine, so any panning has no impact on the reverb. I'm sure there are also more elegant (and computationally expensive) ways to have the reverb react differently to panning if preferred, but that is out of my wheelhouse.

Steps to reproduce: Play an instrument on a MIDI channel panned hard left. You will hear the reverb also panned hard left.

Desired solution: In a real acoustic space, an instrument far to your left would still reverberate off of the walls and reach your right ear. There are likely several solutions to this problem, but the simplest would be what I mentioned above: send a mono mixdown of the MIDI playback into a reverb engine that generates a stereo reverb.

spessasus commented 1 month ago

Hm,

Sf 2.04 specification section 9.1.5 says:

The output of the final gain amplifier can be routed into the effects unit. This unit causes the sound to be located (panned) in the stereo field, and a degree of reverberation and chorus to be added. The pan is specified in terms of percentage left and right, which also could be considered as an azimuth angle. The reverb and chorus sends are specified as a percentage of the signal amplitude to be sent to these units, from 0% to 100%.

The gain amplifier should send the panned output to the effects processor, so it contradicts your suggestion.

But musically,your suggestion makes sense, so I'm a bit split up here.

Thoughts?

mrbumpy409 commented 1 month ago

I know that some reverb engines will take panned audio sources (I'm not an expert in how these work vs. mono summed audio), but even then, I've never heard the reverb so isolated in its directionality as the panned source is.

mrbumpy409 commented 1 month ago

Here is a test MIDI file that plays a wood block (GM preset 115) centered, panned hard left, and panned hard right. Also included in the ZIP file are recordings of the test played on Audigy2 ZS, BASSMIDI, FluidSynth, and SpessaSynth, using GeneralUser GS 2.0.

In all the recordings except for SpessaSynth, the reverb sounds the same regardless of the instrument panning. With SpessaSynth, you can hear the reverb being hard panned left and right.

spessasus commented 1 month ago

You're right, mono reverb sounds much better! Thanks for the report (and the test files), fixed!

mrbumpy409 commented 1 month ago

I just tested, and everything sounds much better. Thank you!

spessasus commented 1 month ago

I just tested, and everything sounds much better. Thank you!

No problem! I've also added an option to configure both chorus and reverb. It is available in the synthesizer controller under the effects config button. Feel free to play around with it!