From 7119fe471baa1ec4a40ead19d127452b8d573891 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 18 Jan 2021 10:36:06 -0500 Subject: [PATCH] rms_analysis.py : Don't crash in write_audacity_label_files() when seq.json does not exist. --- rms_analysis.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rms_analysis.py b/rms_analysis.py index ad27011..6021363 100644 --- a/rms_analysis.py +++ b/rms_analysis.py @@ -254,7 +254,7 @@ def note_stats( r, decay_pct=50.0, extraDurSearchMs=500 ): -def locate_peak_indexes( xV, xV_srate, eventMsL, audioFn ): +def locate_peak_indexes( xV, xV_srate, eventMsL, audioFn="" ): pkIdxL = [] for i, (begMs, endMs) in enumerate(eventMsL): @@ -601,6 +601,9 @@ def write_audacity_label_files( inDir, analysisArgsD, reverseFl=True ): takeDir = os.path.join(pitchDir,takeFolder) + if not os.path.isfile(os.path.join(takeDir,"seq.json")): + continue + r = rms_analysis_main( takeDir, midi_pitch, **analysisArgsD ) labelFn = os.path.join(takeDir,"audacity.txt")