RustAudio / rimd

Library for handling Midi and Standard Midi Files in Rust
MIT License
80 stars 17 forks source link

Fix bug in absolute MIDI event writing #21

Closed Ameobea closed 3 years ago

Ameobea commented 3 years ago

Calculating relative vtime when writing AbsoluteEvents had a bug that caused the vtime to be incorrectly incremented. This produced invalid event times in generated MIDI files.

bev.time is an absolute time in this case since it is from AbsoluteEvent, so cur_time should be set to it rather than vtime which can cause it to move backwards invalidly.

Boscop commented 3 years ago

Thanks for the fix :)