-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Articulation tweaks #13522
Articulation tweaks #13522
Conversation
0f3fc8c
to
d359e90
Compare
bool _isDouble = false; | ||
bool _isTenuto = false; | ||
bool _isStaccato = false; | ||
bool _isAccent = false; | ||
bool _isMarcato = false; | ||
bool _isLuteFingering = false; |
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.
To reduce memory usage, you could store these using a single field of flags. But I'd first ask @vpereverzev if he thinks that's better.
Anyway, to do that, you would create an enum like this:
enum class ArticulationCategory: char { // char makes sure that this will use only 1 byte,
// which consists of 8 bits,
// which is enough to store these 6 flags
None = 0x00
Double = 0x01
Tenuto = 0x02
Staccato = 0x04
Accent = 0x08
Marcato = 0x10
LuteFingering = 0x20
}
Then create a Flags from that enum: (you need to #include "flags.h"
for this)
DECLARE_FLAGS(ArticulationCategories, ArticulationCategory)
DECLARE_OPERATORS_FOR_FLAGS(ArticulationCategories)
Then replace all these members with:
bool _isDouble = false; | |
bool _isTenuto = false; | |
bool _isStaccato = false; | |
bool _isAccent = false; | |
bool _isMarcato = false; | |
bool _isLuteFingering = false; | |
ArticulationCategories m_categories = ArticulationCategory::None; |
Then replace the is...
methods with:
bool isDouble() const { return m_categories & ArticulationCategory::Double; }
etc.
Then modify computeCategories
like this:
m_categories.setFlag(ArticulationCategory::Double,
_symId == SymId::articMarcatoStaccatoAbove || _symId == SymId::articMarcatoStaccatoBelow
|| _symId == SymId::articTenutoStaccatoAbove || …)
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'll try!
98a914a
to
233e277
Compare
5e8bdc7
to
f197ae4
Compare
bool isStaccato() const { return m_categories & ArticulationCategory::STACCATO; } | ||
bool isAccent() const { return m_categories & ArticulationCategory::ACCENT; } | ||
bool isMarcato() const { return m_categories & ArticulationCategory::MARCATO; } | ||
bool isLuteFingering() { return m_categories & ArticulationCategory::LUTE_FINGERING; } |
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.
const
got lost here :)
correction correction cleanup cleanup cleanup
correction efficiency correction
added vtest vtest corr
f197ae4
to
cd8a6c4
Compare
Three separate jobs:
Before:
After: