Gap of one I/O vector size with count object

7391's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hello
I can't understand why I have to add the I/O vector size to have the right number of recorded samples from count in this simple patch ?
thank you very much for any explanation.
C.

Tj Shredder's icon

You are controlling your recording with scheduler events. They can't be more exact than the scheduler event interval. If Scheduler in audio interupt is checked, the event interval is the vector size. If not its default is 2 ms...

What are you trying to do? I have no idea...
Anyway, if you want sample exact results, try to do all in the signal world...
If you just want to write an exact formula into a buffer~, look at peek~ which could fill the buffer~ in nonrealtime even without audio being switched on...

Stefan

7391's icon

Thanks a lot Stefan

I understand your clever point of view.
I think it's something like that but not exactly.

The idea is to loop an audio signal in real time - the posted patch is only an extract from the complete one. So the start-stop can't be from the signal world since it is decided by the musician and I have to use poke, right ?

The strange thing is that I control two audio objects with the same scheduled event but the written part of the buffer is -apparently always- one I/O vector size longer thant the count object's result (I check it each time in an external editor)

Do I miss something ?

Max Patch
Copy patch and select New From Clipboard in Max.

Here a more simple example yet