Calculating the average pitch of an audio file

Feb 21, 2007 at 4:09pm

Calculating the average pitch of an audio file

Dear all, that’s the problem: given an audio file of “M” milliseconds and given an integer “W” that represents the window size, I would like to obtain a list of “L/W” values that represent the pitch avarage of each window that composes the audio file.

I’m trying to use the Tristan Jehan’s pitch~ object, that works in real time.
However, with this object I have two issues:

A: window size seems not able to change dinamically (btw, I can avoid this problem using some script)
B: both fiddle~ and pitch~ works in realtime, so anytime I run the patch that I attached, I obtain different values in relation with how much “silence” enters in the first window.

ps: I would like to do the same thing with the noisiness parameter…

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 251 343 33 9109513 clear;
#P newex 281 83 58 9109513 t 0 0 clear;
#P button 281 54 15 0;
#P newex 180 305 82 9109513 pack 0 0.;
#N counter;
#X flags 0 0;
#P newobj 180 268 66 9109513 counter;
#N coll results;
#P newobj 251 381 53 9109513 coll results;
#P newex 180 239 82 9109513 t b f;
#P newex 144 189 46 9109513 sel -96.;
#P message 77 256 27 9109513 stop;
#P message 9 256 67 9109513 startwindow;
#P newex 106 288 29 9109513 dac~;
#P user gain~ 106 162 21 89 158 0 1.071519 7.94321 10.;
#P flonum 180 215 67 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 144 83 29 9109513 sig~;
#P toggle 144 54 15 0;
#P newex 144 164 126 9109513 loudness~ 250. 250. 250.;
#P newex 144 128 84 9109513 groove~ mysound;
#P message 60 54 43 9109513 replace;
#P newex 60 83 81 9109513 buffer~ mysound;
#P comment 263 31 133 9109513 click to fill the coll;
#P fasten 16 0 14 0 185 373 256 373;
#P fasten 18 2 14 0 334 377 256 377;
#P lcolor 6;
#P connect 19 0 14 0;
#P fasten 10 0 9 0 14 278 111 278;
#P fasten 11 0 9 0 82 278 111 278;
#P connect 5 0 6 0;
#P connect 4 0 12 0;
#P connect 15 0 16 0;
#P connect 12 1 7 0;
#P connect 7 0 13 0;
#P connect 13 0 15 0;
#P fasten 18 1 15 2 310 258 213 258;
#P lcolor 6;
#P connect 13 1 16 1;
#P connect 17 0 18 0;
#P connect 2 0 1 0;
#P connect 6 0 3 0;
#P fasten 18 0 3 0 286 112 149 112;
#P lcolor 6;
#P connect 3 0 4 0;
#P fasten 3 0 8 0 149 154 111 154;
#P fasten 8 0 9 1 111 280 130 280;
#P connect 8 0 9 0;
#P window clipboard copycount 20;

#30386
Feb 21, 2007 at 7:14pm

> B: both fiddle~ and pitch~ works in realtime, so anytime I run the patch that I attached, I obtain different values in relation with how much “silence” enters in the first window.

this issue is releated to the “window” paradigm isnt it, i dont
know how you can leave the silence parts out of the average
calculation, but when silent parts create a pitch track of
0 Hz you would only need to exclude frequencies below 10 Hz
from the calcualtion.
for nonrealtime it might make sense to perform the calculation
on the non signal layer, this will make issues about the “window”
parqadigm a bit easier.

-110

#97040

You must be logged in to reply to this topic.