Skip to content

Commit d339c4a

Browse files
author
tuomaseerola
committed
Minor fixes
1. Bring back a fix for multiple note-on-note-off matches (Thanks Andy) 2. Fix the tempo change for tracks with empty tempo changes (Thanks Andy)
1 parent d1326d4 commit d339c4a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

miditoolbox/mdlMStrToNMat.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@
6767
%Should instead calc delta-seconds from start in seconds of current tempo?
6868

6969
%Tempo change?
70-
[mx ind] = max(find(cumtime >= tempos_time));
71-
current_tempo = tempos(ind);
72-
70+
if ~isempty(tempos) % fix suggested by Andy Milne 2 June 2016
71+
[mx ind] = max(find(cumtime >= tempos_time));
72+
current_tempo = tempos(ind);
73+
end
7374
% find start/stop of notes:
7475
% note on with vel>0:
7576
if (midimeta==1 && type==144 && data(2)>0)
@@ -97,9 +98,8 @@
9798
warning('note-off with no matching note-on. skipping.');
9899
elseif (length(ind)>1)
99100
%??? not sure about this...
100-
% disp('warning: found multiple note-on matches for note-off, taking
101-
% first...'); % Disabled by TE 9 May 2016
102-
% ind = ind(1); % Disabled by TE 9 May 2016
101+
disp('warning: found multiple note-on matches for note-off, taking first...'); % Disabled by TE 9 May 2016, , brought back as suggested by Andy Mile 2 June 2016
102+
ind = ind(1); % Disabled by TE 9 May 2016, brought back as suggested by Andy Mile 2 June 2016
103103
else
104104
%set duration values
105105
nmat(ind,2) = beat - nmat(ind,1);

0 commit comments

Comments
 (0)