1
0
Fork 0

Fix examples for out of order events

This would be a host bug, but in theory CLAP hosts could provide out of
order events this way.
This commit is contained in:
Robbert van der Helm 2022-07-14 12:50:16 +02:00
parent 0469bdf806
commit ba7b5a3b32
2 changed files with 2 additions and 2 deletions

View file

@ -199,7 +199,7 @@ impl Plugin for PolyModSynth {
'events: loop { 'events: loop {
match next_event { match next_event {
// If the event happens now, then we'll keep processing events // If the event happens now, then we'll keep processing events
Some(event) if (event.timing() as usize) == block_start => { Some(event) if (event.timing() as usize) <= block_start => {
// This synth doesn't support any of the polyphonic expression events. A // This synth doesn't support any of the polyphonic expression events. A
// real synth plugin however will want to support those. // real synth plugin however will want to support those.
match event { match event {

View file

@ -153,7 +153,7 @@ impl Plugin for Sine {
let sine = if self.params.use_midi.value { let sine = if self.params.use_midi.value {
// Act on the next MIDI event // Act on the next MIDI event
while let Some(event) = next_event { while let Some(event) = next_event {
if event.timing() != sample_id as u32 { if event.timing() > sample_id as u32 {
break; break;
} }