Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -15,7 +15,6 @@ if len(sys.argv) < 2: · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | filename = sys.argv[1] |
| 17 | 17 | onsets = [] |
| 18 | −oldonsets = [] | |
| 19 | 18 | |
| 20 | 19 | s = source(filename, samplerate, hop_s) |
| 21 | 20 | o = onset("default", win_s, hop_s) |
| @@ -31,9 +30,6 @@ while True: · 9 unmodified lines | ||
| 31 | 30 | thisbeat = (block_read - 4. + isbeat[0]) * hop_s / samplerate |
| 32 | 31 | print "%.4f" % thisbeat |
| 33 | 32 | onsets.append (thisbeat) |
| 34 | − # old onset | |
| 35 | − thisbeat = (block_read - 3. ) * hop_s / samplerate | |
| 36 | − oldonsets.append (thisbeat) | |
| 37 | 33 | block_read += 1 |
| 38 | 34 | if read < hop_s: break |
| 39 | 35 | |
| @@ -46,7 +42,6 @@ plot(allsamples_max_times, allsamples_max, '-b') · 6 unmodified lines | ||
| 46 | 42 | plot(allsamples_max_times, -allsamples_max, '-b') |
| 47 | 43 | axis(xmin = 0., xmax = max(allsamples_max_times) ) |
| 48 | 44 | for stamp in onsets: plot([stamp, stamp], [-1., 1.], '.-r') |
| 49 | −for stamp in oldonsets: plot([stamp, stamp], [-1., 1.], '.-g') | |
| 50 | 45 | xlabel('time (s)') |
| 51 | 46 | ylabel('amplitude') |
| 52 | 47 | show() |