AudioProcessor::setParameterNotifyingHost threading


#1

Why can’t we set parameters on threads different then the MessageThread (i do that from the MIDI Input thread for example). I had no problems so far. Do i need to change this ?

void AudioProcessor::setParameterNotifyingHost (const int parameterIndex,
                                                 const float newValue)
 {
+    jassert (MessageManager::getInstance()->isThisTheMessageThread());
+
     setParameter (parameterIndex, newValue);
     sendParamChangeMessageToListeners (parameterIndex, newValue);
 } 

#2

I think it was because of this:
http://rawmaterialsoftware.com/viewtopic.php?f=8&t=11624


#3

Does this mean that when the host calls setParametef on my AudioProcessor, i’m sure it will be on the MessageThread ?

I always thought that parameter changes happened on the audio thread.


#4

I think i answered that question myself by reading some forums (for example the reaper forum http://forum.cockos.com/showthread.php?t=60633).

It looks like setParameter can be called from a different thread, both different then the Audio and the Message thread, shouldn’t there be an assertion in that too ? If we want to be consistent about
threads. I can imagine the same thing applies to parameter names and value formatting.