Skip to content

Conversation

@rubiefawn
Copy link
Contributor

@rubiefawn rubiefawn commented Nov 13, 2025

Makes the following changes to the Lb302 plugin for increased maintainability and readability:

  • Use non-static data member initializers where possible
  • Use std::numbers::pi instead of M_PI
  • Use std::array and std::unique_ptr instead of manual memory management
  • Change plain-old-data classes with only public members to structs
  • Change some ints to f_cnt_t, fpp_t, etc. to better communicate their purpose and avoid weird implicit casting nonsense
  • Change floats to sample_t where appropriate to better communicate their purpose
  • Find suitable homes for loose constants
  • Prefix standard library math function calls with std::
  • Ensure all floating-point literals intended to be floats end in f and are not doubles to appease MSVC
  • Change uses of SIGNAL and SLOT macros to whatever they should be post-Qt6 upgrade
  • Remove cursed mutex in favor of a real-time safe queue (TODO: possible generalization for Monophonic mode on instrument plugins; portamento #6516?)
  • Optimize struct/class member layout for better locality
  • Completely conform to current code conventions

The above list is not comprehensive and is destined to expand.

Makes the following changes to the Lb302 plugin:
- Use non-static data member initializers where possible
- Find suitable homes for several loose constants
- Use std::numbers::pi instead of M_PI
- Use std::array and std::unique_ptr instead of manual memory management
- Change some plain-old-data classes with only public members to structs
- Change some ints to more descriptive types such as f_cnt_t, fpp_t, etc
- Attempt to conform any lines I touched to current code conventions
@rubiefawn rubiefawn self-assigned this Nov 13, 2025
This should be the last of the functions from `<cmath>`
Begone, SIGNAL() SLOT() macro magic!!
...and move them to be inside the classes that own them
- Remove Lb302Note as it is just function parameters with extra steps
- Clean up Lb302Synth::initNote()
- Clean up Lb302Synth::process()
- Move the GET_INC() helper to an anon namespace, rename to phaseInc()
- Make computeDecayFactor() a lambda next to its only callsite
To avoid implicit casts, it's all supposed to be floats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant