accessing buffer~

Mar 6, 2011 at 3:29pm

accessing buffer~

hi everybody,
first of all i’m a newbie in programming and i’m writing this external as the final project for my thesis at university.

i’m trying to access a buffer and copy all the values in an array of doubles,
but max crashes everytime i try to access the buffer.

these are the methods i’m trying to write

void fftesi_bang(t_fftesi *x)
	post("bang received, provo a leggere il buffer");
	t_buffer *buf = x->l_buf;

void copio_campioni(t_buffer *b)
	//float *tab;
	long i, chan;
	//double current_samp = 0.0;
	post("speriamo bene");
	i = 1; chan = 1;
	if (!b->b_valid) {
	//copio il valore corrente in un array di dimensione 4096
	tab = b->b_samples;
	chan = 0; //usiamo solo il canale left
	for(i=0; ib_frames; i++)
		segnale[i] = tab[i];
		post ("letto campioni");

the zip file contains the dir placed in MaxSDK-5.1.6/examples/ with my xcode project.

thanks to all

Mar 6, 2011 at 5:11pm


is this code compilable ? i don’t think so.

where segnale is declared ? why *tab is // ?
why chan = 1 then chan = 0 ?

it looks like desesperate try to adapt Tim Place code ;-)

Can you post your zip again (or just the .c) ? don’t forget to “Upload” it.

Mar 6, 2011 at 6:29pm


as i investigated a little,
i have a question about interleaved frames ;

for instance with two channels A and B is it :





i cannot remember,

thanks …

Mar 6, 2011 at 7:37pm

the later.

Mar 6, 2011 at 8:39pm

I’m sorry i didn’t explain!

The part between /* is commented because i was tryin to find my mistake, and the chan=1 i=1 is written just to avoid the warning msg “unused var”

Even the tab declaration is commented necause tab is used in the commented part. The error is of course in the uncommented part!

If you download the zip file you get a buildable dir, but max crashes if i send a bang to left inlet

Mar 6, 2011 at 9:08pm

I didn’t read abiut the zip… I’ll post it later i’m sorry :P

Mar 6, 2011 at 10:01pm

here’s the zip

Mar 7, 2011 at 3:12pm

Hello stanzarossa,

a quick example ;


Mar 7, 2011 at 3:35pm

if you are in Milan in the week before Easter, you will get a pair of beer because a little bit of my degree is your.

thanks a lot



You must be logged in to reply to this topic.