-
Notifications
You must be signed in to change notification settings - Fork 21
Mustang I V2 effects #37
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
base: master
Are you sure you want to change the base?
Conversation
…ackbox, Big Fuzz, Wah Modulation, Touch Wah Modulation, Diatonic Pitch Shifter).
include/com/IdLookup.h
Outdated
|
|
||
|
|
||
| constexpr effects lookupEffectById(std::uint8_t id) | ||
| constexpr effects lookupEffectById(std::uint8_t id, std::uint8_t idmsb=0) |
Check warning
Code scanning / CodeQL
Poorly documented large function Warning
|
I realized I forgot to implement and run tests. I will implement them and update the PR. |
|
Tests and formatting corrected. This PR is now ready for review. |
|
|
||
|
|
||
| constexpr effects lookupEffectById(std::uint8_t id) | ||
| constexpr effects lookupEffectById(std::uint8_t id, std::uint8_t idmsb = 0) |
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.
We should consider expanding the id type to uint16_t instead. Since it's 0 for other devices, this should be safe.
|
Nice, thank you! 👍 |
Hello,
this PR adds support for the missing Mustang I V2 effects (Ranger Boost, Greenbox, Orangebox, Blackbox, Big fuzz) and modulations (Wah, Touch Wah, Diatonic Pitch Shifter). The support includes default effect and effect windows.
Main change of this commit is in the ID of individual effects. It seems that they are in fact 16-bit wide, instead of current 8-bit width. This mainly influenced the function
lookupEffectById, where I added second parameteruint8_t idmsbwith implicit value of0.The newly added effects are currently appended to the bottom of the combobox list in the effect window, as their position must correspond with their value in the
effectsenum.Additionally I've noticed there is a lot of duplicate code, especially in default effects and effects windows regarding knob labels. I know there might be a good reason for it, such as proper shortcut function, however, I think that by doing this line-efficiently would benefit legibility of the code and make editing it easier.
One solution I come up with and implemented for the new effects utilizes maps to store knob description for given knob like so
and sets for an effect
Alternatively, creating a class for each effect (deriving from effect base class), which would define its labels, is also an option.
Please, let me know if you do or don't agree with the map approach and or anything in this PR and what should be changed. I will gladly make the necessary edits.
Best regards
Joe