[Sharing is Fun] LCD Sonogram

Bertrand Fraysse's icon
Max Patch
Copy patch and select New From Clipboard in Max.

////////// MAIN PATCH \\\\\

////////// PFFT SUBPATCH - Save as BF.PFFT-Analysis~ \\\\\

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

--------------------------------------------------------------

I share this patch because I'm stuck with the colors adding.
The monochrome mode works... A lot of tweekings can be achieve but my main problem is now the colors, I have no idea on how to do this.

I tried to change colors independently, with different exponential coefficient but without significant results. Maybe a combination of [split]...

Thanks in advance for any help.

j.y.bernier's icon

Colorful, with subsampling:

--- Subpatch 1: spectr-fftsub ---

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

--- Subpatch 1: spectr-down ---

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

--- Subpatch 3: spectr-analyze ---

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

--- Main patch ---

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

Some comments in follow-up.

j.y.bernier's icon

Some comment on my LCD sonogram.

spectr-fftsub:
Performs the fft.
Lives of course inside pfft~
Integration (spectral averaging) is not used in the sonogram.

spectr-down:
Subsampled pfft~. Lives in a poly~
I use a script to change overlap.

spectr-analyze:
Hearth of the sonogram.
Embed a poly~ for downsampling.
dsp needs to be stopped before changing downsampling and restarted before.
clut use 3 tables to hold R, G and B curves.
Get my clut here: http://www2.pescadoo.net/temporaire/SPECTRO.CLUT

main patch:
Gain: self explanatory.
Period: ms per column.
YOU CAN EASILY SCREW YOU CPU WITH PERIODS < 10.

Bertrand Fraysse's icon

Powerful stuff, thanks for sharing it. Your cluts work fine, good idea.

notyouraveragejoe's icon

I'll have to have a look at this on my other computer later, but thanks!
Crazy coincidence that you post this, I was going to ask if there are any
alternative sonograms to the max object, preferably using LCD.
Is the code scalable? If I resize the LCD, will the code accomodate the new
dimensions?

On 14/04/2008, Bertrand Fraysse wrote:
>
>
> Powerful stuff, thanks for sharing it. Your cluts work fine, good idea.
>
>

Bertrand Fraysse's icon

In my version, the resize message for the code is on the left, and more precisely in the top left corner. You send a message with
[x y] and then you resize your LCD by giving it the same values.

A question. If I put an interface thing in a bpatcher.
Is there a way to know, inside the bpatcher, its size ?

j.y.bernier's icon

> Crazy coincidence that you post this, I was going to ask
> if there are any alternative sonograms to the max object,
> preferably using LCD.

Funny indeed. April is sonogram's month.

> Is the code scalable? If I resize the LCD,
> will the code accomodate the new dimensions?

Mine won't until you change 'counter 0 512' to match the new width and 'spectr-analyze fft_size buffer_name' to match the new height. Since it is one vertical pixel per frequency bin, you are bound to height = fft-size/2.

Next version will get a zoom fft (spectrum translation around a center frequency) but this requires the low-pass filter which was omitted in this version ('filter here' comment in spectr-analyze) because aliasing would be too high.

There are certainly better display solutions with Jitter but i don't have Jitter.

Leafcutter John's icon

Quote: J.Y.Bernier wrote on Sun, 13 April 2008 23:34
----------------------------------------------------

> YOU CAN EASILY SCREW YOU CPU WITH PERIODS < 10.
----------------------------------------------------

Really? on my macbook pro a period of 1 is fine about 1% cpu usage.

It's a great patch!

Best,

J.

Jean-Francois Charles's icon
Stefan Tiedje's icon

Bertrand Fraysse schrieb:
> A question. If I put an interface thing in a bpatcher.
> Is there a way to know, inside the bpatcher, its size ?

Javascript can help:

function bang()
{
if(this.patcher){
    if(this.patcher.box){
     outlet(0, this.patcher.box.rect);
    }
}
}

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