diff --git a/Source/Plugins/EvntTrigAvg/EvntTrigAvg.cpp b/Source/Plugins/EvntTrigAvg/EvntTrigAvg.cpp index 27baa4cd0..2d3a3d61e 100644 --- a/Source/Plugins/EvntTrigAvg/EvntTrigAvg.cpp +++ b/Source/Plugins/EvntTrigAvg/EvntTrigAvg.cpp @@ -182,7 +182,7 @@ void EvntTrigAvg::handleEvent(const EventChannel* eventInfo, const MidiMessage& else if (eventInfo->getChannelType() == EventChannel::TTL && eventInfo == eventChannelArray[triggerEvent]) {// if TTL from right channel TTLEventPtr ttl = TTLEvent::deserializeFromMessage(event, eventInfo); - if (ttl->getChannel() == triggerChannel) + if (ttl->getChannel() == triggerChannel && ttl->getState()) ttlTimestampBuffer.push_back(Event::getTimestamp(event)); // add timestamp of TTL to buffer } } @@ -290,7 +290,7 @@ AudioProcessorEditor* EvntTrigAvg::createEditor() float EvntTrigAvg::getSampleRate() { - return juce::AudioProcessor::getSampleRate(); + return CoreServices::getGlobalSampleRate(); } int EvntTrigAvg::getLastTTLCalculated() diff --git a/Source/Plugins/EvntTrigAvg/EvntTrigAvgCanvas.cpp b/Source/Plugins/EvntTrigAvg/EvntTrigAvgCanvas.cpp index 16833dafa..f57d1bd43 100644 --- a/Source/Plugins/EvntTrigAvg/EvntTrigAvgCanvas.cpp +++ b/Source/Plugins/EvntTrigAvg/EvntTrigAvgCanvas.cpp @@ -234,10 +234,10 @@ void EvntTrigAvgDisplay::paint(Graphics &g) GraphUnit* graph; ScopedLock myScopedLock(*processor->getMutex()); if(histoData[i][1]==0){ // if sortedId == 0 - graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0]+sizeof(channelColours))%(sizeof(channelColours))],labels[histoData[i][0]],&minMaxMean[i][2],&histoData[i][2]); // pass &histoData[i][2] instead of 3 to pass on how many bins are used + graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0])%16],labels[histoData[i][0]],&minMaxMean[i][2],&histoData[i][2]); // pass &histoData[i][2] instead of 3 to pass on how many bins are used } else{ - graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0]+sizeof(channelColours))%(sizeof(channelColours))],"ID "+String(histoData[i][1]),&minMaxMean[i][2],&histoData[i][2]); + graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0])%16],"ID "+String(histoData[i][1]),&minMaxMean[i][2],&histoData[i][2]); } graphs.push_back(graph); graph->setBounds(0, 40*(graphCount), width-20, 40);