I’m trying to set the buffer~ and record~ object’s sizes dynamically, either by using the timer object, or counter, but none seems to work.
The size of the buffer and record do change, but no input is given, so nothing is being recorded.
I have also tried to set the size to a quite greater length at the beginning (when using counter), so that I’m sure the new size won’t exceed the already existing one, but that won’t work either. I have attached a patch with both efforts.
I am not sure what you mean by "no input is given". One thing to be aware of is that when you resize buffer, everything that is in the buffer is lost. for example, you can NOT set the buffer to 5000, start recording and then decide you actually need 10000 worth of sound. You will loose everything you recorded up to the point when you send the "size" message.
If you need to do recordings without knowing the length of the sound in advance, use [sfrecord~] instead.
I thought about that too, but everytime you want to record and playback, you need to set the saving location.
The thing is that I want to use this idea for a sound installation, so it has to be there and everything has to be set dynamically and automatically.
I guess then that I’ll have to kill my darlings and go for preset buffer sizes, right?
Thanks for the answer though.
as pid says, it’s easy enough to automate the creation of the filename for sfrecord~ and sfplay~. have a look at the [sprintf] object. if you use it with something like this [sprintf myFileName%d] and then send it a number you will end up with outputs like: myFileName1, myFileName2; From there it should be easy…