Bake window derives itself: %-knob fold, declick pad, Gate held to exhaustion, preview velocity; Hold is the one knob a loop needs
This commit is contained in:
@@ -81,6 +81,17 @@ inline double filterNormPerOctave() {
|
||||
inline constexpr double kDeclickDecay = 0.95; // per-frame decay of the compensation
|
||||
inline constexpr double kDeclickFloor = 1e-4; // below this the ramp is done (~ -80 dB)
|
||||
|
||||
// How many frames the ramp emits before the weight drops under the floor. Counted the way
|
||||
// advanceFrame runs it — emit, decay, test — rather than solved in closed form, so the two
|
||||
// can never disagree. RATE-INDEPENDENT: the decay is per frame, not per second, so an offline
|
||||
// pass at any rate pads by the same count.
|
||||
inline constexpr std::int64_t declickRampFrames() {
|
||||
std::int64_t n = 0;
|
||||
for (double w = 1.0; w >= kDeclickFloor; w *= kDeclickDecay) ++n;
|
||||
return n;
|
||||
}
|
||||
inline constexpr std::int64_t kDeclickFrames = declickRampFrames();
|
||||
|
||||
// A single voice: one active note playing the loaded capture, repitched and enveloped.
|
||||
// Reads the sample by fractional frame position with linear interpolation, advancing by the
|
||||
// pitch ratio; loops the sustain region for held notes past the loop end.
|
||||
|
||||
Reference in New Issue
Block a user