File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -945,8 +945,8 @@ qtractorMidiEditCommand *qtractorMidiToolsForm::midiEditCommand (
945
945
// Go for the main pass...
946
946
qtractorTimeScale::Cursor cursor (m_pTimeScale);
947
947
948
- // Resize duration: legato/gap filler helper ...
949
- QHash< unsigned char , qtractorMidiEvent *> notes ;
948
+ // Resize/Legato: to track last event ...
949
+ qtractorMidiEvent *pLastEvent = nullptr ;
950
950
951
951
for ( ; iter != iter_end; ++iter) {
952
952
qtractorMidiEvent *pEvent = *iter;
@@ -1168,16 +1168,15 @@ qtractorMidiEditCommand *qtractorMidiToolsForm::midiEditCommand (
1168
1168
}
1169
1169
if (m_ui.ResizeLegatoCheckBox ->isChecked ()
1170
1170
&& pEvent->type () == qtractorMidiEvent::NOTEON) {
1171
- qtractorMidiEvent *pPrev = notes.value (pEvent->note (), nullptr );
1172
- if (pPrev) {
1171
+ if (pLastEvent) {
1173
1172
const float p
1174
1173
= 0 .01f * float (m_ui.ResizeLegatoSpinBox ->value ());
1175
1174
const long d2
1176
- = long (p * float (pPrev ->time () - pEvent->time ()));
1177
- if (iDuration < d2)
1175
+ = long (p * float (pLastEvent ->time () - pEvent->time ()));
1176
+ if (iDuration < d2 && d2 > 0 )
1178
1177
iDuration = d2;
1179
1178
}
1180
- notes. insert (pEvent-> note (), pEvent) ;
1179
+ pLastEvent = pEvent;
1181
1180
}
1182
1181
}
1183
1182
// Rescale tool...
You can’t perform that action at this time.
0 commit comments