Replies: 23 comments 18 replies
-
ESP32 Performance notes.About Arduino and FreeRTOS tasks. Actually, Arduino core runs on top of FreeRTOS, and all these functions are already use RTOS tasks. What you get when running tasks manually is the second ESP32's core which roughly doubles the computing power (you can see in Arduino IDE in tools menu the options to select on which core to run Arduino and Events), another thing is that you can manually set the task stack size in bytes. About types: float, double and int. ESP32 and ESP32S3 have a dedicated single precision FPU, for better understanding here are the benchmark results which are common for both:
As one can see, int and float have very similar performance except for float division, also FPU gives extra force to float Multiply-Add.
|
Beta Was this translation helpful? Give feedback.
-
Open303 project Open303 ESP32 port |
Beta Was this translation helpful? Give feedback.
-
I was aiming for the simplest way to generate a PCM saw wave on a DAC connected to an S3 today and thankfully got this code running: #define SAMPLE_RATE 44100 const int bufferLen = SAMPLE_RATE / WAVE_FREQ; void setup() {
} void loop() {
} Now really want to use some of the filters and effects from: https://github.com/PaulBatchelor/Soundpipe/tree/master I used those in iOS/iPadOS/macOS apps through AudioKit, but it seems like it SHOULD BE VERY EASY to adapt those effects to use on an embedded C based platform, such as ESP32. Been trying to do that tonight, so collaborators on that mission are welcome. There are A LOT of filters and effects in that library, and it would be GREAT to be able to use those in electronics projects. |
Beta Was this translation helpful? Give feedback.
-
The simplest way of generating saw wave is not the most efficient, unfortunately. There's a strong disadvantage known as aliasing. Initial saw has infinite spectrum and when being resampled, all the spectrum above Nyquist freq will produce well audible parasite sub frequencies. |
Beta Was this translation helpful? Give feedback.
-
Admittedly tonight been trying to get chatgpt to port that diode ladder filter from soundpipe (that was ported from Will Pirkle's emulation seemingly) so I don't have to wade through the soundpipe code to figure out what it's doing before making anything useful. After A LOT of attempts, it seems as though I maybe should wade through that soundpipe code some. Obviously that would be more educational for DSP learning. Was hoping chatgpt could churn out an edition that was functional so I can study that filter that way, rather than with added soundpipe complexity involved. Here is maybe the best edition it output tonight. The issue is that, without adding proper envelope generators, and a sequencer, it's not so easy to know if it's correctly ported that filter. It's maybe a correct-ish port of that filter, although admittedly too tired to sift through the code. Some of it did look a little suspect when it assigned all of the alpha and beta mLPF1c_ the same vals. Anyway, here is that code. Maybe it's useful regardless of if a correct port or not:
|
Beta Was this translation helpful? Give feedback.
-
Here is the Stanford chugin with Will Pirkle listed as either author or it is based on the documentation (and derivation?) in the book or research papers he wrote. |
Beta Was this translation helpful? Give feedback.
-
Check this collection https://github.com/ddiakopoulos/MoogLadders I've tested some of these, and Krajeski was the default one for some time. |
Beta Was this translation helpful? Give feedback.
-
AcidBox todo
Any input is welcomed. |
Beta Was this translation helpful? Give feedback.
-
The one in soundpipe sounds correct, although don't know how CPU efficient that is: https://github.com/paulbatchelor/soundpipe Been trying for much of the past day to port that diode ladder also and will be nice to have that diode clipper to accompany it. That is basically the flavor I like. More MXR style. DSP learning was coming along until chatgpt apparently was sadly unable to comprehend that finding if the current sample in a lowpass filter had to be attenuated required knowing the amplitude of the past sample(s). Maybe there is some other special way to calculate that using angular frequency and sample rate and so on, without looking at past sample, but I doubt that. Anyway, so then was on to youtube. Did read some of Will Pirkle book about DSP in C++ yesterday though and he said that diode ladder is the MOST complex filter in that book. There is a lot of interconnection between filter stages in that filter. I assume there is some easy way to throw a wave cycle buffer into it and get it to output a filtered edition, although it didn't seem as straight forward to integrate into that saw wave generator as I had hoped. Certainly thankful it's there though, because there seems to be A LOT of math in that transfer function of that filter. Actually kinda tired of analog emulation because of such overcomplicated hassles. Directly modifying a wave programmatically seems SO MUCH easier than trying to emulate analog circuits that can vary. About that jukebox, I usually only play and sequence White keys, to avoid any drama. I compose based on frequency relationships, so I do admittedly include one sharp sometimes. That is only because it's the closest to a whole frequency interval though. |
Beta Was this translation helpful? Give feedback.
-
Realized today that the diode clipper sound sounds "GOOD" and loud, because it basically makes a louder saw wave. Basically the initial peak of that saw is still sudden, but it plays at loudest level longer. Wrote one today that grabs that saw wave array from a saw wave for loop and processes it, including amplitude compensation.
|
Beta Was this translation helpful? Give feedback.
-
Here is a link to the soundpipe clipper. Oddly didn't seem to be in the main soundpipe, although maybe it was that "clipping saturation" in there. And here is a link to the soundpipe docs: https://paulbatchelor.github.io/res/soundpipe/docs/ |
Beta Was this translation helpful? Give feedback.
-
Here is the original diode ladder (the code the soundpipe diode ladder was supposedly based on) chugin from the stanford ccrma. That plugin was maybe the first of those that Will Pirkle is listed as the author of. Looks maybe easier to port: Thankfully found the notes Will Pirkle apparently made about that filter: |
Beta Was this translation helpful? Give feedback.
-
Saw those jungle samples in that project dir. I've been wanting to make a standalone MPC style quantized jungle performance dealio. |
Beta Was this translation helpful? Give feedback.
-
By the way, decoupling cap between 3.3 and gnd on that breadboard seems unnecessary. If want to be cautious, can put one between 5V and GND though. |
Beta Was this translation helpful? Give feedback.
-
Been working on a GUI that utilizes LVGL library mainly. That is functioning by itself. And also the AcidBox app functions by itself. But sadly after added that GUI, the sound was very distorted. Not in the noise overly way like it was before, but more of a harshly distorted choppy sound. And the GUI wasn't responsive either, and although the general GUI outline showed, the colors were not correct. Wondering if maybe it's a multiple i2s issue or why that is happening. Any good clues or recommendations? I should maybe try it with that open303 port to see if it functions better with that. |
Beta Was this translation helpful? Give feedback.
-
I am quite sure that there's no more CPU ticks left for the GUI. If you want such comprehensive GUI you should run it on a separate MCU and only send MIDI messages to AcidBox. Open303 has a whole CPU core to run GUI. |
Beta Was this translation helpful? Give feedback.
-
I suppose it was maybe naive to assume that USB serial MIDI with AcidBox meant that it could receive MIDI messages through USB from a laptop. Is that MIDI only through direct connections via USB to some MIDI controllers, or...? |
Beta Was this translation helpful? Give feedback.
-
Tonight been battling and working for MORE THAN 4 HOURS to simply get a diode ladder filter emulation ported. Here is the .ino so far. Can have a look at it and force it to function? I mainly programmed in languages other than C++, so I imagine it's simply language semantics. This is the HORRIBLY FORMATTED (sadly) PDF it is ported from: https://web.archive.org/web/20211130062751/http://www.willpirkle.com/Downloads/AN-6DiodeLadderFilter.pdf
|
Beta Was this translation helpful? Give feedback.
-
I put a more proper edition of that work-in-progress port here today: |
Beta Was this translation helpful? Give feedback.
-
Tried that diode ladder filter emulation posted by karrikuh on kvr more than a calendar decade ago? Yesterday read that thread on kvr. |
Beta Was this translation helpful? Give feedback.
-
Also found this today for USB MIDI on S3: |
Beta Was this translation helpful? Give feedback.
-
By the way, a seemingly nice tutorial on dual core ESP32 programming: Seems it should be possible to put drums on one core and synth on other or some similar config. |
Beta Was this translation helpful? Give feedback.
-
Actually seems interesting to put all the sound stuff on one core and all the MIDI on the other core. Seems people are running displays on a second ESP32, but that likely isn't necessary. Seems likely there is an easy way to strip out second synth, but I haven't looked at that. Maybe there is a #define flag somewhere for that. Anyway, having only one synth and putting MIDI on second core with display seems like that can make it all run on one ESP32-S3. |
Beta Was this translation helpful? Give feedback.
-
Hi!
Seems good to make a thread with a bunch of tips and info and links for tuning the envelope and accents and glide and so on, so here it is! There is more to tuning the envelope generator and accents and glide and so on properly than some may expect. And somewhat annoying how much precision was involved.
I will start this thread by posting a useful page that has some good info for tuning Accent:
https://modwiggler.com/forum/viewtopic.php?t=10885
People are welcome to reply with more such info to make a thorough and exact finalized THIS IS EXACTLY HOW TO (generally, because there is variation in analog synths of same model anyway, haha) thread to have as a reference.
Beta Was this translation helpful? Give feedback.
All reactions