Changeset 7e9e311 for python/demos
- Timestamp:
- Mar 15, 2013, 11:49:29 PM (12 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:
- adc47c9
- Parents:
- 35f73b8c
- Location:
- python/demos
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/demos/demo_onset.py
r35f73b8c r7e9e311 21 21 o = onset("default", win_s, hop_s, samplerate) 22 22 23 # onset detection delay, in samples24 # default to 4 blocks delay to catch up with25 delay = 4. * hop_s26 27 23 # list of onsets, in samples 28 24 onsets = [] … … 32 28 while True: 33 29 samples, read = s() 34 is_onset = o(samples) 35 if is_onset: 36 this_onset = int(total_frames - delay + is_onset[0] * hop_s) 37 print "%f" % (this_onset / float(samplerate)) 38 onsets.append(this_onset) 30 if o(samples): 31 print "%f" % o.get_last_onset_s() 32 onsets.append(o.get_last_onset()) 39 33 total_frames += read 40 34 if read < hop_s: break -
python/demos/demo_onset_plot.py
r35f73b8c r7e9e311 21 21 o = onset("default", win_s, hop_s, samplerate) 22 22 23 # onset detection delay, in samples24 # default to 4 blocks delay to catch up with25 delay = 4. * hop_s26 27 23 # list of onsets, in samples 28 24 onsets = [] … … 40 36 is_onset = o(samples) 41 37 if is_onset: 42 this_onset = int(total_frames - delay + is_onset[0] * hop_s)38 this_onset = o.get_last_onset() 43 39 print "%f" % (this_onset / float(samplerate)) 44 40 onsets.append(this_onset)
Note: See TracChangeset
for help on using the changeset viewer.