Open
Conversation
a483919 to
445d14e
Compare
compiling takes 30 minutes on this laptop yeeowch
Previously, BitInvader would normalize using the following steps: 1. Whenever the wavetable was changed, it would find the sample with greatest magnitude and record its reciprocal. 2. Whenever a new note was constructed, it would allocate a copy of the wavetable on the heap **during playback!!!**, multiply each sample by the above reciprocal, and then clip it to [-1, 1] for good measure. The new implementation is as follows: 1. Whenever the wavetable is changed, it records double the reciprocal of the difference between the maximum sample and minimum samples. Multiplying the output by this factor ensures that the magnitude of the output is 2 (expected from a wave normalized to [-1, 1]). 2. However, multiplying by that factor magnifies any existing DC offset in the wavetable, so the negative quotient of the sum and difference between the maximum sample and minimum sample is also recorded. Adding this to the output after it is multiplied by the above factor removes any DC offset, ensuring the normalized wave has the exact range of [-1, 1]. This could forseeably break some user projects by removing any intentionally-created DC offset. To that I say, "xkcd 1172".
It was mostly unnecessarily duplicated state. Moving those calculations into BitInvader::playNote() allows them to happen once per buffer rather than once per sample.
Moved it into the constructor, like Nescaline (and sort of Vestige and Organic, though that's in their paint events)
Instead of storing and updating two indicies, now only the real index is stored, since the integer index was dependent on the real index every sample anyways. Now instead of a struct, the note plugin data is just a float through a using type alias.
Changes the normalization toggle to a combo box. The options are: - Off: No normalization. - Full: Normalization is applied such that the resulting waveform has a range of [-1, 1]. - Length only: Same as "Full", but takes into account the current value of the "Length" knob. This is the new default value. - Legacy: Normalization is applied such that the resulting waveform has one or more samples with magnitude 1. This was the previous normalization behavior, and the value with which old presets load with if they had normalization enabled. The combo box is haphazardly placed and lacks a proper label, so the UI looks like trash as a result. This is temporary.
This extends the background art vertically by 30 pixels and does a whole lot of naughty things that I would never do... except I'm about to fix them in another PR lol
3d42879 to
b256067
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Makes several changes to the Bit Invader plugin for increased maintainability and readability, which is especially important since Bit Invader has been used as a starting point for many (including myself) when learning about how LMMS instrument plugins work.
User interface is modified as little as possible in this PR as UI upgrades will be taken care of in #8122.
Performance
struct/classmember layout for better localityFunctionality
Miscellaneous
SIGNALandSLOTmacros to whatever they should be post-Qt6 upgrade