shorepine / amy

AMY - A high-performance fixed-point Music synthesizer librarY for microcontrollers
https://shorepine.github.io/amy/
MIT License
208 stars 11 forks source link

Arduino library for AMY #15

Closed bwhitman closed 10 months ago

fazerlab commented 1 year ago

Great projet!! i will appreciate a component to develop in Arduino IDE, alles too. Thank you Marco

bwhitman commented 1 year ago

Yes, this is a great thing to do. I am not too familiar with how to build an Arduino library. AMY is pretty standard C and should "just work" packaged up as one, but I assume someone needs to make a C++ .h interface for it? Sounds like something @dpwe would know about

dpwe commented 1 year ago

It’s something I know something about. I’ll take a look.

On Wed, Feb 15, 2023 at 07:21 Brian Whitman @.***> wrote:

Yes, this is a great thing to do. I am not too familiar with how to build an Arduino library. AMY is pretty standard C and should "just work" packaged up as one, but I assume someone needs to make a C++ .h interface for it? Sounds like something @dpwe https://github.com/dpwe would know about

— Reply to this email directly, view it on GitHub https://github.com/bwhitman/amy/issues/15#issuecomment-1431284993, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGZUIV6GUBZNFGSJ2OOG3WXTC5DANCNFSM6AAAAAAQSB6H6U . You are receiving this because you were mentioned.Message ID: @.***>

bwhitman commented 10 months ago

I'm working on this now in the arduino branch, will update the status here as I go.

bwhitman commented 10 months ago

So far this library "works" for esp32 and rp2040, in that it can be imported into the Arduino IDE as a library, it compiles with a sketch and you can call

AMY amy;
amy.begin();
long now = amy.sysclock();
amy.drums(now);

The details are the harder parts: we should support:

bwhitman commented 10 months ago

One weirdness is we can't seem to support multicore rendering on the rp2040 in Arduino natively. It works fine in C, but using the Arduino board support by Earle F P III, the message passing between cores does not work. Worth more investigation, but for now I can leave AMY_CORES to 1 for the RP2040.

znmeb commented 10 months ago
* [ ]  Test on lots of boards: esp32, esp32-cX, esp32-sX, rp2040, teensy, STMF32, cortex m0s, etc etc

Electro-Smith Daisy? I've got a few of them lying about and they have an Arduino interface.

bwhitman commented 10 months ago

A first version of this is committed to main! If you have a Pi Pico or an ESP32 with any i2s DAC, please give it a go and let us know how it works. We provide an example .ino for it so you can see how to use it. Some things still left to do so I'll keep this open until then.

bwhitman commented 10 months ago

I've tested on the Teensys (4.1 and 3.6) -- 3.2 has some issue with the queue support in their i2s library, but maybe someone can get it to work if people care about that one.

I think for now we'll only support the mode of "AMY generates sample buffers, you do what you want with them" and it's foolish for me to anticipate every I2S / DAC / PWM setup across all these boards. Happy to have my mind changed!

amy_config has #ifdefs for a lot of the board setups I've tried. One big chonker is fm.h -- we may want to eventually create a fm_small.h that has only 64 patches or something.

I think we're good for now on this. I'll field issues with Arduino things as they come in.