Forums > Dev

accessing buffer~

March 7, 2011 | 11:48 am

it’s my second post on this topic, i’m writing it because it’s a more general question.

how can i access a buffer~ and copy all the amplitudes in an array of doubles in my external,
i need it to perform an fft using fftw3 library and write the output as a list of float on the first inlet, i want the external to perform the fft on an array of 4096 samples (zero padding if the sample in the buffer are less than 4096 or taking the first 4096 if the buffer is bigger) when receiving a bang in its left and only inlet.

i know how to perform the fft in a stand alone program, so i can write the method, but i cannot understand how to access the buffer, and also i don’t know if i have to write an msp external or just a max external (no inlet or outlets are sending/receiving signals) just bang -> inlet; outlet -> list of amplitudes.

thanks to all the community and of course to cycling74 for this software.

Attachments:
  1. Archivio.zip

March 7, 2011 | 2:40 pm

This might help:

http://74objects.com/2009/03/22/accessing-buffers/

from what I know you don’t necessarily need to make a msp external


March 7, 2011 | 3:24 pm

he wants non-realtime fft processing, and that is not really possible with max’ native fft objects (ok, maybe with the non-realtime driver)

what you could do though is do it in jitter, there are some examples for that on this forum


March 8, 2011 | 12:19 am

i don’t need DSP, so i’ll try to convert the external you send me in the other thread to a max external.

my project was to write a c program, that read a wavfile, perform FFT using FFTW3 library, than output the foundamental frequenecy amplitude, and all the harmonics amplitudes, and then use additive synthesis to create a similar sound. than i decided to convert it to a max/msp external because it was too easy for a degree thesis.

it’s not useful and not needed, but good for my purpose because in italy we have a project after 3 years of university and the real final project after 5 years.
this is my 3rd-year project, and my first external.
i hope in 2013 with some more experience i’ll code something better and maybe usefull.

anyway thanks a lot for your replies, i learned more in 3 days writing on the forum and reading forum posts than 10 days reading the sdk manual: it’s the power of the community.


March 8, 2011 | 7:33 am

i will share it for sure, i have been a linux user for a long time, sharing is my world :D



MIB
June 17, 2013 | 11:28 am

@STANZAROSSA did you ever figure out how to access the buffer in none-realtime? I am in need to do the same thing and any pointers would be really appreciated.

I am fairly new to the SDK, I did read the blog entry Timo mentioned above but I am not sure if that’s a purely MSP implementation or if that could be used in a Max environment as well…

Thanks!!



MIB
June 19, 2013 | 10:38 am

Here is what Timothy Place had to say. Scroll down to the comments. There is a link to tap.buffer.norm~ code which I am trying to make work right now…

http://74objects.com/2009/03/22/accessing-buffers/


Viewing 7 posts - 1 through 7 (of 7 total)