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.
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
Add MIDI time signatures for "common" and "cut" meterSig #3808
Add MIDI time signatures for "common" and "cut" meterSig #3808
Changes from 1 commit
e237449
4eb936c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think
meter.count
andmeter.unit
would overrule any written symbol, so it should be two simple if clauses.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.
Would you want to have both added to the midi file? If not then the two conditions should be flipped.
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.
You should not have both added, of course. I would say if you have an explicit count and unit, those should be used. If there is no count/unit, then it should be inferred from the symbol, with common-time being 4/4 and cut-time being 2/2.
I am wondering about this duplication:
the total count is the top number, and but this has nothing to do with the bottom number (the unit), so there seems to be an assumption here which is based on "4/4' and "2/2" having the same number on the top and the bottom. But the top is the count and the bottom is the unit.
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.
Yeah, in the same way that, for common/cut sym, meterSig->HasCount() returns false but meterSig->GetTotalCount() stills gives a valid value (4 or 2), we should do the same for unit and return 4 or 2 when HasUnit() is false. But doing it on GetUnit() would look weird from the semantic point of view... maybe GetEffectiveUnit()? Or maybe GetTop()/GetBottom() / GetNum()/GetDem()
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.
You can simply have
And use this.
Don't forget to flip the clauses since the priority should be on explicit
@unit
and@count
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.
Yeah, my point here was to encapsulate the logic resolving common = 4/4 and cut = 2/2 inside the MeterSig class instead of resolving those details at the document level. Also the ternary operator here will add a 2/2 time signature for a MeterSig with "open" sym (or any other further supported symbol we might introduce).
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.
OK. You can add a
MeterSig::GetSymImplicitUnit()
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.
same as above