Audio4Linux / JDSP4Linux

An audio effect processor for PipeWire and PulseAudio clients
GNU General Public License v3.0
945 stars 35 forks source link

[Feature Request] How to enable haas effect? #68

Closed Pairman closed 2 years ago

Pairman commented 2 years ago

Is there any option in jdsp4linux equivalent to Differential Sound(Haas Effect) in viperfx? I'm new to jamesdsp and don't know the professional words. I tried Fractional delay line in Liveprog and it kinda added some delay, but I feel the center of sound is closer to one ear than another.

So are there methods to enable Haas Effect in jdsp, or do I have to change paramaters of Fractional delay(currently using leftDelay=15.1 and rightDelay=4.2)? Thanks in advance.

timschneeb commented 2 years ago

You're on the right track with the Fractional delay line script.

Looking at a decompilation of Viper's implementation, it works the same except that it uses milliseconds as a unit, while the script in JDSP measures the delay in samples instead.

You can convert these values; the strongest setting (20ms) in Viper would correspond to 960 samples (provided the sample rate is 48000Hz). Using this conversion formula: milliseconds / 1000 * sample_rate = samples. Viper also always delays the right channel, so you should set the left channel delay to 0 samples and the right one to 960 samples to achieve the same behavior as Viper (with 20ms in this example).

Because one channel is delayed, one of your ears hears the sound earlier than the other; I think that's why it can feel like the center of the sound is closer to one ear than another.

Pairman commented 2 years ago

You're on the right track with the Fractional delay line script.

Looking at a decompilation of Viper's implementation, it works the same except that it uses milliseconds as a unit, while the script in JDSP measures the delay in samples instead.

You can convert these values; the strongest setting (20ms) in Viper would correspond to 960 samples (provided the sample rate is 48000Hz). Using this conversion formula: milliseconds / 1000 * sample_rate = samples. Viper also always delays the right channel, so you should set the left channel delay to 0 samples and the right one to 960 samples to achieve the same behavior as Viper (with 20ms in this example).

Because one channel is delayed, one of your ears hears the sound earlier than the other; I think that's why it can feel like the center of the sound is closer to one ear than another.

Thank you! I understand now.