From: Paul Brossier Date: Sun, 1 Dec 2013 19:49:15 +0000 (-0500) Subject: timeside/analyzer/aubio_temporal.py: add beat confidence X-Git-Tag: 0.5.2~25^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=2f310b790df14cf092a682fb60d5eb8cf2032d94;p=timeside.git timeside/analyzer/aubio_temporal.py: add beat confidence --- 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) #---------------------------------