MaxMSP like buffer~ and groove~

is it possible to make a buffer with recorded sound (from input) and play the contents like it’s done with max msp buffer~ and groove~ objects?

(the buffer~ object has the audio and the groove~ object plays the sound with the possibility to loop it, change reproduction speed)


yes you could totally do this with ofSoundStream. Here’s an example with looping (but no speed changes)[attachment=0:2g9fexx9][/attachment:2g9fexx9]

thanks for the quick reply. will try that tomorrow (tonight is my birthday so i’ll be drinking some gin instead of coding)


No problem…I had the code lying around, just had to quickly clean it up. Hope its useful…and yeah gin is more important!

hey. i’ve tested the code, but i get an error…

RtApi: no devices found for given stream parameters:   
    RtApiCore: OS-X error setting sample rate or data format for device (Apple Inc.: Built-in Output).  
    RtApiCore: unable to find OS-X audio stream on device (Apple Inc.: Built-in Microphone) for requested channels (2).  
    RtApiCore: unable to find OS-X audio stream on device (Apple Inc.: Built-in Input) for requested channels (2).  
RtAudio: stream is not open!  

i’m on a macbook pro, with 10.5.8 and of 0.6

the sound preferences shows me that the built in microphone is active, and i see the input level changing, but the app doesn’t get any audio…

hmmm if i change in the .h file the samplerate to 44100 it works. shouldn’t it work with any samplerate independent of the current OS settings?

Not necessarily…depends on your sound hardware. Typically the OS takes care of the sample rate, but at the code level you can change this.

You can use rtAudio to query the available sampling rates, though this is not a standard OF function, though come to think of it maybe it should be.