Changing between beats and keeping a counter in sync?

Dr. Spankenstein's icon

This patch has one bar divided into 4ths, 5ths and 6ths. They drive a counter that bangs on the first beat of every bar.

The problem is that when I change between 4ths, 5ths and 6ths from the menu the first beat will change timing slightly and the interval between the first beat of each bar wont be a constant 2000ms.

How can I change between the beats and still keep everything in sync and constant?

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

Thanks

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

Dr. Spankenstein's icon

Thats a great alternative to clocker objects but it doesn't solve my problem, unless I am missing something here?

I can't change between 4ths, 5ths and 6ths and keep the interval the same at 2000ms (if the transport is at 120bpm).

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

Thanks again.

Andrew Pask's icon

I'm not sure why you need to have what you have, but the act of changing the beat counter will always introduce a kind of "error" I guess. Not knowing your context it's kind of hard to figure out what to say. Is what you're trying to do something like cross fading between pulses?

-A

Andrew Pask's icon

In any case - you don't need to count the beats in order to maintain a constant bar length - this is done for you by the metro with interval of 1 bar.

-A

Dr. Spankenstein's icon

Imagine a sequencer where you can change the resolution on the fly.

I can go from one bar of 4 steps to one bar of 5 steps, representing 1 bar of 1/4ths and 1 bar of 1/5ths respectively. It wouldn't make sense to have a sequencer for each possible division!

In the case of the patch with the timing error, I chose it to bang at the beginning of each bar as it was a common time difference between all potential divisions.

Does that make sense or can you please suggest a better way of doing this?

Thanks

Andrew Pask's icon

It goes like this

1/5 + 1/5 + 1/5 + 1/6 + 1/6 + 1/6 != 1 bar

For example.

I still don't really understand what you're trying to do, but maybe you should have more of a play with transport and Max's timing stuff.

-A

Dr. Spankenstein's icon

OK I've found a method that works. Is this viable or do you think I'll come a cropper at some point?

I'm never gonna have a resolution as low as two ticks!

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

Thanks

Andrew Pask's icon

Today has been a very weird day. I don't understand your changes at all, but it may just be that I should give up trying to use my brain entirely.

You're welcome to send things to me me off list till we can figure this out.

-A

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

Dr. Spankenstein's icon

Don't worry your brain is working just fine. I'll be sticking with my new method but if I do run into any problems with it then I'll send you a PM.

Thanks for the help.

Adam Murray's icon

I didn't look close enough to really understand your solution, but I think the fundamental problem you were having is using a single counter. If you change your measure division in the middle of the measure, since the counter was part way through counting the measure it thought the end of the measure arrived too early or too late.

Here's a couple solutions to this issue:

1) Use a separate counter for each measure division (probably between the [r 4/5/6ths] and the [switch])

or

2) When the menu changes, put the new menu value in something like an [int] or [zl reg] and hold it there until the next downbeat, then update the measure division right at the start of the measure.

Actually, I just took another look at your latest patch and you went with option (2). That's a good solution :)

fairesigneaumachiniste's icon

I'll say now I didn't actually look at your patch but here's something you could maybe adapt.

Bar length is constant across a variable number of intervals.

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

Dr. Spankenstein's icon

Thanks for the alternative. I have to say that I have fallen in love with transport. Another plus point for Max 5!

I have only migrated to Max 5 recently and already I don't miss Max 4.

Brilliant! :)