jitter spectroscope...?

Tim Canfer's icon

I am a relative newcomer, normally dabbling in MSP - in short I am trying to program a filled in area spectroscope - with option for log frequencies.

I have managed to get a passable scatter graph plot from the following patch, using a combination of pttf~ and jit.poke. Unfortunately I can't figure out a good method to join the dots, fill in the area (below, obviously!), and clear the window after each plot.

Please can someone help explain how I could do that - or if I have made any stupid patching mistakes so far?

I've attached the patch as an image, here is the patch and pfft~ subpatch called spec:

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

pfft~ spec

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

Rob Ramirez's icon

did you search the forum for spectrosopce?
this thread comes up:https://cycling74.com/forums/index.php?t=rview&th=31995

how about the max browser?
examples/jitter-examples/audio/jit.poke~-spectrogram.maxpat

Tim Canfer's icon

Yes, that post comes up via Jean-Francois Charles's reply to the "Spectroscope~ to Jitter window" - Unfortunately I don't have Max 4 (which I assume the compressed text is for).

As far as I can see in the examples so far are excellent demonstrations of time vs frequency spectrograms, which work well with the discontinuous data.

When I try to plot frequency vs amplitude (i.e. what I assume you'd call a spectroscope, or a spectrum analyzer in normal sound recording terms)- I get the patch above.

Clearing the window is not a problem (I have finally figured out that's just an edge detector on the bin output to a clear message.)

But the rest still eludes me - If Jean-Francois Charles's patch does answer any of these questions, please could someone put it in Max 5 format?

Many thanks - (and apologies in advanced if this turns out to be a blindingly obvious noob solution which I overlooked in Tutorial 1!!)

Tim

Rob Ramirez's icon

sorry, i'm not cognizant of the differences in terminology.
however you can open max 4 patches in max 5. just copy and paste as you would max 5 text.

Tim Canfer's icon

Sorry - that was an attempt to clarify! - I was trying to express the difference between:
1. the a plot of amplitude on y axis and frequency on x, updated in realtime to show near current frequency content (what you see in spectroscope~) and
2. time on y axis and frequency on x axis, with amplitude plotted as alpha intensity (what you see in the jit.poke~-spectrogram example in the bottom left pwindow)

There are several of 1, but I can't seem to work out how to create a decent looking version of 2.

Re. the compressed text, that will not paste with the text as it is at the moment - I can get it to copy from clipboard if I put ----------begin_max5_patcher----------, but that is just text.
Looking into it, it should open Max 4 - but I cannot see why is isn't...

Anyway - thanks for your help and patience Rob!

Tim

oli larkin's icon

hi tim,

here is a a basic openGL spectroscope hacked out of another patch. The other patch does log freq, but i couldn't get it working properly here, however, i made some notes to give you a clue how to add it.

oli

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

oli larkin's icon

figured it out. here's a version with log freq

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

Tim Canfer's icon

that's superb, thanks oli - I didn't think it would be as easy as I'd been hoping...

I assume that the pttf~ is something like:

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

This is all going toward a sexier version of sybil - I've kind of get distracted by the jitter side, but at least I managed to make my own triggering scope - although now I have to figure out how to apply that outline!

Thanks again,

Tim

oli larkin's icon

yep.. forgot that bit

Tim Canfer's icon

I have just realized in I've confused the axis on 2 and got mixed up in the following para - Obviously 2 should be freq on y and time on x. I should have said there are several of 2, but not 1.

(ahem) - sorry about that - need to proof my posts before I submit...

Tim Canfer wrote on Sat, 01 August 2009 02:53
2. time on y axis and frequency on x axis, with amplitude plotted as alpha intensity (what you see in the jit.poke~-spectrogram example in the bottom left pwindow)

There are several of 1, but I can't seem to work out how to create a decent looking version of 2.

Apologies and thanks again Oli

Tim

Nic's icon

Hi Tim and Oli,

Thank you for sharing your patches. I was trying to create exactly what you've shared here - a log-scaled spectroscope using Jitter.

I want to expand on your work and increase the FFT size to e.g., 8192.

Inspecting your patch I can't seem to wrap my head around how to adjust the expr-object with the following expression to fit a 8192 FFT size.

expr 255 * ((1. / 0.057762265) * log(($f1)+1)/96.)

Do you know how I can adjust this?

Can you tell me why you're calculating the logarithm of the "index number + 1" divided by 96, and why this is scaled with (1 / 0.0577) then multiplied by 255.

Thank you in advance.