jiaaro / pydub

Manipulate audio with a simple and easy high level interface
http://pydub.com
MIT License
8.94k stars 1.05k forks source link

EQ or bass/treble support? #316

Open FlyingMachineLearning opened 6 years ago

FlyingMachineLearning commented 6 years ago

I didn't see an enhancements section, I'm sorry.

Hey!

So, I use PyDub for virtually all of my clients' operations (dude, you seriously need a Patreon, I owe you my life). At the present moment, I've macro'd my Normalize, EQ, Compressor, and Amplify functions in Audacity.

Is EQ or bass/treble updates something you'll build in down the line?

jiaaro commented 6 years ago

Thank you for the kind words - pydub includes a first order (only 6 db per octave reduction) high pass filter and low pass filter in the effects.py and if you have scipy installed you can import the scipy_effects.py module which includes high/low/band pass filters where you can specify the order (2nd order would be 12 db per octave reduction, 3rd order is 18 db per octave, etc).

A motivated person could build their own collection of EQ functions with that (basically all EQ is made out of high and low pass filters).

But, having said that, I think it'd be more useful to get something working that allows VSTs to be used as pydub effects. I've looked into it a bit, but it's complicated (see issue #71 ). One promising angle was a tool that lets you process an audio file with a VST at the command line. Maybe we could subprocess out to do that processing. The overhead of a subprocess isn't a very big deal for operations this heavy (it's something like 1ms of overhead)

FlyingMachineLearning commented 6 years ago

"A motivated person could build their own collection of EQ functions with that (basically all EQ is made out of high and low pass filters)."

I thought this might be the case!

I'll evaluate my process and the math behind it and see what I need to do!

Thanks!!

On Mon, Sep 17, 2018, 3:44 PM James Robert notifications@github.com wrote:

Thank you for the kind words - pydub includes a first order (only 6 db per octave reduction) high pass filter and low pass filter in the effects.py and if you have scipy installed you can import the scipy_effects.py module which includes high/low/band pass filters where you can specify the order (2nd order would be 12 db per octave reduction, 3rd order is 18 db per octave, etc).

A motivated person could build their own collection of EQ functions with that (basically all EQ is made out of high and low pass filters).

But, having said that, I think it'd be more useful to get something working that allows VSTs to be used as pydub effects. I've looked into it a bit, but it's complicated (see issue #71 https://github.com/jiaaro/pydub/issues/71 ). One promising angle was a tool that lets you process an audio file with a VST at the command line. Maybe we could subprocess out to do that processing. The overhead of a subprocess isn't a very big deal for operations this heavy (it's something like 1ms of overhead)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jiaaro/pydub/issues/316#issuecomment-422144983, or mute the thread https://github.com/notifications/unsubscribe-auth/AMCwwKwbqYVQDmQpk98cX_SYGT0kLTr3ks5ub_uVgaJpZM4WshNd .

anubhav-narayan commented 5 years ago

Motivation Indeed.

I had a motivation to build an EQ for my Digital Signal Processing Algorithm, I had to use the tools at hand. Here is what I have come up with. I don't know if it is 100% correct(made with 3 cups of coffee inside) but according to my study, this should work. cheap_eq.txt

P. S. If you have time, give my project repos a look, I might need a little help. Thanks!

anubhav-narayan commented 4 years ago

I have modified the code for the EQ understanding the problems that I faced over on the testing of the code, I herewith attach the improved code. cheap_eq.txt

LithiumXoul commented 4 years ago

anubhav-narayan You absolute legend. I've been looking for this for a while now and finally found it thanks to you!

anubhav-narayan commented 4 years ago

Hey, I am no legend, this thing is still "work in progress" so don't expect very accurate results.

anubhav-narayan commented 4 years ago

Added a Channel Independent Mode of the eq function.

492