From 2f310b790df14cf092a682fb60d5eb8cf2032d94 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 1 Dec 2013 14:49:15 -0500 Subject: [PATCH] timeside/analyzer/aubio_temporal.py: add beat confidence --- timeside/analyzer/aubio_temporal.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/timeside/analyzer/aubio_temporal.py b/timeside/analyzer/aubio_temporal.py index f4c3ce4..60b4c0b 100644 --- a/timeside/analyzer/aubio_temporal.py +++ b/timeside/analyzer/aubio_temporal.py @@ -51,6 +51,7 @@ class AubioTemporal(Analyzer): self.block_read = 0 self.onsets = [] self.beats = [] + self.beat_confidences = [] @staticmethod @interfacedoc @@ -78,6 +79,7 @@ class AubioTemporal(Analyzer): self.onsets += [self.o.get_last_s()] if self.t(frames): self.beats += [self.t.get_last_s()] + self.beat_confidences += [self.t.get_confidence()] self.block_read += 1 return frames, eod @@ -128,6 +130,18 @@ class AubioTemporal(Analyzer): self.pipe.results.add(beats) + #--------------------------------- + # Beat confidences: Event (time, value) + #--------------------------------- + beat_confidences = self.new_result(data_mode='value', time_mode='event') + beat_confidences.id_metadata.id += '.' + "beat_confidence" + beat_confidences.id_metadata.name += " " + "Beat confidences" + beat_confidences.id_metadata.unit = None + beat_confidences.data_object.time = self.beats + beat_confidences.data_object.value = self.beat_confidences + + self.pipe.results.add(beat_confidences) + #--------------------------------- # BPM: Segment (time, duration, value) #--------------------------------- -- 2.39.5