- Timestamp:
- Mar 23, 2017, 3:03:29 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- 5ab3c4e
- Parents:
- 53fbd58
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/aubio/cmd.py
r53fbd58 r6288806 215 215 def __call__(self, block): 216 216 return self.onset(block) 217 def repr_res(self, res, frames_read, a_source):217 def repr_res(self, res, frames_read, samplerate): 218 218 if res[0] != 0: 219 outstr = self.time2string(self.onset.get_last(), a_source.samplerate)219 outstr = self.time2string(self.onset.get_last(), samplerate) 220 220 sys.stdout.write(outstr + '\n') 221 221 … … 232 232 def __call__(self, block): 233 233 return self.pitch(block) 234 def repr_res(self, res, frames_read, a_source):235 fmt_out = self.time2string(frames_read, a_source.samplerate)234 def repr_res(self, res, frames_read, samplerate): 235 fmt_out = self.time2string(frames_read, samplerate) 236 236 sys.stdout.write(fmt_out + "%.6f\n" % res[0]) 237 237 … … 244 244 def __call__(self, block): 245 245 return self.tempo(block) 246 def repr_res(self, res, frames_read, a_source):246 def repr_res(self, res, frames_read, samplerate): 247 247 if res[0] != 0: 248 outstr = self.time2string(self.tempo.get_last(), a_source.samplerate)248 outstr = self.time2string(self.tempo.get_last(), samplerate) 249 249 sys.stdout.write(outstr + '\n') 250 250 … … 257 257 def __call__(self, block): 258 258 return self.notes(block) 259 def repr_res(self, res, frames_read, a_source):259 def repr_res(self, res, frames_read, samplerate): 260 260 if res[2] != 0: # note off 261 fmt_out = self.time2string(frames_read, a_source.samplerate)261 fmt_out = self.time2string(frames_read, samplerate) 262 262 sys.stdout.write(fmt_out + '\n') 263 263 if res[0] != 0: # note on 264 264 lastmidi = res[0] 265 265 fmt_out = "%f\t" % lastmidi 266 fmt_out += self.time2string(frames_read, a_source.samplerate)266 fmt_out += self.time2string(frames_read, samplerate) 267 267 sys.stdout.write(fmt_out) # + '\t') 268 268 … … 284 284 fftgrain = self.pv(block) 285 285 return self.mfcc(fftgrain) 286 def repr_res(self, res, frames_read, a_source):287 fmt_out = self.time2string(frames_read, a_source.samplerate)286 def repr_res(self, res, frames_read, samplerate): 287 fmt_out = self.time2string(frames_read, samplerate) 288 288 fmt_out += ' '.join(["% 9.7f" % f for f in res.tolist()]) 289 289 sys.stdout.write(fmt_out + '\n') … … 309 309 fftgrain = self.pv(block) 310 310 return self.filterbank(fftgrain) 311 def repr_res(self, res, frames_read, a_source):312 fmt_out = self.time2string(frames_read, a_source.samplerate)311 def repr_res(self, res, frames_read, samplerate): 312 fmt_out = self.time2string(frames_read, samplerate) 313 313 fmt_out += ' '.join(["% 9.7f" % f for f in res.tolist()]) 314 314 sys.stdout.write(fmt_out + '\n') … … 346 346 # print results for this block 347 347 if args.verbose > 0: 348 processor.repr_res(res, frames_read, a_source )348 processor.repr_res(res, frames_read, a_source.samplerate) 349 349 # increment total number of frames read 350 350 frames_read += read
Note: See TracChangeset
for help on using the changeset viewer.