]> git.parisson.com Git - timeside.git/commitdiff
timeside/analyzer/aubio_{bpm,onset}.py: simplify, using get_last_s
authorPaul Brossier <piem@piem.org>
Sat, 13 Apr 2013 16:34:37 +0000 (11:34 -0500)
committerPaul Brossier <piem@piem.org>
Sat, 13 Apr 2013 16:34:37 +0000 (11:34 -0500)
timeside/analyzer/aubio_bpm.py
timeside/analyzer/aubio_onset.py

index b1537ce7cf2fde65e6831148b3b549b647f6c97d..226a9e6bcfa07e0339a4429aa0092facecfb50f4 100644 (file)
@@ -58,11 +58,11 @@ class AubioBPM(Processor):
     def process(self, frames, eod=False):
         i = 0
         while i < frames.shape[0]:
-          downmixed = frames[i:i+self.hop_s, :].sum(axis = -1)
-          isbeat = self.t(downmixed)
-          if isbeat: self.beats += [(isbeat[0] + self.block_read * self.hop_s ) / self.samplerate() ]
-          i += self.hop_s
-          self.block_read += 1
+            downmixed = frames[i:i+self.hop_s, :].sum(axis = -1)
+            if self.t(downmixed):
+                self.beats += [self.t.get_last_s()]
+            i += self.hop_s
+            self.block_read += 1
         return frames, eod
 
     def result(self):
index 48bab840ecb590db2aa8c9b4553b4ed56ae53281..dc0cf846ac8d2a70db2531639d594aa2c787f6b9 100644 (file)
@@ -60,8 +60,8 @@ class AubioOnset(Processor):
             downmixed = frames[i:i+self.hop_s, :].sum(axis = -1)
             isonset = self.t(downmixed)
             if isonset:
-                #print self.t.get_last_onset_s()
-                self.onsets += [self.t.get_last_onset_s()]
+                #print self.t.get_last_s()
+                self.onsets += [self.t.get_last_s()]
             i += self.hop_s
             self.block_read += 1
         return frames, eod