Fixed the ignoration of tempo information in original MXL file #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greetings, Blob Opera is amazing and I really appreciate this cool project!
However, I experienced similar issue with #10 that the tempo is not right. And I think I find out why.
Reason for the BUG
First, in
blobopera/recording.py
, thePart.from_part
method, 314-316 lines (in your original commit):I've checked that the
quaterLength
andoffset
field are measured in quarter numbers, rather than real time (second). This means that with a tempo of "Quarter = 80", 4 quarters should be 3 seconds but the offset is still 4. However, it seems that the offset is directly used to generate the result. This means that the result tempo is fixed at 60. In my case it's even worse since the tempo is changing in the middle of the song :)This may explain issue #10, since the tempo of the score therein is about 116, so the speed is about halfed.
Then, in
blobopera/recording.py
, thePart.from_part
method, 248-252 lines:This is used to iterate over all note/rest event in a music21 part and discard others. However, the tempo event is discarded as well.
My work to DEBUG & works TODO
The two classes I added is just used to conveniently store the information of tempo. Since these classes are not used in protocols with the server, they don't extend from
proto.Message
class.However, I only edited the
import
part of this code, so theexport
part will also lack the tempo information. This is future work to do, but for purpose of using it to generate Blob Opera videos, it's enough.