shorepine / amy

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

Moving memorypcm inside AMY #229

Closed bwhitman closed 1 month ago

bwhitman commented 1 month ago

This puts the memorypcm code inside AMY.

You can load samples with AMY's amy.transfer_wav(wav_filename), which works on Tulip and normal Python. It encodes the wav file as base64 chunks and transfers them using a new AMY command z/load_sample.

If you want to use the wire protocol outside of Python, you need to find a base64 encoder and follow what amy.transfer_wav() is doing. It's simple enough that it should work on most other implementations.

If you're linking AMY directly (and not using wire protocol), you can fill in the allocated sample buffer that is returned after calling int16_t * pcm_load(uint16_t patch, uint32_t length, uint32_t samplerate, uint8_t midinote, uint32_t loopstart, uint32_t loopend) yourself.

bwhitman commented 1 month ago

This is now subsumed by #231