#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
