Page 1 of 1

setting buffer length with counter rather than argument.

Posted: Wed Aug 10, 2011 5:33 pm
by ned rush
i wanted to figure out a way to could record into a buffer without giving the buffer a length argument, so i could record for an indefinite length of time. using a metro and a counter plus a waveform~ to reference the buffer the signal works but nothing seems to record into the buffer. is this because the buffer cannot record whilst it is being re-sized? please see attached audio effect.

thanks
ned
:)

<pre><code>
----------begin_max5_patcher----------
1470.3oc6Z9ziiZCE.+blOEnndpZ5T+WHtpW1U8Rk1S8ZaUEg3jwU.NBblc1
tZmO6EaCIjYBDGvDkc0dX.ddHvy+34264m8mua17kxm4kyC9kf+LX1rOe2rY
llzMLqVd17r3mSRiKM217LdYY7F976s+OE+YkocXSKqk4pRw+w0sBAO.paNe
WlbmJkqLOFXcq1lTeZK2pCymG72sdN4wYl+w72UHhSCduLcUyqYarJ4QQ9l+
ofmnr+XLNr50EPflSXzCz6CzWu+QJVYdXxk+6OQIyOnXh7F8Boa6K2cm9v8N
Rjb9GqdhuAHox3UKiy23GtXdRifMTzBMTfKH5STpUnC1fNIafCfMIxrLdt5M
vofWphKT+bRJOt3hHDXvHf.LH.QMlGPJnWF.lbFXIPoRtMnRIkEqpT2+J+JA
Cbn0dfgb.FjHuAi0oxpmwE0IQcMln5YEWg0wO3nwwAwPgyvBp2XQGNN9wWBf
O3GuFkhM4wod.MTDnkO0tPCbp8oV0ed4FiLjPiGULrOiF7jazroPJeh+RfRj
w8ynqZBcuOYEybJB2KqNcjYr+Xk0a6.X0DZMgV.ZEbJpeqIj2HTWYyoQQvOb
KjSG0DfBSM1LDqkSG4zg8m+mN4BW4QyFOjPGhXNYO1EXPLuAlOF+DesrHaua
3RdZkNIj4IxTYgU2.OvfQgjn60WQX.j9B.s4J5dc7XNEd1.88bQpnzb9.SWt
a8Zdwdp19yl96YK8c+OoGNGYsCwFKPTUfvSS5SmoD0eNur8JqyqpTU.fasbo
pGvZmnAqWW8H7jmKkFE9YvpkPdfL.54SkBA71H1k6TJY97wLcyS0YrSb.QiL
m.MGO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p6AOzosPrq9
jQ5JDr3ByzncrhCWeEBULnHEV87v0GomUBe4t+GPIVJhg
-----------end_max5_patcher-----------
</code></pre>

Re: setting buffer length with counter rather than argument.

Posted: Wed Aug 10, 2011 9:21 pm
by broc
From the reference page
If no duration is typed in, the buffer~ has no sample memory.

Re: setting buffer length with counter rather than argument.

Posted: Wed Aug 10, 2011 10:14 pm
by broc
ShelLuser wrote:
broc wrote:From the reference page
If no duration is typed in, the buffer~ has no sample memory.
I read that too. However, I don't know how / if that affects recording considering that even without any sample memory you can still load an audio file into a buffer. One way to look at that is that in both cases the buffer~ has to process an amount of audio data.
Yes, but when loading an audio file the amount is known, in contrast to recording. It's a matter of memory allocation.

Re: setting buffer length with counter rather than argument.

Posted: Fri Aug 12, 2011 1:02 am
by audiolemon
I think you might have to set a limit but it can be very large. Yo could set a very big buffer~ size say 600000 which would be 10 mins and then a user set option for even bigger? In Pro-Tools you have to set a max recording time limit.

Out of interest why do you need an infinite buffer~? I am not sure I see the use of an infinite buffer~ unless you plan on making a DAW or Audio Editor which Live already is. What I might do instead would be to add a dropfile in an M4L patch, record into Live directly, and then consolidate a few edits or select the whole lot, cmd click to show in browser, and then drag into the dropfile in your M4L patch.

Or record it into Live directly and then set up a footpedal or something to activate the record~ object in your M4L patch. You might be able to set up some kind of prebuffer~ using poke~ to constantly fill the start of the buffer~ for a user set amount of time and then switch to record~ when a user presses a button but start record~ from the index of the count driving poke~. That way you should be able to get the last x minutes before the user hit the record button. So you don't miss a nice jam bit by hitting the button after you do something good. I have not tried it but it sounds like it might work.

Re: setting buffer length with counter rather than argument.

Posted: Fri Aug 12, 2011 9:42 am
by ned rush
i never said i wanted an infinite buffer, i said i want to record for an indefinite amount of time, this could be anything from 10ms to 5000ms.

did anyone look at the patch? really my question was more a 'whats wrong with this picture?' it seems maybe that using a counter to set the buffer length doesnt agree with buffer~, so now maybe i am thinking i could bang that value to a buffer once the counter has stopped? dunno, just thinking out loud now... :)

Re: setting buffer length with counter rather than argument.

Posted: Fri Aug 12, 2011 9:45 am
by ned rush
ShelLuser wrote:have you tried using a buffer without said argument already ?
hmmm, can't remember if i did that in the patch already, but i'll certainly try that.

Re: setting buffer length with counter rather than argument.

Posted: Fri Aug 12, 2011 1:05 pm
by audiolemon
I did try to send a new size message to the buffer~ while it was recording and it did work. I used large messages like one every 2000 ms but it worked. You'd have to do more then, maybe a clocker or something to set the size message dynamically - the buffer needs to be cleared everytime before you start recording. It seems like a lot of work though I still think the best way would be to just set a buffer~ to be longer than the time you are likely to record for. Especially easy if you are only dealing with 5000ms. You could do this and put record~ in loop then you would have a indefinite recording time larger than any length of time you are likely to record for.