accessing buffer~

    Mar 06 2011 | 3:29 pm
    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 06 2011 | 7:37 pm
      the later.
    • Mar 06 2011 | 8:39 pm
      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 06 2011 | 9:08 pm
      I didn't read abiut the zip... I'll post it later i'm sorry :P
    • Mar 06 2011 | 10:01 pm
      here's the zip
    • Mar 07 2011 | 3:35 pm
      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