-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added RehearsalMark to midi export as Markers #26196
base: master
Are you sure you want to change the base?
Conversation
Regarding the Codestyle check: In installed uncrustify on my windows machine and ran it in git bash. However other than complaining about an outdated configuration it did not throw any erros for the mentioned file.
EDIT: had to install 0.73 of uncrustify via |
The problem is that you need specifically version 0.73 of Uncrustify. (We decided to pin the version at some point, because every Uncrustify update required changes to the code, which was quite inconvenient in combination with the fact that updates are rolled out gradually over GitHub Actions runners, so you never know in advance whether you're going to get a the new or old version.) |
Don't use merge commits, but rebase (and force push): |
f03f165
to
1711ad8
Compare
Sorry, my vscode git integration keeps doing those in the background. I believe I have removed most of the unnecessary merge commits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Only two last minor requests, but apart from that it looks good. Also, after addressing these comments, it would be great if you could squash the commits, so that all changes are in one commit (with an appropriate message of course).
RehearsalMark* r = toRehearsalMark(e); | ||
muse::ByteArray rText = r->plainText().toUtf8(); | ||
size_t len = rText.size() + 1; | ||
unsigned char* data = new unsigned char[len]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Just for the record: beware that there's a data leak here. But you don't need to fix it in this PR, because it's exactly the same for lyrics and port changes.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the problem is tracked elsewhere i'd like to make a note there rather than a code comment now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a tech debt issue about it, so you don't need to do anything with it now. (Update: created #26415)
@@ -24,6 +24,7 @@ | |||
|
|||
#include "engraving/dom/key.h" | |||
#include "engraving/dom/lyrics.h" | |||
#include "engraving/dom/rehearsalmark.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: alphabetical order is preferred :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I can do the squashing while merging the PR, if it turns out to be difficult.
@heavy-matill thanks for this initiative! It's a neat idea to be able to import rehearsal marks as markers to a DAW. I just tried exporting a MIDI file from this PR and importing into Logic Pro, and unfortunately no markers appeared. What DAWs have you tested this in so far? |
Yes please do that. Somehow there is always a merge commit additionally to my squashed commit.
It worked with Cubase 13 and 14 Trial. |
The trick is not to rebase ;-) Use |
Well, not to pull from origin. Only pull from upstream, then do the squashing, then don't pull from origin, but force-push to origin. |
Implemented in the same RepeatSegment loop as lyrics.
c08c71f
to
87f294c
Compare
I've fixed it now; because of the repeated merge commits, it had become a bit difficult to fix the situation if you don't feel comfortable with rebasing. For the future, once more, the general flow is:
And for squashing commits, you just do what you apparently already did, but after that, just force-push ( |
Resolves: Add Marker meta events to MIDI export and Exporting Rehearsal Markers to MIDI files
I want to export Rehearsal Marks to Midi Markers.
![image](https://private-user-images.githubusercontent.com/10145474/405373610-97aa4ee6-c580-4c19-9860-efdc539cdd44.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTA2MzEsIm5iZiI6MTczOTI5MDMzMSwicGF0aCI6Ii8xMDE0NTQ3NC80MDUzNzM2MTAtOTdhYTRlZTYtYzU4MC00YzE5LTk4NjAtZWZkYzUzOWNkZDQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MTIxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg3YjE1NmMzNWEwYWIxMmY3YTU5NjNhMDM3NjNhMGZmMmNmMjM0NTM5ZWVjZDc2MTc0MzkyY2E1NDU2ZDhlNTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JsnJXK-USrBhXBOCQGPmRHDasHqem94WMK2mZ2MKhcI)
I export my sheetmusic as midi into a DAW, where Midi meta events such as Markers are supported.
Usually the sheetmusic contains Rehearsal Marks and I want the same structure to appear in my DAW.
This PR only adds export functionality. Import of Midi Markers to Rehearsal Marks is still missing.
I did not unit test the implementation but it works for the few examples I have on my machine.
I was also able to check it with python: