Files
reasampler/src/core/instrument/ui/bake_hold.h
T
daniel 65f6070348 Bake window: derived note lengths carry exact durations, not ladder rungs — a long take is no longer cut at 384 beats
Hold keeps its picker. Also: one home for the %-fold, duration-ordered Hold travel, and a corrupt tail degrades to absent rather than fabricating one.
2026-08-01 21:10:38 -04:00

21 lines
936 B
C++

#pragma once
// bake_hold — how one radial knob addresses the note-length ladder: the Hold control's
// normalized [0,1] position mapped onto a Division and back. The ladder itself is
// musical_division's; only the knob's travel ORDER is decided here.
#include "core/instrument/note/musical_division.h"
namespace reasampler::instrument::ui {
// [0,1] across the ladder ordered by LENGTH, shortest first — NOT the ladder's picker order,
// which is presentation order and would shorten the note at every rung boundary. Out-of-range
// or non-finite input clamps to an end rather than wrapping — a knob cannot express anything
// else.
note::Division bakeHoldFromNorm(double norm);
// The inverse: the position that reproduces `hold` exactly, so a knob painted from a stored
// value and then released without moving cannot shift it a rung.
double bakeHoldNorm(note::Division hold);
} // namespace reasampler::instrument::ui