aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Northup <grissess@nexusg.org>2018-09-11 02:30:06 -0400
committerGraham Northup <grissess@nexusg.org>2018-09-11 02:30:06 -0400
commita47d62027c8eefbaecdae73e34334d237841e374 (patch)
treeed667f6487f2df73cca1a8a529612e65350d567b
parent1efd04acb4e8e2cfaf89b4476d2b5b1a5ed57e6e (diff)
Fixed IndexError
-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))