subdiv~ question (bug?)

vojko v's icon

Why does [subdiv~ 5 @pattern 2 3] give a "broken" ramp pattern and [subdiv~ 5 @pattern 3 2] gives a nice clean one?

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

Zoy's icon

Hello, I'm also trying to figure out how the pattern system work with subdiv~, many exemples don't make any sense at all... Did you decipher it ?

vojko v's icon

[subdiv~ 5 @pattern 3 2] will take an input signal ramp from 0 to 1 and it will output one ramp that will be 3/5 (three fifths) the length of the input ramp and after that it will output one ramp that will be 2/5 (two fifths) the length of the input ramp, and then repeat.

connect a live.scope~ it should clear things up.

Source Audio's icon

subdiv~ patterns are not doing what is described in documentation.
only few pattern combinations work as expected.
for example with subdiv~ 5

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


patterns like 2 3, 1 1 3, 1 3 1, 1 4 - no chance
4 1, 3 1 1 , 3 2 , 2 2 1, do work.
even 3 2 2 2 1 4 1
simply a bug


enrico wiltsch's icon

I could notice the same strange behavior

enrico wiltsch's icon

Bug fixed!!

vojko v's icon

thankfully that is.

but now I'm trying to figure out what exactly are the right two outlets of subdiv~ outputting.

the numbers make sense when there is no pattern involved, but when you insert a pattern into the subdiv~ I don't get it at all.

Source Audio's icon

what worked in max 8.3.3 for patterns that did output correctly,
got again broke in "fixed" subdiv~ version of Max 8.5 :
step numbers don't display correctly, both signal and non signal outlet.
that are 2 outlets you are asking about.







vojko v's icon

yeah, it looks like subdiv~ still broken

Wetterberg's icon

Updating this to say that subdiv~ appears to still be broken... sad, there's so much potential there.

It's really odd, like, the step output will go negative?

Wetterberg's icon

oh btw I've found a temporary fix for parts of this. If you add, say, +~ 4 to the output and then %~ 1 you can remove most of the glitchiness of the left outlet.

MakePatchesNotWar's icon

Somewhat similar post here:
https://cycling74.com/forums/resetting-pattern-in-subdiv-is-bugged

Lets hope C74 finds a solution for this soon! As for your solution, isn't that unnecessary if you check for the delta going below 0? Regardless if the ramp is negative the delta only goes below 0 when the phasor resets.

MakePatchesNotWar's icon

Made a humble attempt at recreating the functionality in Gen but got stuck at finding a way to load in lists to Gen. Only way i can think of is writing the values to a buffer but that seems a bit clunky? At least the probability is working :)

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

<Edit> but the pattern-message is ofcourse why subdiv is so great

Steve Meyer's icon

Using a Buffer as an array in gen~ is a good strategy. See the urn example here:

Another option for cases like this where the list can be just 1's and 0's is just to use an integer and decode it to a list of the binary representation. Here's a rudimentary example:

The drawback in this example is that the total number of divisions are fixed in the genexpr code.

vojko v's icon

8.5.3. subdiv~ still shows wrong step numbers in pattern mode

Jean-Francois Charles's icon

Hmm, taking the patch you posted at the top of the thread, it looks like it's working. Isn't it? What's the problem, maybe I just don't get it.

vojko v's icon

That is fixed, a new problem showed up: when you send a pattern message to subdiv~, the middle and the right outlets don't give expected step numbers

Ben Bracken's icon

@VOJKO can you post an example patch?

vojko v's icon

Here it is, side to side comparison of a [subdiv~ 7] and a [subdiv~ 7 @pattern 2 3 2]

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

HAZELLY MORES's icon

When there is no pattern involved, the numbers make sense, but when you add a pattern to the subdiv, I don't understand it at all.