Brand new here, I happily own a patch.init(). I manage to easily flash Pd patch to it…but with the limitations of hvcc.
My C is far, and C++ not yet really my cup of tea. I am looking for an example on how to play a single sample wavetable aka wavetable (I suppose it is like in Pd with a phasor and like in Bela C++ tuto) with Daisy.
thank you all from your quick replies. The main trouble with hvcc is that it does not implement any mechanism to load a file from disk (or SD card). You have save your patch with the wave table in it on your pc and flash it to daisy…doable but quite tedious.
Still many vanilla Pd objects are not implemented in hvcc and obviously, will never be. … which is very sad as the number of embedded audio platforms is increasing and these platforms would really gain from having a fully implemented Pd.
Maybe someone will port libpd to daisy one days? ( or maybe the technical problems are too many)
Hello, @JMC64! It’s great to discover that we share an interest in this topic. I believe you can read samples from an array in a similar manner to how it’s done in Pure Data (PD).
Below is a simple code snippet example of how you can use a phasor to read samples from an array at a specific frequency. (I recommend delving into the documentation for more details, including the initialization of the phasor in the main() function and so on.)
const int size = 10463;
void AudioCallback(AudioHandle::InputBuffer in,
for(size_t i = 0; i < size; i++)
float sig = sample[(uint32_t)(phs.Process() * 10463)];
out[i] = out[i] = sig;
However, please note that when using flash memory, you may be limited in terms of sample size. To handle larger samples, consider using an SD Card with the libdaisy abstractions library. If you intend to use your tables as oscillators, somewhat like tabosc4~ in PD, you can use SDRAM to store your tables. It’s also possible to use SDRAM for sample storage, but I’ve noticed that it significantly increases build times. I haven’t been able to figure out how to implement a file system in SDRAM.
There are some excellent resources available on working with memory and wavetables for the Daisy Seed platform, such as:
If you have any further questions or need more information, please feel free to ask!
This will never be possible, there are many objects that don’t make any sense in an embedded context. While it is true that Miller has ported pd engine to run on a microcontroller (an ESP32) this is a highly specific and optimized build for his specific experimental application. And would not give any generic type of setup to use pd (it likely supports even less objects).
Eventually we do want to be able to load samples from sd-card, but this will need quite some work on different parts of the code (help is appreciated!).
Thank you a lot @viniciusfersil and @dreamer for your comments and guidance. I join a screenshot of the Pd patch that I am using now (I wish I could upload the patch on the forum, someone might wish to use/ improve it). It is not perfect but …it works. You can “morph” from one table to another one