History

demos/demo_onset_file.py: remove old onsets

Paul Brossier committed 13 years ago

Commit b0d5a481 parent cf80e591 file · +0 −5Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/demos/demo_onset_file.py+0−5
@@ -15,7 +15,6 @@ if len(sys.argv) < 2: · 14 unmodified lines
1515
1616 filename = sys.argv[1]
1717 onsets = []
18−oldonsets = []
1918
2019 s = source(filename, samplerate, hop_s)
2120 o = onset("default", win_s, hop_s)
@@ -31,9 +30,6 @@ while True: · 9 unmodified lines
3130 thisbeat = (block_read - 4. + isbeat[0]) * hop_s / samplerate
3231 print "%.4f" % thisbeat
3332 onsets.append (thisbeat)
34− # old onset
35− thisbeat = (block_read - 3. ) * hop_s / samplerate
36− oldonsets.append (thisbeat)
3733 block_read += 1
3834 if read < hop_s: break
3935
@@ -46,7 +42,6 @@ plot(allsamples_max_times, allsamples_max, '-b') · 6 unmodified lines
4642 plot(allsamples_max_times, -allsamples_max, '-b')
4743 axis(xmin = 0., xmax = max(allsamples_max_times) )
4844 for stamp in onsets: plot([stamp, stamp], [-1., 1.], '.-r')
49−for stamp in oldonsets: plot([stamp, stamp], [-1., 1.], '.-g')
5045 xlabel('time (s)')
5146 ylabel('amplitude')
5247 show()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t