Hi,
I’ve got a nice working guitar synth out on ios now, PD Space Guitar Synthesizer.
There is one bug that has me scratching my head a bit:
For my midi remote control, I set a valuetreestate item from the audiothread, with the value from incoming midi CC. The attached slider then shows the incoming midi CC value.
auto myVal = state.getParameterAsValue("remote_pitch"); // get my param ref
var newVal = ccV ; // get my midid pedal into a var
myVal.setValue(newVal); // set the param to my pedal, slider is attadched to this.
Now this creates sporadic crashes, I bypassed this param update, and the crashes are gone.
My question (before I create an unnecesairyworkaround) is:
is there a standard mechanism to ensure safe param updates from the audiothread?
Thanks in advance!
Paul
MessageManager::callAsync Comes to mind, although I’m not certain if it is appropriate from process block. Worth looking into!
1 Like
i would avoid using var and string lookups and stuff and directly work with the parameter. that makes it easier to eliminate potential causes of the problem.
i personally send the parameter value change with all its gestures when a cc value occurs. so:
beginGesture > setValueNotifyingHost > endGesture.
seems to work so far, but there’s a lock somewhere in these methods so idk if it’s clean enough
1 Like
thanks for your feedbacks!
I think 'll just do a simple custom scheme, where I use a none-slider display, just a VU meter, that way there is no conflict possible, since there will be no attachment. I update my VU’s on a slow timer.
This way I’ll never have locks, and that simply will sound the best, so that is the best solution.
1 Like