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
Implement Note Types #5902
Implement Note Types #5902
Changes from 20 commits
b205222
cfb533a
a5cf05d
df88140
7a5ad82
725169a
faa5209
9decf11
3576300
f5cc889
1df46a5
db0d0b7
6b3c75e
4b69615
89a62f6
b3511c2
dbefa9c
463050a
0054ece
fe42e97
38dd8ec
31a2bd3
43018d7
389a245
dcb41af
2ecadb0
67b0b24
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.
Looks like there are a few places where the default step note length of 16 is hard-coded in. You should probably create a constexpr constant for it and use that instead.
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 just followed the example of the other variables, that value is more like a default in case there's no stored value on the XML. Should I change it to be
constexpr int base_beatLen = 16;
here and in the other method?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.
No, I meant if you want the default step note length to be a 1/16th note, you shouldn't have "16" hard-coded in 3 or 4 different places. You should probably use a static constexpr member in the
Note
class calledDefaultStepNoteLength
or something like that:Then replace every "16" which you're using to represent the default length of step notes with
Note::DefaultStepNoteLength
.The point of this is to avoid magic numbers and have the default step note length defined in a single place so it's easy to change later if we ever decide to do that.
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.
Oh, got it! I wrote the changes here, I'm just double checking because I think
base_beatLen
is actually not related to the default step note length of 1/16th (the one that shows on the piano roll):I think I'd need another constexpr for the beatLen fallback value. Should I have it on "InstrumentTrack.h"?