Yikai-Liao / symusic

A cross platform note level midi decoding library with lightening speed, based on minimidi.
https://yikai-liao.github.io/symusic/
MIT License
108 stars 8 forks source link

Tempo value mismatch #9

Closed Natooz closed 6 months ago

Natooz commented 6 months ago

Following #6, there is a float conversion somewhere that can slightly alter the Tempo.tempo values, causing the tests (__eq__) to fail.

Yikai-Liao commented 6 months ago

One possible solution is to store the origin value(int) in Midi tempo event, and make bpm (float) a property that is calculated at the time of the call.

Natooz commented 6 months ago

It could be solve the issue indeed! Maybe a good solution would be to keep the original int value private, and subclass __eq__ to only check it and .time, and omitting .tempo?

Yikai-Liao commented 6 months ago

yes, that's it