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.
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 commandz/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.