FFT help needed

Sep 8, 2008 at 3:10pm

FFT help needed

Dear Reader,

I am still working on my EEG patch, after getting help here, I got further. Now I would like to know how I could use fft to get the same result as on these video extracts >

raw data
(this what I think to have in max/msp)

http://www.tedor2.extra.hu/video/ibvaraw.mov

fft data in 2d and 3d

http://www.tedor2.extra.hu/video/ibvafftbar.mov

http://www.tedor2.extra.hu/video/ibvafft.mov

and this is how the raw hex data becomes a float (thanks to Chris Muir) and a signal.

http://www.tedor2.extra.hu/video/maxraw.mov

If someone could give me a tip how to use fft on this raw data to get the bandwidths!

Any help appreciated,

Krisztian

#39609
Sep 9, 2008 at 3:03pm

Hi Krisztian,
I am not quite sure what you are after, what the 2 signals you have in max are, but did you try [spectroscope~] ?
As far as I can see the 2d version of fft is a normal 1D fft applied to both signals. The 3d version you refer to seems to be a spectrogram, which can also be obtained with [spectroscope~] (but then without the color to height mapping, so it’s 2D].

If that object doesn’t suit your needs you might want to look into a combination of a pfft patch and the jitter audio objects, followed by the actual visualisation for which you have many options using jitter(gl or not gl) objects
A good start would be to look at the patches made by Jean Francois Charles on http://www.cycling74.com/twiki/bin/view/Share/Jean-francoisCharles
and the jitter tutorials of this objects

Timo

#139634
Sep 9, 2008 at 3:57pm

Hi Timo,

yes, I was trying both, [spectroscope~] and [scope~] that is in the help file of fft.
I thought I just need to connect the signal, I made from the raw EEG with the FFT object and then I will see the bandwidths (alfa , beta, …).
But I think I did not understand fft. I know people use it with the raw EEG data, to see the amplitude of the different sidebands.

all the best,
Krisztian

This is my recent patch :

{
“patcher” : {
“fileversion” : 1,
“rect” : [ 1284.0, 112.0, 1016.0, 718.0 ],
“bglocked” : 0,
“defrect” : [ 1284.0, 112.0, 1016.0, 718.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“metadata” : [ ],
“boxes” : [ {
"box" : {
"maxclass" : "spectroscope~",
"domain" : [ 0.0, 60.0 ],
“patching_rect” : [ 508.0, 568.0, 446.0, 101.0 ],
“id” : “obj-78″,
“numinlets” : 2,
“numoutlets” : 0,
“range” : [ 0.0, 100.0 ]
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “RAW EEG float to MSP Signal”,
“patching_rect” : [ 285.0, 116.0, 201.0, 23.0 ],
“fontsize” : 14.0,
“id” : “obj-73″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”,
“presentation_rect” : [ 392.0, 117.0, 0.0, 0.0 ]
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “SONIFICATION of RAW EEG”,
“linecount” : 2,
“patching_rect” : [ 104.0, 537.0, 108.0, 39.0 ],
“fontsize” : 14.0,
“id” : “obj-70″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”,
“presentation_rect” : [ 153.0, 537.0, 0.0, 0.0 ]
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “SR”,
“patching_rect” : [ 979.0, 511.0, 25.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-48″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “SR/2″,
“patching_rect” : [ 756.0, 511.0, 34.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-49″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “4 128, range 0 10, drawstyle 1″,
“linecount” : 2,
“outlettype” : [ "" ],
“patching_rect” : [ 564.0, 412.0, 92.0, 31.0 ],
“fontsize” : 11.595187,
“id” : “obj-51″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “cartopol~”,
“outlettype” : [ "signal", "signal" ],
“patching_rect” : [ 548.0, 370.0, 77.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-56″,
“numinlets” : 2,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “scope~”,
“patching_rect” : [ 548.0, 451.0, 447.0, 59.0 ],
“rounded” : 0,
“id” : “obj-57″,
“drawstyle” : 1,
“bgcolor” : [ 0.529412, 0.529412, 0.529412, 1.0 ],
“numinlets” : 2,
“numoutlets” : 0,
“range” : [ 0.0, 10.0 ],
“calccount” : 4
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “fft~ 512 512 0″,
“outlettype” : [ "signal", "signal", "signal" ],
“patching_rect” : [ 547.0, 286.0, 133.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-58″,
“numinlets” : 2,
“numoutlets” : 3,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “real input”,
“linecount” : 2,
“patching_rect” : [ 557.0, 243.0, 39.0, 33.0 ],
“fontsize” : 11.595187,
“id” : “obj-31″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “imaginary input”,
“linecount” : 2,
“patching_rect” : [ 666.0, 248.0, 62.0, 33.0 ],
“fontsize” : 11.595187,
“id” : “obj-33″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “real output”,
“linecount” : 2,
“patching_rect” : [ 557.0, 309.0, 41.0, 33.0 ],
“fontsize” : 11.595187,
“id” : “obj-60″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “imaginary output”,
“linecount” : 2,
“patching_rect” : [ 617.0, 309.0, 55.0, 33.0 ],
“fontsize” : 11.595187,
“id” : “obj-61″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “sync signal output useful for windowing FFT (0 when output starts to number of points – 1 when it ends)”,
“linecount” : 4,
“patching_rect” : [ 683.0, 302.0, 155.0, 60.0 ],
“fontsize” : 11.595187,
“id” : “obj-62″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “Note: if only real inputs and outputs are connected, a real FFT is performed;rthis takes half the time of a complex FFT”,
“linecount” : 3,
“patching_rect” : [ 779.0, 394.0, 217.0, 46.0 ],
“fontsize” : 11.595187,
“id” : “obj-63″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “0 Hz”,
“patching_rect” : [ 547.0, 511.0, 32.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-66″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “Signal to analyze”,
“patching_rect” : [ 295.0, 286.0, 78.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-26″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “p analyzis”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 294.0, 359.0, 55.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-27″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”,
“patcher” : {
“fileversion” : 1,
“rect” : [ 20.0, 74.0, 990.0, 458.0 ],
“bglocked” : 0,
“defrect” : [ 20.0, 74.0, 990.0, 458.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“metadata” : [ ],
“boxes” : [ {
"box" : {
"maxclass" : "number",
"outlettype" : [ "int", "bang" ],
“htextcolor” : [ 0.870588, 0.870588, 0.870588, 1.0 ],
“triscale” : 0.9,
“patching_rect” : [ 616.0, 180.0, 159.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-1″,
“bgcolor” : [ 0.866667, 0.866667, 0.866667, 1.0 ],
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “* 44100.”,
“outlettype” : [ "float" ],
“patching_rect” : [ 616.0, 130.0, 53.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-2″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “t b f”,
“outlettype” : [ "bang", "float" ],
“patching_rect” : [ 699.0, 70.0, 29.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-3″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “dspstate~”,
“outlettype” : [ "int", "float", "int", "int" ],
“patching_rect” : [ 685.0, 45.0, 54.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-4″,
“numinlets” : 1,
“numoutlets” : 4,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“htextcolor” : [ 0.870588, 0.870588, 0.870588, 1.0 ],
“triscale” : 0.9,
“patching_rect” : [ 616.0, 106.0, 135.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-5″,
“bgcolor” : [ 0.866667, 0.866667, 0.866667, 1.0 ],
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “i”,
“outlettype” : [ "int" ],
“patching_rect” : [ 616.0, 156.0, 27.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-6″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “!/ 4.”,
“outlettype” : [ "float" ],
“patching_rect” : [ 616.0, 80.0, 31.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-7″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “Averaging is done over a period of time equaling four periods of the frequency looked for.”,
“patching_rect” : [ 615.0, 204.0, 363.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-8″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “+~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 50.0, 315.0, 27.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-9″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “average~ 96000 bipolar”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 214.0, 246.0, 119.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-10″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “average~ 96000 bipolar”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 50.0, 248.0, 119.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-11″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “*~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 214.0, 196.0, 27.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-12″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “*~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 50.0, 200.0, 27.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-13″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “*~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 214.0, 282.0, 27.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-14″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “*~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 50.0, 282.0, 27.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-15″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “+~ 0.25″,
“outlettype” : [ "signal" ],
“patching_rect” : [ 261.0, 106.0, 46.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-16″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “cycle~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 231.0, 133.0, 40.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-17″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “phasor~ 2″,
“outlettype” : [ "signal" ],
“patching_rect” : [ 212.0, 79.0, 55.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-18″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “cycle~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 182.0, 133.0, 40.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-19″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “inlet”,
“outlettype” : [ "float" ],
“patching_rect” : [ 212.0, 28.0, 15.0, 15.0 ],
“id” : “obj-20″,
“numinlets” : 0,
“numoutlets” : 1,
“comment” : “”
}

}
, {
“box” : {
“maxclass” : “inlet”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 50.0, 28.0, 15.0, 15.0 ],
“id” : “obj-21″,
“numinlets” : 0,
“numoutlets” : 1,
“comment” : “”
}

}
, {
“box” : {
“maxclass” : “outlet”,
“patching_rect” : [ 50.0, 337.0, 15.0, 15.0 ],
“id” : “obj-22″,
“numinlets” : 1,
“numoutlets” : 0,
“comment” : “”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “< - both required to be able handle the phase of incoming signal",
“patching_rect” : [ 303.0, 136.0, 288.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-23″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
],
“lines” : [ {
"patchline" : {
"source" : [ "obj-4", 1 ],
“destination” : [ "obj-3", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-3", 1 ],
“destination” : [ "obj-2", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-6", 0 ],
“destination” : [ "obj-1", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-2", 0 ],
“destination” : [ "obj-6", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-5", 0 ],
“destination” : [ "obj-2", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-7", 0 ],
“destination” : [ "obj-5", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-3", 0 ],
“destination” : [ "obj-5", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-20", 0 ],
“destination” : [ "obj-7", 0 ],
“hidden” : 0,
“midpoints” : [ 221.0, 57.0, 625.5, 57.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-16", 0 ],
“destination” : [ "obj-17", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-18", 0 ],
“destination” : [ "obj-16", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-10", 0 ],
“destination” : [ "obj-14", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-17", 0 ],
“destination” : [ "obj-12", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-10", 0 ],
“destination” : [ "obj-14", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-12", 0 ],
“destination” : [ "obj-10", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-1", 0 ],
“destination” : [ "obj-10", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-21", 0 ],
“destination” : [ "obj-12", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-18", 0 ],
“destination” : [ "obj-19", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-20", 0 ],
“destination” : [ "obj-18", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-14", 0 ],
“destination” : [ "obj-9", 1 ],
“hidden” : 0,
“midpoints” : [ 223.5, 307.0, 67.5, 307.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-11", 0 ],
“destination” : [ "obj-15", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-19", 0 ],
“destination” : [ "obj-13", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-9", 0 ],
“destination” : [ "obj-22", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-15", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-11", 0 ],
“destination” : [ "obj-15", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-13", 0 ],
“destination” : [ "obj-11", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-1", 0 ],
“destination” : [ "obj-11", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-21", 0 ],
“destination” : [ "obj-13", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
]
}
,
“saved_object_attributes” : {
“fontface” : 0,
“fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“globalpatchername” : “”,
“default_fontsize” : 12.0,
“fontname” : “Arial”
}

}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“htextcolor” : [ 0.870588, 0.870588, 0.870588, 1.0 ],
“triscale” : 0.9,
“patching_rect” : [ 386.0, 306.0, 84.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-4″,
“bgcolor” : [ 0.866667, 0.866667, 0.866667, 1.0 ],
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “scope~”,
“patching_rect” : [ 293.0, 382.0, 134.0, 122.0 ],
“rounded” : 0,
“id” : “obj-28″,
“bgcolor” : [ 0.529412, 0.529412, 0.529412, 1.0 ],
“numinlets” : 2,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“htextcolor” : [ 0.870588, 0.870588, 0.870588, 1.0 ],
“triscale” : 0.9,
“patching_rect” : [ 294.0, 305.0, 84.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-29″,
“bgcolor” : [ 0.866667, 0.866667, 0.866667, 1.0 ],
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “cycle~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 294.0, 332.0, 40.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-30″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “Frequency to look for”,
“patching_rect” : [ 384.0, 288.0, 106.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-34″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “zl group 4″,
“outlettype” : [ "", "" ],
“patching_rect” : [ 171.0, 120.0, 62.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-105″,
“numinlets” : 2,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “RIGHT “,
“patching_rect” : [ 526.0, 162.0, 42.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-93″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “LEFT “,
“patching_rect” : [ 409.0, 161.0, 33.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-92″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“patching_rect” : [ 271.0, 579.0, 50.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-81″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “+ 200″,
“outlettype” : [ "int" ],
“patching_rect” : [ 212.0, 479.0, 41.0, 20.0 ],
“fontsize” : 12.0,
“id” : “obj-80″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “+ 200″,
“outlettype” : [ "int" ],
“patching_rect” : [ 157.0, 478.0, 41.0, 20.0 ],
“fontsize” : 12.0,
“id” : “obj-79″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“patching_rect” : [ 212.0, 450.0, 46.0, 20.0 ],
“fontsize” : 12.0,
“id” : “obj-76″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “abs 0.”,
“outlettype” : [ "float" ],
“patching_rect” : [ 212.0, 427.0, 37.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-77″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“patching_rect” : [ 157.0, 449.0, 46.0, 20.0 ],
“fontsize” : 12.0,
“id” : “obj-75″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “abs 0.”,
“outlettype” : [ "float" ],
“patching_rect” : [ 157.0, 426.0, 37.0, 17.0 ],
“fontsize” : 9.0,
“id” : “obj-21″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “ezdac~”,
“varname” : “autohelp_dac[1]“,
“patching_rect” : [ 216.0, 647.0, 45.0, 45.0 ],
“local” : 1,
“id” : “obj-35″,
“numinlets” : 2,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “*~ 0.2″,
“outlettype” : [ "signal" ],
“patching_rect” : [ 216.0, 608.0, 74.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-36″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “panel”,
“varname” : “startwinwdow_panel[1]“,
“patching_rect” : [ 168.0, 642.0, 100.0, 55.0 ],
“border” : 2,
“id” : “obj-38″,
“bgcolor” : [ 1.0, 1.0, 1.0, 1.0 ],
“numinlets” : 1,
“numoutlets” : 0,
“bordercolor” : [ 0.392157, 0.792157, 0.117647, 1.0 ]
}

}
, {
“box” : {
“maxclass” : “number~”,
“outlettype” : [ "signal", "float" ],
“sig” : 0.0,
“mode” : 2,
“patching_rect” : [ 474.0, 160.0, 51.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-39″,
“numinlets” : 2,
“interval” : 20.0,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “cycle~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 216.0, 552.0, 44.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-40″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sig~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 446.0, 155.0, 32.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-41″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“patching_rect” : [ 111.0, 579.0, 50.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-8″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “ezdac~”,
“varname” : “autohelp_dac”,
“patching_rect” : [ 56.0, 646.0, 45.0, 45.0 ],
“local” : 1,
“id” : “obj-18″,
“numinlets” : 2,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “*~ 0.2″,
“outlettype” : [ "signal" ],
“patching_rect” : [ 56.0, 607.0, 74.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-22″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “comment”,
“varname” : “autohelp_dac_text”,
“text” : “start audio”,
“linecount” : 2,
“patching_rect” : [ 119.0, 660.0, 38.0, 33.0 ],
“fontsize” : 11.595187,
“id” : “obj-9″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “panel”,
“varname” : “startwinwdow_panel”,
“patching_rect” : [ 8.0, 641.0, 100.0, 55.0 ],
“border” : 2,
“id” : “obj-11″,
“bgcolor” : [ 1.0, 1.0, 1.0, 1.0 ],
“numinlets” : 1,
“numoutlets” : 0,
“bordercolor” : [ 0.392157, 0.792157, 0.117647, 1.0 ]
}

}
, {
“box” : {
“maxclass” : “number~”,
“outlettype” : [ "signal", "float" ],
“sig” : 0.0,
“mode” : 2,
“patching_rect” : [ 334.0, 158.0, 76.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-19″,
“numinlets” : 2,
“interval” : 20.0,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “cycle~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 56.0, 552.0, 44.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-20″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sig~”,
“outlettype” : [ "signal" ],
“patching_rect” : [ 299.0, 156.0, 32.0, 20.0 ],
“fontsize” : 11.595187,
“id” : “obj-23″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“patching_rect” : [ 212.0, 382.0, 46.0, 20.0 ],
“fontsize” : 12.0,
“id” : “obj-97″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“outlettype” : [ "float", "bang" ],
“patching_rect” : [ 212.0, 285.0, 50.0, 20.0 ],
“fontsize” : 12.0,
“id” : “obj-98″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “scale 0 1024 -100. 100.”,
“linecount” : 4,
“outlettype” : [ "float" ],
“patching_rect” : [ 212.0, 310.0, 50.0, 62.0 ],
“fontsize” : 12.0,
“id” : “obj-99″,
“numinlets” : 6,
“numoutlets” : 1,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “p hex to float”,
“linecount” : 4,
“outlettype” : [ "int" ],
“patching_rect” : [ 212.0, 212.0, 32.0, 62.0 ],
“fontsize” : 12.0,
“id” : “obj-90″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Arial”,
“patcher” : {
“fileversion” : 1,
“rect” : [ 1664.0, 224.0, 640.0, 480.0 ],
“bglocked” : 0,
“defrect” : [ 1664.0, 224.0, 640.0, 480.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“metadata” : [ ],
“boxes” : [ {
"box" : {
"maxclass" : "comment",
"text" : "I'm sure there's a better way to do this.nThis implementation relies on brute force.",
"linecount" : 2,
"patching_rect" : [ 159.5, 55.0, 270.0, 36.0 ],
“fontsize” : 12.0,
“id” : “obj-135″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “Integer out”,
“patching_rect” : [ 183.5, 395.0, 79.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-125″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “Hex symbol in”,
“patching_rect” : [ 128.5, 32.0, 96.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-123″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “1, 1;r2, 16;r3, 256;r4, 4096;r5, 65536;r6, 1048576;r7, 16777216;r8, 268435456;”,
“linecount” : 8,
“hidden” : 1,
“patching_rect” : [ 323.5, 235.0, 81.0, 94.0 ],
“fontsize” : 9.0,
“id” : “obj-121″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “prepend set”,
“outlettype” : [ "" ],
“patching_rect” : [ 387.5, 195.0, 82.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-111″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “t b l”,
“outlettype” : [ "bang", "" ],
“patching_rect” : [ 102.5, 161.0, 34.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-110″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “< ",
“outlettype” : [ "int" ],
“patching_rect” : [ 78.5, 246.0, 32.5, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-100″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “gate”,
“outlettype” : [ "" ],
“patching_rect” : [ 78.5, 272.0, 44.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-99″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “button”,
“outlettype” : [ "bang" ],
“patching_rect” : [ 58.5, 144.0, 20.0, 20.0 ],
“id” : “obj-94″,
“numinlets” : 1,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “defer”,
“outlettype” : [ "" ],
“patching_rect” : [ 58.5, 166.0, 42.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-92″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “coll pot”,
“outlettype” : [ "", "", "", "" ],
“patching_rect” : [ 265.5, 254.0, 59.5, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-89″,
“numinlets” : 1,
“numoutlets” : 4,
“fontname” : “Verdana”,
“save” : [ "#N", "coll", "pot", ";", "#T", "flags", 1, 0, ";", "#T", 1, 1, ";", "#T", 2, 16, ";", "#T", 3, 256, ";", "#T", 4, 4096, ";", "#T", 5, 65536, ";", "#T", 6, 1048576, ";", "#T", 7, 16777216, ";", "#T", 8, 268435456, ";" ],
“saved_object_attributes” : {
“embed” : 1
}

}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “p hexDigit”,
“outlettype” : [ "int" ],
“patching_rect” : [ 159.5, 254.0, 72.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-80″,
“numinlets” : 1,
“numoutlets” : 1,
“fontname” : “Verdana”,
“patcher” : {
“fileversion” : 1,
“rect” : [ 25.0, 69.0, 296.0, 315.0 ],
“bglocked” : 0,
“defrect” : [ 25.0, 69.0, 296.0, 315.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Verdana”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“metadata” : [ ],
“boxes” : [ {
"box" : {
"maxclass" : "comment",
"text" : "0-9",
"patching_rect" : [ 130.0, 100.0, 31.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-11″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “A-F”,
“patching_rect” : [ 248.0, 151.0, 31.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-10″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “a-f”,
“patching_rect” : [ 193.0, 125.0, 27.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-9″,
“numinlets” : 1,
“numoutlets” : 0,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “- 55″,
“outlettype” : [ "int" ],
“patching_rect” : [ 173.0, 176.0, 35.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-7″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “split 65 70″,
“outlettype” : [ "int", "int" ],
“patching_rect” : [ 173.0, 150.0, 74.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-6″,
“numinlets” : 3,
“numoutlets” : 2,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “- 87″,
“outlettype” : [ "int" ],
“patching_rect” : [ 110.0, 176.0, 35.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-41″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “number”,
“outlettype” : [ "int", "bang" ],
“patching_rect” : [ 55.0, 216.0, 50.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-40″,
“numinlets” : 1,
“numoutlets” : 2,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “- 48″,
“outlettype” : [ "int" ],
“patching_rect” : [ 55.0, 176.0, 35.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-38″,
“numinlets” : 2,
“numoutlets” : 1,
“fontname” : “Verdana”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “split 97 102″,
“outlettype” : [ "int", "int" ],
“patching_rect” : [ 110.0, 125.0, 82.0, 21.0 ],
“fontsize” : 12.0,
“id” : “obj-32″,
“numinlets” : 3,
“numoutlets” : 2,

#139635
Sep 9, 2008 at 4:30pm

do I understand it right that you receive a list of hex data that you convert to sound? And you want to monitor/analyze that signal in realtime with msp objects?

I think that if you receive the data the way you do no (as in: not at audiorate) than it is not advisable to analyze it in realtime. If you want to use fft~ (or pfft~ < -- check that as well, takes care of the windowing and overlap for you) and these signals you might want to record them first in a buffer~ with peek~ and then play and analyze the buffer~ if you have enough data for 1 analysis window. You need to make the translation yourself from your samplerate to the audiosamplerate.

And it’s useful to check out first wat fft does by analyzing normal soundsources like audiofiles first.

I don’t think max has non-realtime fft objects, apart from the jit.fft object. That is an option, but it might be a puzzle to interpret the results. First start out with checking how fft works and what it tells you.

btw, isn’t matlab better suited for what you want?
or rather: what is that you want eventually?

ps: you might wanna use ‘copy compressed’ next time for a file as long as this (or simply attach it)

#139636
Sep 9, 2008 at 5:11pm

thanks Timo,

//do I understand it right that you receive a list of hex data that you convert to sound? And you want to monitor/analyze that signal in realtime with msp objects?//

yes you are right! Later I would like try trigger midi notes with my brainwaves like this:

http://www.youtube.com/watch?v=kNp71xBDcMA&feature=related

As you are also suggesting to use Matlab, I think I need to get hold of it, as in the afore noted video it is used as well.

I will have to try to save the data in a buffer~ – but as I am thinking about real time performance, it would be out of question at the end of the journey.

I thought it is going to be easy to analyze the data after converting it in a signal, but I might be wrong.

… I will start experimenting with fft, to get a better understanding of it!

Thank you,
best,

Krisztian

#139637
Sep 15, 2008 at 7:56am

along those lines, anyone know if the soon-to-be-released cool-as-hell Emotiv headset will interface easily with Max? They never replied to mah email…

http://www.emotiv.com/

–CJ

#139638
Sep 15, 2008 at 9:06am

hi CJ

I was thinking about the get one of them, really cool, works without gel, without direct contact on the skin. A bit circumstantial to order from Europe.

I guess if you get the raw data, from the serial port… everything is possible…

best,

Krisztian

#139639

You must be logged in to reply to this topic.