[SOLVED] Need help using buffer~ to store sample accurate marks

Regis Planque's icon

Regis Planque

6月 09 2024 | 1:06 午後

Hello!

I have a problem that I don't understand.

Here is the Patch.

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

Basically I use the Gen~ to fill a buffer~ with sample accurate marks

The buffer~ is a two channels buffer. I use the first channel to write sample marks and the first sample of the second channel is the index of the sample that is currently counting on the first channel.

Everything works well most of the time, but sometimes the counting happens on the wrong sample. I mean, the sample index and the counting sample don't match.

I really don't understand where the problem is.

If you let the patch run for about 5 minutes you should be able to see the problem several times.

Can someone help me?

Thanks!

Regis Planque's icon

Regis Planque

6月 10 2024 | 5:39 午前

Someone Please!

Source Audio's icon

Source Audio

6月 10 2024 | 7:51 午前

stop metro and counter in gen when you get mismatch,

and check current values in buffer.

Regis Planque's icon

Regis Planque

6月 10 2024 | 12:38 午後

I figured it out.

I don't know why but the output of the [%] in the gen~ was sometimes a little bit lower than the integer value. I don't know if this is a bug or if it can happen with float32 format.

I solved my problem by adding a [round] after the [%]