Spectral analysis: how to identify fundamental frequencies (not in real time)

Noisey Parker's icon

Hello,

I have been doing a form of analysis recently where I look at the spectrogram (of say a bell to use an obvious example) in something like Izotope RX zoom right in manually write down the strongest frequencies and then use those frequencies as the basis for additive synthesis.

Is there a way to do this in Max? I have asked this question before and been guided to things like fiddle~. But it doesn't work very well on inharmonic spectra and there's no need for it to work in real time. Something basic like a read out of the 12 hottest frequencies at any given time? Or even better a read out of the 12 hottest frequencies within a specified period of time.

I have been through the MSP analysis tutorials but I am at a bit of a loss as to how the capture device is read? The help file doesn't seem that informative. If I increase the amount of bins to 20,000 because I want to be able to separate out individual frequencies, I get 3124 entries into the capture~ display, some of these are blank and some have many numbers on each line, some are also negative numbers? If any one has any advice as to how to read the capture~ device and then to convert that data into the most powerful frequencies over time, I would very much appreciate your help.

Many thanks

Roman Thilenius's icon

fiddle works ok for frequencies not too low.

what can help in many situations is do to some dynamics processing (namely apply a drastic noise gate) before analysingthe frequency using fiddle.

for monotonic melodic stuff there are various other options ... err ... outside max, such as melodyne, which does the job better (because they use a totally different approach.)

-110

Roman Thilenius's icon

oh i just see you are talking about a "bell" ... that is a pretty hard job because we re talking about possibly hundreds of partials with about the same gain.

to replay this (especially in the case of a bell with an unchanged envelope) the IRCAM stuff seems perfect, but i am not sure if there are externals for analysis too, today (there werent for Max v4)

i´d use tau editor ... but wait ... ;)

Floating Point's icon

try downloading this library of externals for max--
http://www.e--j.com/index.php/what-is-zsa-descriptors/

Ploki's icon

I used [sigmund~] by Miller Puckette, which I think worked better than fiddle, but that was at least 3 years ago.
http://vud.org/max/

also used something called [mbc.pitch~ ] sometime ago, but I think it offers better accuracy when using cleaner tones then its [fiddle~ ] relatives, but its shit with short samples.

In the end, I made a patcher that first "estimated" the fundamentals, then filtered out the garbage (using bandpass to focus on the "estimates) and then the algorithm cycled between different settings of [sigmund~] and [mbc.pitch~], then with statistics (used [sadam.stat]) tried to pin it down to a decent number. Also had a fail-safe built-in, so if the results started looping it force-kicked him into a different setting and restarted.

When you get that exact frequency, you can setup a fairly narrow bandpass (but wide and gentle enough so it doesn't self-oscillate) and just trace envelope with a [peakamp~]

System wasn't really robust, had its flaws, but also had potential for dismantling sounds with a fair amount of accuracy. Didn't wrap it up mid-work so I have no idea where it is and how it was done exactly.

[Sigmund~ ] had a fairly decent "list" output with fundamentals. not bad at all...

Noisey Parker's icon

Thank you for your help and sorry for the slow reply! All the suggested solutions seem to be geared to real time use, which is seriously volatile! I am looking for something like SPEAR that will give a graphic display and list of the most powerful frequencies. Then to gate them down to say the 12 most powerful and then create an additive synthesis patch from that data.

mzed's icon

You can export SDIF from SPEAR and use it in Max. There are some tutorials here:
http://cnmat.berkeley.edu/patch/2741

Feel free to ask me any questions.