1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AUv3 Wrapper: Use correct timestamps for outgoing events

Previously, with two instances of the MIDILogger AUv3 in series in
Logic, the timestamps received by the second plugin in the chain would
not match the timestamps of the events emitted by the first plugin.
This commit is contained in:
reuk 2021-12-30 20:23:27 +00:00
parent f12cac596b
commit 2678c1d10d
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -1607,7 +1607,11 @@ private:
{
if (auto midiOut = midiOutputEventBlock)
for (const auto metadata : midiMessages)
midiOut (metadata.samplePosition, 0, metadata.numBytes, metadata.data);
if (isPositiveAndBelow (metadata.samplePosition, frameCount))
midiOut ((int64_t) metadata.samplePosition + (int64_t) (timestamp->mSampleTime + 0.5),
0,
metadata.numBytes,
metadata.data);
}
#endif
}