-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Internal changes for the modulations and processing #142
Conversation
Ok it should be in good shape now. The idiom for modifiers and CCs is as follows: for (const auto& mod : modifierSource) {
const auto events = midiState.getCCEvents(mod.cc);
multiplicativeEnvelope(events, modifiedCCSpan, [&](float normalizedCCValue) { return func(normalizedCCValue); });
// Use the span, for example applyGain<float>(modifiedCCSpan, modulationSpan);
} You can see in ddeecf4 how it's used e.g. for the new support of |
Side note: |
So given also the conversation on #48, for now the envelopes are computed for each modulation target and the "base" envelope is not memoized anywhere. The memoization could come later, but I expected the gains to be quite marginal. My reasoning is as follows:
Also note that we're talking sub-µs for all of these in reasonable block sizes. The machine I have now has In the end, I chose to forgo memoization for now since it would complicate the logic a bit for marginal gains in performance. If this is a problem down the line it won't be too hard to change: we can store the pre-computed envelopes in the MidiState and replace for (const auto& mod : modifierSource) {
const auto events = midiState.getCCEvents(mod.cc);
multiplicativeEnvelope(events, modifiedCCSpan, [&](float normalizedCCValue) { return func(normalizedCCValue, mod.value); });
// Use the span, for example applyGain<float>(modifiedCCSpan, modulationSpan);
} by something along the lines of for (const auto& mod : modifierSource) {
midiState.getCCEenvelope(mod.cc, modifiedCCSpan);
applyModifier(modifiedCCSpan, [&](float normalizedCCValue) { return func(normalizedCCValue, mod.value); });
// Use the span, for example applyGain<float>(modifiedCCSpan, modulationSpan);
} |
To give perspective too, there are 5 modifier targets with linear-type behavior and 2 modifier targets with multiplication-type behavior now. |
Added a new Container Clip clip type that can contain other audio/MIDI clips and play them back in a looped/repeated style
List of the changes:
advanceTime(numSamples)
at each callback.polyphony
andnote_polyphony
support, as well asnote_selfmask
support.pan
,amplitude
,width
,position
rather than one.EventEnvelopes
; they're replaced by generic free functions that take as input anEventVector
from the midi state; old tests migrated.tune_cc
andpitch_cc
related opcodes.BufferPool
that distributes buffers around, and can track the maximum buffer usage in debug mode. The number of concurrent buffers are set at compile-time, so it must be adapted to the current processing needs.