# HG changeset patch # User Chris Cannam # Date 1439403329 -3600 # Node ID 029159daf3f12e013e22478c97c45a75c3bac100 # Parent 2e08ae56b4b55a1c68688cb60163702293ca518e Make script robust to spurious note-offs diff -r 2e08ae56b4b5 -r 029159daf3f1 multiple_f0_estimation/silvet-live/frames.py --- a/multiple_f0_estimation/silvet-live/frames.py Wed Aug 12 17:45:36 2015 +0100 +++ b/multiple_f0_estimation/silvet-live/frames.py Wed Aug 12 19:15:29 2015 +0100 @@ -25,7 +25,8 @@ while ix < len(data) and sec >= float(data[ix][0]): time, freq, vely = data[ix][:3] if vely == "0": - del extant[freq] + if freq in extant: + del extant[freq] else: extant[freq] = vely ix = ix + 1 diff -r 2e08ae56b4b5 -r 029159daf3f1 multiple_f0_estimation/silvet/frames.py --- a/multiple_f0_estimation/silvet/frames.py Wed Aug 12 17:45:36 2015 +0100 +++ b/multiple_f0_estimation/silvet/frames.py Wed Aug 12 19:15:29 2015 +0100 @@ -25,7 +25,8 @@ while ix < len(data) and sec >= float(data[ix][0]): time, freq, vely = data[ix][:3] if vely == "0": - del extant[freq] + if freq in extant: + del extant[freq] else: extant[freq] = vely ix = ix + 1