Skip to content

Navigation Menu

Sign in
Sign up

Migrate to PlatformIO #25

andyvans started this conversation in General
Aug 29, 2024 · 6 comments · 9 replies
Discussion options

First off, cool project. I am using to modernise an old tape deck. Acid box is playing from one esp32 while another esp32 is processing the audio, displaying graphics, updating analog VU meters and sending midi messages back to AcidBox.

https://github.com/andyvans/tapedeck-vu-meter/tree/main

Anyway, have you considered updating the AcidBox project to support PlatformIO https://platformio.org/? VSCode is light years better than the Arduino IDEs. In addition, you can use AI plugins like Github Copilot (or free ones) to assist with the gnarly c++ you forgot how to write in the 90s. Also, I am pretty sure PlatformIO builds faster as it's smarter about what files have changed.

I was thinking of updating AcidBox to support PlatformIO in my fork, but thought I would ask you first if you had thought about it first in case you have already tried it or if it's in progress.

You must be logged in to vote

Replies: 6 comments 9 replies

Comment options

Great project with the tapedeck! I am not going to move to PlatformIO, so feel free to make a fork.

You must be logged in to vote
0 replies
Comment options

First off, cool project. I am using to modernise an old tape deck. Acid box is playing from one esp32 while another esp32 is processing the audio, displaying graphics, updating analog VU meters and sending midi messages back to AcidBox.

https://github.com/andyvans/tapedeck-vu-meter/tree/main

Anyway, have you considered updating the AcidBox project to support PlatformIO https://platformio.org/? VSCode is light years better than the Arduino IDEs. In addition, you can use AI plugins like Github Copilot (or free ones) to assist with the gnarly c++ you forgot how to write in the 90s. Also, I am pretty sure PlatformIO builds faster as it's smarter about what files have changed.

I was thinking of updating AcidBox to support PlatformIO in my fork, but thought I would ask you first if you had thought about it first in case you have already tried it or if it's in progress.

Ah, was pondering trying it with 2 ESP32. So that communication between those ESP32 is done wirelessly or are they wired together directly?

You must be logged in to vote
1 reply
Comment options

The 2 esp32s are wired together. The TX output is used to send midi messages.

Comment options

By the way, a seemingly nice tutorial on dual core ESP32 programming:
https://www.youtube.com/watch?v=w5YigjvSaF4

Seems it should be possible to put this app's sound on one core and the encoders and have the MIDI and so on running on other core.

You must be logged in to vote
5 replies
Comment options

AcidBox uses both cores quite intensively. Sound generating and processing occupies both cores addressing to the same resources on semaphore basis, while control routines are taking just a fraction of one core's time.

Comment options

Wow, semaphores also. Nice! Maybe stripping out one of the 2 synths (and maybe MIDI also) is enough to get a display and so on functioning with it on one S3.

Comment options

Regarding my project, FFT processing takes some time which is why the FFT and FastLed code is on one core, devices and MIDI control on the other. Don't sacrifice sound. Save yourself a lot of time and get another esp32. They are only a few bucks.

Comment options

@andyvans do you use FTT from ESP-DSP? It's said to be significantly faster on ESP32 and ESP32-S3.

Comment options

I was initially processing the I2S signal that was being sent to the DAC. This meant I was getting left and right stereo signals.

However, processing an I2S stream gave me inconsistent results - which suspected was me not splitting the data correctly.

So I swapped to sampling the analog output from the DAC.

The data is processed using FFT to split into bands which represent VU meter frequency bands bass to treble and shown on the matrix. The signal is also displayed on the analog VU meters.

I am using an ESP32 S3.

1000008399.mp4
Comment options

https://github.com/copych/ESP32_I2S_Monitor_Recorder you can check this one, it's working and uses i2s input and fft (int, as far as i remember)

You must be logged in to vote
0 replies
Comment options

Here is a better video https://www.youtube.com/watch?v=i5UVzaoIb8w. I am showing the MIDI messages being sent from one ESP to the other on an OLED screen now.

I have been following the discussion on #30 with interest as I noticed some MIDI messages really don't have any effect on the sound.

Regarding the complexity of the code and not being sure what exactly does was part of my motivation to get the code into a nice IDE which would support better analysis and refactoring.

You must be logged in to vote
1 reply
Comment options

Wow, very impressive! And I liked the camera movement, funky) Please, make an issue about the unprocessed midi messages: what you've expected and what wasn't working.

Comment options

Hi @copych. Not sure if I configured something incorrectly, but in AcidBanger.ino I had to tweak the read_button function. It only seemed to read button 5, and I don't understand why it was like that. I have updated to the code to support all buttons.

Is that a bug or intended?

https://github.com/andyvans/AcidBox/blob/main/AcidBanger.ino#L379

if (true){ //if (button->numb == 5) { // start/stop is a real button "boot" ( GPIO0 )
You must be logged in to vote
2 replies
Comment options

Buttons were disabled intentionally. I was going to change the button reading function with more convenient one. Also I was going to make a midi control for all the things. At that point I recognized that it's time to fully refactor Acidbanger, but have no time and energy for that, as I'm writing a granular sampler for the s3.

Comment options

Fair enough. I have no experience with sound generation as a software dev, which makes this quite fun. I will merge in your changes from 34fdfa7 and see what it changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /