aboutsummaryrefslogtreecommitdiff
path: root/mkiv.py
diff options
context:
space:
mode:
Diffstat (limited to 'mkiv.py')
-rw-r--r--mkiv.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mkiv.py b/mkiv.py
index 9c6970f..cd50ce2 100644
--- a/mkiv.py
+++ b/mkiv.py
@@ -342,7 +342,7 @@ for fname in args:
lvtime, lvol = sorted(vol_at[tidx][ev.channel].items(), key = lambda pair: pair[0])[-1]
vol_at[tidx][ev.channel][abstime] = (0x3F80 & lvol) | ev.value
chg_vol[tidx][ev.channel] += 1
- events.append(MergeEvent(ev, tidx, abstime, cur_bank[tidx][ev.channel], cur_prog[tidx][ev.channel], cur_mw[tidx][ev.channel], events[-1]))
+ events.append(MergeEvent(ev, tidx, abstime, cur_bank[tidx][ev.channel], cur_prog[tidx][ev.channel], cur_mw[tidx][ev.channel], events[-1] if events else None))
ev_cnts[tidx][ev.channel] += 1
elif isinstance(ev, midi.MetaEventWithText):
events.append(MergeEvent(ev, tidx, abstime))