[PD] Identifying the position of notes in an (audio) array

hard off hard.off at gmail.com
Tue Oct 4 15:00:59 CEST 2005


>>BTW: what is the best solution to measure the time between two bangs in
samples (i.e. the number of samples recorded into an array (when the
recording is started and stopped manually))?<<

use [timer] to get the time, and then just multiply that by your sample rate.

ie, if you have a sample at 44100hz, and you get a bang at 500ms and 4000ms

then you go:  4000 - 500 = 3500ms = 3.5 sec

3.5sec * 44100 hz =  154350 samples

(i think sometimes the bit rate might come into play, but a simple
multiplication or division by 2, 4, 8 etc will sort that out.)




More information about the Pd-list mailing list