pub fn finish(input: &FinishInput<'_>) -> FinalNotesExpand description
Rewrites the note list with the layer report.
The steps run in this order:
- Each pitch drop merges the notes that start from
DROP_SLACKbefore its onset until it settles, touch each other and lie on keys fromf_endto its start pitch, into one note at the key off_end. - A note that a vibrato covers for more than half its length takes the key of the vibrato’s mean pitch, when that lies within a semitone.
- On a polyphonic line a note ends at its pad end where it has one.
Otherwise it ends at its knee, else
NO_KNEE_CUTbefore its end in the list. No note ends after its end in the list. A cut never makes a note shorter thanmin_note_length; a note the list gives shorter keeps its length. - Times become ticks with
round(seconds * BPM / 60 * 480), and each note lasts at least one tick. A note without a level reads it over this written span, which on a mono line stops at the next later onset. - In a mono line, of the notes that start on one tick only one stays: a note without the transcriber’s octave flag before one with it, then the longer, then the lower key.
- In a mono line, a glide joins the pair of neighbours whose interval
lies within a semitone of its own and whose later onset lies within
GLIDE_SLACKof its motion, the nearest to its start. The later note starts at the glide’s start, or at its own onset when the glide starts after it, and the earlier one endsGLIDE_OVERLAPafter that start, rounded up to whole ticks, whatever its knee says. Every other note of a mono line ends no later than the next note starts. - With level velocity, the loudest note gets 127 and a note
ddB under itround(127 * 10^(-d / 40)), at least 1; a note without a level, and every note otherwise, getsDEFAULT_VELOCITY. - On a mono line, a note whose contour leaves its key by
BEND_MINor more, of one sign, over adjacent frames that span the tracker’s reach (a quarter frame plus one period), outside every glide, drop and vibrato span, gets a bend at each contour point outside those spans, clamped toBEND_RANGE, and a centred bend at its end.