Changeset 7e9e311 for python/demos


Ignore:
Timestamp:
Mar 15, 2013, 11:49:29 PM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

python/demos/demo_onset*: remove di, moved to C

Location:
python/demos
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_onset.py

    r35f73b8c r7e9e311  
    2121o = onset("default", win_s, hop_s, samplerate)
    2222
    23 # onset detection delay, in samples
    24 # default to 4 blocks delay to catch up with
    25 delay = 4. * hop_s
    26 
    2723# list of onsets, in samples
    2824onsets = []
     
    3228while True:
    3329    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())
    3933    total_frames += read
    4034    if read < hop_s: break
  • python/demos/demo_onset_plot.py

    r35f73b8c r7e9e311  
    2121o = onset("default", win_s, hop_s, samplerate)
    2222
    23 # onset detection delay, in samples
    24 # default to 4 blocks delay to catch up with
    25 delay = 4. * hop_s
    26 
    2723# list of onsets, in samples
    2824onsets = []
     
    4036    is_onset = o(samples)
    4137    if is_onset:
    42         this_onset = int(total_frames - delay + is_onset[0] * hop_s)
     38        this_onset = o.get_last_onset()
    4339        print "%f" % (this_onset / float(samplerate))
    4440        onsets.append(this_onset)
Note: See TracChangeset for help on using the changeset viewer.