View Single Post
Old 09-08-2018, 12:55 AM   #147
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

I added #notelen widget, but it can works pretty rough for now (at MIDI side and on controls scaling side when using mouse). At his own risk.
The complexity of any MIDI events stuff is calculating proper offsets, it is not like Items - set start and length. In MIDI data positions of events relative to each other. Example

NoteOn C3
NoteOff C3
NoteOn D#5
NoteOff D#5

if you adjust length of NoteOn C3 (in other words change position of NoteOff C3), you need to also shift any further events without break their timings. Also to compute actual note lengths you need to deal with trigger tables, so for to know length of C3 in

NoteOn C3
NoteOn C#5
NoteOff C#5
NoteOn B5
NoteOff B5
NoteOff C3
NoteOn D#5
NoteOff D#5
NoteOff C3

you need to calculate ppq differrence beetween last noteoff and first latched position of NoteOn C3, note just any previous NoteOn (if you forgot in MIDI there aren`t positions, only ppq offsets beetween events)

Last edited by mpl; 09-08-2018 at 01:07 AM.
mpl is offline   Reply With Quote