mirror of https://github.com/adamdruppe/arsd.git
confusingly written code golly
This commit is contained in:
parent
e5429c0dbf
commit
7ae8dc137f
7
midi.d
7
midi.d
|
|
@ -342,17 +342,18 @@ struct FlattenedTrackStream {
|
||||||
if(events.length <= 1)
|
if(events.length <= 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool hasNoteOn = true;
|
bool hasNoteOn = false;
|
||||||
bool needsChange = false;
|
bool needsChange = false;
|
||||||
foreach(event; events) {
|
foreach(event; events) {
|
||||||
if(hasNoteOn)
|
if(hasNoteOn) {
|
||||||
if(event.isNoteOff) {
|
if(event.isNoteOff) {
|
||||||
needsChange = true;
|
needsChange = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if(event.isNoteOn)
|
} else if(event.isNoteOn) {
|
||||||
hasNoteOn = true;
|
hasNoteOn = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!needsChange)
|
if(!needsChange)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue