-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Audio effects #9640
base: main
Are you sure you want to change the base?
Add Audio effects #9640
Conversation
I'm still digging into the code, but my first instinct is to have the Speaking of buffer sizes, it may be nice to explore having a fixed buffer size and altering the rate of playback of that buffer depending on the delay setting. This would be similar to a bucket-brigade style delay pedal and require some more advanced interpolation, etc. I think it be worth exploring an "Analog" delay effect of this nature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the initial PR! This is very exciting.
I'm not too worried at this point as I'm using Same thought on the
I think this would be good for another effect. I have tossed about the idea of a generic delay buffer that other effects could use. |
Update for anyone following along:
Getting a lot closer. |
Word to the wise... 44.1Khz dual channel audio with asyncio without enough sleep in a loop causes weird stuttering that you will try to debug all night long, and turns out just add a small delay to the sleep loop and you are good. Maybe a sign a 0 asyncio.sleep isn't running audio tasks fully? But it did prompt me to add double buffering in. |
This is very weird! I'd expect audio stuff to run in between VM byte codes. I'd appreciate it if you could dig into why it isn't working. |
Latest updates:
Things are close now. I still want to see if I can tell why MP3s are not working (they should be don't think it is a processing limit). |
Took a look, seemed between two channels of 44.1Khz audio and constantly checking a rotary encoder I hit the processing limit as close as I can tell. Or the rotary encoder blocked long enough (and I was checking it often enough) to slow the audio down. So at this point seems to be a non-issue. |
MP3Decoder as a source works now. Was a bug I just hadn't ran into. Also samples of unusual lengths work now (wasn't update the remaining sample buffer correctly, and most samples use values that just happened to work). |
I finally got around to testing out your audio_effects fork and playing around with audiodelays.Echo. I was hoping to recreate some form of chorus effect with this module, but I don't think that's possible with the current implementation. The For instance, if you wanted to create a strong "slapback" style delay, this is what I would expect to work in that scenario (I'm excluding
The expected outcome would be a full volume repeat of the audio after 500ms and then no additional feedback/decay of that audio. Instead, there is no effect on the audio output because the The solution is relatively simple. Instead of applying |
I've created a pull request on your fork for your consideration, @gamblor21. gamblor21#1 |
I will take a look but probably not until tomorrow. What you were saying makes sense. One thing I do plan to do is create more effects then just this echo. This really is a proof-of-concept still. I was looking a chorus briefly last night, and want to consider others (reverb) as well. If you are playing with it another thing you can try is chaining echos (since that is my only effect ha). But basically |
Though the
In this example, it is clear that the value of the LFO is changing over time, but there is no audible change in the output. |
Oh good catch! Thanks, I'll have a fix for that soon I know what is wrong. |
Foundation to add audio effects to CircuitPython as discussed in issue #8974.
This PR aims to create initial modules, some base effects and utilities to help create future effects. The ones included will serve as a template for future creations.
To do:
Looking for feedback on the API and anything else that comes up.
When I have time I plan to document how to create your own effects using the ones provided.
Sample code to run: