wwmm / easyeffects

Limiter, compressor, convolver, equalizer and auto volume and many other plugins for PipeWire applications
GNU General Public License v3.0
6.56k stars 270 forks source link

[Feature Request] Downsampling/Bit crusher effect #2847

Closed tmvkrpxl0 closed 8 months ago

tmvkrpxl0 commented 10 months ago

Announcement systems or old devices have low bit rate, and I'd like to simulate voices from it using Easy Effect. Sorry if my requests are too niche, I'm looking for ways to mimic Half Life voice line these days. There's an option in pipewire that adjusts bit rate. However, it is applied globally, not only to recording but also playing. And applications don't adjust well to it. Discord, for example, sometimes cannot play audio at all if it goes too low. Bit rate I used back then was 11025, which is one of the options in audacity.

I appreciate your effort in this and thank you.

wwmm commented 10 months ago

Sorry if my requests are too niche, I'm looking for ways to mimic Half Life voice line these days.

It definitely is niche. But there is no harm in asking. The question is how to do it. EasyEffects follows the sampling rate used by PipeWire. So even if I write a plugin that lowers the rate I will have to bring it back to the one PipeWire is using. So this is not a solution.

Maybe there is some kind of algorithm out there that can simulate the low sampling rate effect without actually lowering it. Or maybe even a LV2 plugin with such a thing already implemented. This would be the ideal solution. But I am not aware of it.

tmvkrpxl0 commented 10 months ago

Ah, I found word I was looking for: downsampling. Yes, changing actual bit rate setting is not desired.

violetmage commented 10 months ago

iirc, this type of effect is called "bitcrushing" in the lands of music synthesizers. maybe someone knows of an existing plugin with this feature.

wwmm commented 10 months ago

Maybe a plugin like the Calf Crusher will do what you want https://calf-studio-gear.org/. But I have never used a bit crusher. So I am not sure.

violetmage commented 10 months ago

ok, just reread wikipedias page on bitcrushers to jog the memory, then looked at calf crusher's docs. the docs don't seem to line up with the descriptions and images on their website, so not sure which to believe.

However, assuming the image they show is correct, then calf crusher has independent controls for bit depth and sample rate, meaning it can do what OP wants.

sadko4u commented 10 months ago

To simulate an effect of low sample rate, just apply brickwall lowpass filter at the nyquist frequency of that system. That means, if the system has 8000 Hz sample rate, the lowpass filter should be applied a bit lower than 4 kHz.

wwmm commented 10 months ago

To simulate an effect of low sample rate, just apply brickwall lowpass filter at the nyquist frequency of that system. That means, if the system has 8000 Hz sample rate, the lowpass filter should be applied a bit lower than 4 kHz.

Something like this @sadko4u ? Screenshot from 2024-01-09 11-49-39

wwmm commented 10 months ago

if the system has 8000 Hz sample rate

While testing my system was at 48 kHz so in order to easily notice changes to the audio I had to go as down as 8 kHz. @tmvkrpxl0 try to do some tests. This LSP filter plugin is already available in EasyEffects.

sadko4u commented 10 months ago

Something like this @sadko4u ?

Yes but flat response below the cut-off frequency is preferred.

tmvkrpxl0 commented 8 months ago

I have no idea what software or plugins you guys are mentioning. I do have calf, lsp, mda, and zam installed in flatpak but I don't know how to use this in live.

wwmm commented 8 months ago

I have no idea what software or plugins you guys are mentioning

A plugin that is already available in EasyEffects under the name Filter. Its native window shows the window shown at https://github.com/wwmm/easyeffects/issues/2847#issuecomment-1883191629

tmvkrpxl0 commented 8 months ago

I see. I thought I had to somehow connect other studio tools with EasyEffect. Applying Filter worked, thanks, although I didn't see option "low brick pass". Low pass with LRX works best for me.