KeppySoftware / KMC

A fully functional MIDI to WAV/OGG converter.
https://www.youtube.com/channel/UCJeqODojIv4TdeHcBfHJRnA
119 stars 21 forks source link

Note count which stored in "signed int" #59

Closed DixelU closed 5 years ago

DixelU commented 5 years ago

Actually that's not a bug, but more like a suggestion. There's some proofs. image image

KaleidonKep99 commented 5 years ago

The note count is stored as an UInt64 in KMC.

DixelU commented 5 years ago

Just read some sources and it really stored in (at least) as Int64. Is it possible that problem is in BASS library itself? btw The issue looks like somewhere in the app "note count" stored in UInt64 suddenly goes through Int32 variable and then gets written back to UInt64 variable for example how it works/looks on C (the result is similar )

unsigned long long int A = 0x88000000; ////A = 2281701376
int B = A; //// B = -2013265920
A = B; //// A = 18446744071696285696
KaleidonKep99 commented 5 years ago

BASS_MIDI_StreamGetEvents returns an UInt32, so that might be the issue. I'll ask Ian Luck if he can make it return an UInt64 instead.

KaleidonKep99 commented 5 years ago

Fixed.