Skip to content

Commit 770b1fa

Browse files
author
melodieborel
committed
Fix for PSTH calculation at rising TTL edges only
Input TTLs genrate Events at their rising and falling edges which caused the PSTH to be wrong.
1 parent 77dbd04 commit 770b1fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Source/Plugins/EvntTrigAvg/EvntTrigAvg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void EvntTrigAvg::handleEvent(const EventChannel* eventInfo, const MidiMessage&
182182
else if (eventInfo->getChannelType() == EventChannel::TTL && eventInfo == eventChannelArray[triggerEvent])
183183
{// if TTL from right channel
184184
TTLEventPtr ttl = TTLEvent::deserializeFromMessage(event, eventInfo);
185-
if (ttl->getChannel() == triggerChannel)
185+
if (ttl->getChannel() == triggerChannel && ttl->getState())
186186
ttlTimestampBuffer.push_back(Event::getTimestamp(event)); // add timestamp of TTL to buffer
187187
}
188188
}

0 commit comments

Comments
 (0)