Changeset 4120fbc for python/demos/demo_bpm_extract.py
- Timestamp:
- May 16, 2016, 3:16:00 AM (9 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- dc654f8
- Parents:
- 416ddd1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/demos/demo_bpm_extract.py
r416ddd1 r4120fbc 46 46 47 47 # Convert to periods and to bpm 48 bpms = 60./diff(beats) 49 b = median(bpms) 48 if len(beats) > 1: 49 if len(beats) < 4: 50 print("few beats found in {:s}".format(path)) 51 bpms = 60./diff(beats) 52 b = median(bpms) 53 else: 54 b = 0 55 print("not enough beats found in {:s}".format(path)) 50 56 return b 51 57 … … 54 60 for f in sys.argv[1:]: 55 61 bpm = get_file_bpm(f) 56 print "%6s" % ("%.2f" % bpm), f62 print("{:6s} {:s}".format("{:2f}".format(bpm), f))
Note: See TracChangeset
for help on using the changeset viewer.