MCUdude / SigmaDSP

A versatile Arduino library for interfacing with the ADAU1401, ADAU1701 and ADAU1702 audio DSPs
GNU Lesser General Public License v3.0
171 stars 36 forks source link

ESP32-C3 #34

Closed Trylan closed 1 year ago

Trylan commented 2 years ago

Hi is this library compatible with an ESP32-C3? Would like to control sigma studio parameters on an ADAU1701 through Bluetooth.

Additionally, does this library support changing FIR filter coefficients? Thanks!

MCUdude commented 2 years ago

It should be! The library is generic and relies only on the Arduino Wire library. There's no platform-specific code in there.

Trylan commented 2 years ago

Great! Thank you for your response. Are there methods for reading and changing FIR filter coefficients?

MCUdude commented 2 years ago

The library doesn't support FIR filter out of the box, but if you either have or can crack the algorithm used by Sigma Studio, it's trivial to interface with any block in the DSP program by utilizing the safeload_write function.

For instance, here's how dynamic bass boost is implemented. I found the algorithm online on a SigmaDSP-related forum I think:

https://github.com/MCUdude/SigmaDSP/blob/3d151affd84172732a1ff82ccf50f4be9280a834/src/SigmaDSP.cpp#L231-L252

safeload_write is a nested, template-based function that can take arguments in 5.23 float or 28.0 int. It's pretty neat!

https://github.com/MCUdude/SigmaDSP/blob/3d151affd84172732a1ff82ccf50f4be9280a834/src/SigmaDSP.h#L149-L155

https://github.com/MCUdude/SigmaDSP/blob/3d151affd84172732a1ff82ccf50f4be9280a834/src/SigmaDSP.h#L180-L193