Fix zero/negative note length after on time quantization
New, more robust bar indexes assignment scheme