-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement Note Types #5902
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
Merged
Merged
Implement Note Types #5902
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b205222
Initial Commit
IanCaio cfb533a
Update Pattern.cpp to account for the Note::Type
IanCaio a5cf05d
Update PatternView::paintEvent to draw step notes
IanCaio df88140
Implements StepNotes setting a NPH with 0 frames
IanCaio 7a5ad82
Improves PatternView::paintEvent conditional
IanCaio 725169a
Adds upgrade method for backwards compatibility
IanCaio faa5209
Addresses Veratil's review
IanCaio 9decf11
Uses ternary expression on statement
IanCaio 3576300
Merge branch 'master' into feature/BBNotes
IanCaio f5cc889
Merge branch 'master' into feature/BBNotes
IanCaio 1df46a5
Merge branch 'master' into feature/BBNotes
IanCaio db0d0b7
Addresses PR review (sakertooth)
IanCaio 6b3c75e
Finished changes from review (sakertooth)
IanCaio 4b69615
Uses std::find_if to save codelines
IanCaio 89a62f6
Addresses review from sakertooth
IanCaio b3511c2
Addresses DomClark's review
IanCaio dbefa9c
Updates MidiExport to use Note Types
IanCaio 463050a
Merge branch 'master' into feature/BBNotes
IanCaio 0054ece
Fixes ambiguity on enum usage
IanCaio fe42e97
Merge branch 'master' into feature/BBNotes
IanCaio 38dd8ec
Addresses new code reviews
IanCaio 31a2bd3
Fixes note drawing on Song Editor
IanCaio 43018d7
Adds cassert header to TimePos.cpp
IanCaio 389a245
Apply suggestions from code review
IanCaio dcb41af
Reverts some changes on MidiExport
IanCaio 2ecadb0
Merge remote-tracking branch 'upstream/master' into feature/BBNotes
IanCaio 67b0b24
Fix the order of included files
IanCaio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Updates MidiExport to use Note Types
- Now MidiExport is updated to use note types instead of relying on negative length notes. - For that change it was necessary to find a way of letting MidiExport know how long step notes should be. The solution found was to add an attribute to the Instrument XML called "beatlen", which would hold the number of frames of the instrument's beat. That would be converted to ticks, so we could calculate how long the MIDI notes would have to be to play the whole step note. If the attribute was not found, the default value of 16 ticks would be used as a length of step notes, as a fallback.
- Loading branch information
commit dbefa9c0f3e731985fc98e2a82ff35efeb34dad3
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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
Noteclass calledDefaultStepNoteLengthor 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_beatLenis 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"?