Closed mrSilkie closed 4 years ago
You can pass the drumtest
object as a parameter at task creation time (xTaskCreatePinnedToCore
) to be received in the pvParameters
, and declare drumtest drum(48000,8);
as global.
So something like:
xTaskCreatePinnedToCore(myUART, "uart", 3000, (void*)&drum, 10, NULL, 0);
and in void myUART(void* pvParameters)
drumtest* obj = (drumtest*)pvParameters;
then you can do obj->setParamValue("gate",0);
in the task.
Hey there Steph.
Thanks for your reply, I got my code working with that little snippet you shared. Unfortunately, I don't think I have the resources available to run another task as Faust seems to crash with just a single oscillator. Instead I found embedding the UART / Button code inside a loop within the main function to work.
" Faust seems to crash with just a single oscillator. " this is probably something else happening, we now for sure that more complex Faust DSP can run on the esp32.
Hi there. I've had the lyrat for less than a week but I've managed to get some beeps n boops out of it using faust. Just to preface, this is essentially my introduction into embedded systems. I haven't programmed outside of arduino before and the work i've done within arduino has been relatively simple. I'm still wrapping my head around the task concepts and also working with faust
The big issue I have atm is that if I declare FaustDSP faust(SR,BS); in main() or even, outside, as a global 'variable' ( I think it's a class but I'm not sure how to reference a c++ class in c). None of my functions have access. The only solution I have that's worked is to have a task, faustTask that contains faust.start(). It worked by receiving inputs via xQueueReceive and the latency was high. This makes it rather impracticable to actually interact with the DSP as if i wanted to have an accelerometer controller, it would have to embedded into my faustTask. Also, since faust.start starts its own task, the stack size of faustTask has been 'experimentally' shown to impact the reliability of faust.
I've commented where faust is in scope / out of scope. I've set faust to run on cpu 1, therefore myUART task runs on cpu 0. This actually fixed some bugs for me. myUART is a ghetto midi function since I'm using an arduino as a midi controller and this way I've been able to hone in on what I'm sending and receiving. I've actually got the UART part working pretty well and am almost finished with my 50+ hour project. The final piece that I am stuck on is simply getting fuast in to scope across all my tasks. I'd love to break my tasks down / include more but without a means providing scope this isn't possible. I have got myUART to interface with faust by embedding faust into a myFaust task and using xQueue to transmit commands between. This method worked but I was met with constant crashing and high input latency.
I'm not the best at coding and am still learning so would also love some feedback / a potential fix to my scope issue.