Embed C++ exported gen code into micro-controller

tsambou's icon

Hi! I was wondering whether it would be possible to export a gen~ patcher to C++ and then embed the C++ code into a micro controller like arduino. From reading around the forums here and in the arduino website, what I understand is that something like this should be possible (since gen~ can export to C++ and since C++ can run on an arduino). The only thing I guess should be done is find in the code where the inlets outlets and params from the max work connect to the gen patch and "connect" an arduino programmed hardware into these inlets ... so for example a bang/click~ combo in max entering the gen patcher could be assigned to a button that gives instant 1 when pressed. I am just posting this to make sure that such a thing is possible, because even though from my findings I understand it should be, I still am not completely sure that is the case. I would like to make a controller that I can use with an arduino and an external sound card without the need of power supply, just with a battery. Do you think that's possible??

Thanks in advance!

tsambou's icon

After alot of searching around the web yesterday, I understood that probably the best platform that can handle sound is one called "Bela". There is also special libraries to export the gen code to C++ specifically for that hardware (if I understand correctly). I was wondering if such a device is able to handle a patch that performs live looping. I want to have multiple loops (in data buffers) that can be controlled separately, each one of which will have its own effects such as delay, reverb, eq's etc etc. Will a Bela platform be able to handle all these data, without the use of any computer or power supply, just working with a battery? I really need to clarify this in order to proceed my project: for me atm everything revolves around an answer to this question!

thanks

AxiomCrux's icon

Check out the OWL also, they have open source STM32 microcontroller hardware that can run GEN patches. Bela is based on the beaglebone linux system on a chip so its more of a full featured computer.

AxiomCrux's icon

also, not really gen related but FAUST and VULT are two low level DSP programming languages that convert to C++ source and are easy to work with, and VULT has teensy arduino support.

I had asked a similar question a few years ago, to see if anyone had run GEN on a micro, but I don't think I ever got a reply.

tsambou's icon

Sorry for the late reply (2 years later ...)

I have finally managed to communicate Bela Platform with gen_exported code.

If anyone gets his hands on a Bela and is actually interested in such a project, this topic in the Bela forums would be of great help.

https://forum.bela.io/d/589-loading-a-gen-exported-c-file-into-bela/53

Happy patching :)

Iain Duncan's icon

Nice, I'd love to hear more about how you make out on Bela. Daisy is another platform that looks interesting.

Graham Wakefield's icon

I've been working on a platform for gen~ -> Daisy support; it's taking longer to make public because a) I have a full time job as a prof and b) the platform is evolving, but hope to get something out very soon.

Iain Duncan's icon

Hi Graham, that sounds awesome. Is there somewhere we can sign up for news? ie release mailing list or github repo to watch or anything? I'm interested!