extracting peaks from pfft~

demers's icon

Still trying to figure this one out...

I'm trying to use two pfft~ in sequence, one that zeroes all bin amplitudes lower than the previous one, the other doing the same for amplitudes higher than the previous - theoretically leaving only peaks. Something comes out, but I'm not sure it's what I intended!

Any ideas please? The pfft~ is below. Thanks~

Max Patch
Copy patch and select New From Clipboard in Max.

Sethares's icon

Hi Demers,

Stefan and I were trying something quite similar a while ago and eventually decided to write it in java for mxj. If you are interested in this approach, you can go to

and download our "Spectral Toolbox" (you'll also need the java classes). The most relevant command is called SpT.Analysis -- so you instantiate this in a block called

mxj~ SpT.Analysis

inside the pfft~, and it will do the peak finding (along with a bunch of stuff that you may not want). It shouldn't be too hard to edit the java code and remove the irrelevant stuff...

-- Bill Sethares

demers's icon

Thank you Bill (and Stefan indirectly), I'll definitely check that out. In the meantime, I found a solution... use delta~ in two consecutive pfft~'s to calculate >~ and

Probably won't be much use to you, but here it is if you're curious.

Thanks again for replying,
Inouk Demers

Max Patch
Copy patch and select New From Clipboard in Max.

volker böhm's icon

On 30 Jul 2008, at 01:49, Inouk Demers wrote:
>
> Thank you Bill (and Stefan indirectly), I'll definitely check that
> out. In the meantime, I found a solution... use delta~ in two
> consecutive pfft~'s to calculate >~ and
> data into two buffers (basically containing zeroes and ones), then
> use those in a third pfft~ (via index~ out of the 3rd outlet of
> fftin~) to be multiplied with the amplitude of the original
> soundfile - if both buffers contain a 1 at any given point, it's a
> peak and it gets passed. Add a little spectral filtering, and voila!

i haven't had a closer look at your example (the pfft subpatches are
missing), but from your description it sounds a little complicated.
so, i'm not sure the following is what you had in mind. but you
could start experimenting from something like that:

Max Patch
Copy patch and select New From Clipboard in Max.

demers's icon
Eric Lyon's icon

Hi Bill,

Very nice sound examples. They sound quite like results I have generated from my FFTease pvtuner~ external described in this paper:

Are you using a similar technique?

Best,

Eric

Sethares's icon

Hi Eric,

Yes (and no!). There's clearly a lot of similarities in our work... a few differences: you seem to use a fixed template to map your frequencies to. We have a pretty ingenious (if I do say so myself) ways of specifying destination locations that are more sophisticated than "map to a fixed location". Think of a slider that allows your to move continuously from 12-tet through some meantone tunings, to 19-tet and on down to 7-tet. Both the tuning and the timbre are changed simultaneously.

In terms of technique, we both use a phase vocoder for the frequency analysis - you use an oscillator bank for resynthesis while we use an IFFT (also with a PV-like strategy to make the frequencies more accurate.) To see this in more detail, you can find a draft of our paper here:

I'd be happy for any feedback you might have on this... we have just submitted it and so have plenty of time to make revisions. Also -- we clearly need to add reference your spectral tuning work... what is the best reference for this?

--Bill

demers's icon

I agree, those examples are pretty cool! Eric, I was meaning to ask you whether there were any help files for FFTease. I have 2.5, maybe they're in a prior version?

Thanks,
Inouk

Eric Lyon's icon

Hi Bill,

Your paper looks great! I'm in the middle of a conference but will look at it more closely soon. On first glance, it appears that your approach is much more subtle than the crude quantization algorithm I use in pvtuner~. The most accessible reference for my spectral tuning paper (for which I'm the sole author) is:

"Spectral Tuning," Proceedings of the ICMC, Miami, FL, 1-6 November 2004. San Francisco: ICMA, 2004. 375-377.

Eric

p.s. Inouk - there should be help files included in the FFTease 2.5 distribution. Definitely on the Mac version, but probably on the Windows one as well.

demers's icon

Hello again Eric,

I extracted the latest version of FFTease for Windows again, and except for the brief description of each external on the webpage, I didn't find any other help files (I confirmed this by alt-clicking the objects in Max, and a 'help file not found' message comes up).

I can try and guess what the inlets and outlets represent from the messages at the bottom of the window, but I admit I haven't had much success so far!

It's a great collection though - can't wait to use it.

Best,
Inouk

kjg's icon

Quote: demers wrote on Thu, 31 July 2008 20:11
----------------------------------------------------
> Hello again Eric,
>
> I extracted the latest version of FFTease for Windows again, and except for the brief description of each external on the webpage, I didn't find any other help files

they are not there.
i zipped and attached the files from the mac osx package.

regards,
kjg

demers's icon

Dear kjg,

Oh, thank you so much! Very kind of you to pass that along. I'm like a kid in a toy store now...

Best wishes,
Inouk

Stefan Tiedje's icon

Inouk Demers schrieb:
> I extracted the latest version of FFTease for Windows again, and
> except for the brief description of each external on the webpage, I
> didn't find any other help files

You could download the Mac version and take the help files from there...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Eric Lyon's icon

Incidentally, the sound examples for the spectral tuning paper that I posted may be heard at:

Eric