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)
|
||||
return false;
|
||||
|
||||
bool hasNoteOn = true;
|
||||
bool hasNoteOn = false;
|
||||
bool needsChange = false;
|
||||
foreach(event; events) {
|
||||
if(hasNoteOn)
|
||||
if(hasNoteOn) {
|
||||
if(event.isNoteOff) {
|
||||
needsChange = true;
|
||||
break;
|
||||
}
|
||||
else if(event.isNoteOn)
|
||||
} else if(event.isNoteOn) {
|
||||
hasNoteOn = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!needsChange)
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue