New Pianoroll Editor: uniform cutoff-time advance of notes in a selection range
To make it possible to change the operation of the "length" input so that it advances the cutoff of the note - or ALL notes within a selection - by a fixed-time amount, expressed e.g. as a fraction of a beat, so as to introduce a uniform spacing between successive notes regardless of notation length.
The UI for this could be something like:
Advance note cutoff by [0.xxx] of [ yyy |^]
[ ] is a numeric entry box
[ |^] represents a multiple-choice dropdown
yyy is text, possible choices might be:
1) its notational duration (as in the current case)
2) one beat
3) one second (absolute time)
to shorten the note by (respectively) 1) a fraction of its notational duration; 2) a fixed fraction of a beat; 3) a fixed absolute time interval.
I assume that the current 1-to-1000 value is the "native" duration parameter in the internal data structure for a note. All the above choices would amount to replacing this value by 1000 * (1 - x) where x (0 to 1) is the fraction by which the note is to be shortened. Taking 2), if e.g. a quarter note gets one beat, and we want to shorten a note by, say, 1/10 of a beat regardless of its notational duration, then
x = 0.1 * (duration of quarter)/(duration of current note)
Thus if the current note is a eighth, x = 0.1 * 1/.5 = 0.2
and 1000 * (1 - x) = 1000 * (1 - 0.2) = 1000 * 0.8 = 800
and if the note is a dotted quarter, x = 0.1 * 1/1.5 = 0.0666...
and 1000 * (1 - x) = 1000 * (1 - .0666...) = 1000 * 0.9333... = 933