So I was having trouble with my code, where basically I am determining the size of a buffer (which is just an array within my object's structs) in samples, then recording into that buffer and then playing back from that buffer (eventually I would like to be able to manipulate the playback in certain ways, but first I just want to be sure it can playback). However, whenever I tried to record into the array ( x->t_buff[index] = *in++ ), max would crash.
I thought it might have to do with the dynamic memory allocation I have for determining my buffersize, so I tried to make my buffer a fixed length. However, when I had a buffer of a fixed length within my object's struct, Max would crash as soon as I tried to create the object (it would crash on the first line of the new method, during my newobject() call).
I've included my code for both the code that doesn't have an array in its struct, and only uses dynamic memory allocation, and the code that has the array. Please let me know what the problem could be.
Much thanks for any help.