< Back to IRCAM Forum

Help with context-sensitive cellular automata in Patterns Library

Hi all! I was wondering if someone more experienced could explain to me how to implement a context-sensitive cellular automata using Patterns library (p-rewrite). I don’t get the patch example “010 c - rewrite - context sensitive harmony” at all :frowning:

I got how to make context-free CA, using p-transition, p-rewrite-node and p-rewrite, but when trying to use the syntax for the context-sensitive case, i can’t make it work. I’m not sure what i’m doing wrong. Here’s a patch of me trying to make it work, using the syntax present in the tutorial patch “010 a - rewrite intro”

failing to make a context-sensitive CA.omp (241.8 KB)

1 Like

I don’t get the patch example “010 c - rewrite - context sensitive harmony” at a

It doesn’t work? Can you tell us a bit more? It’s working here, but there might be some bug somwhere lurking, great to get a chance to fix these.

hmmm… may it be you didn’t get the “initial transition” (ie. initial generation) of the rewrite right? Try putting in one of those you specify in your rules, e.g. (0 0 1)

oh, you mean it’s intricate? :slight_smile:

Probably the programmer was too lazy documenting… someone should explain how this patch works in a more musically meaningful way.

But OM is quite helpful actually. One great thing is it can function as a quasi code stepper, ie you can eval anywhere in the graph and see whats happening at that point.

In the pattern classes, if you connect a 'p-next’box to a (locked) pattern-object, you can see how the state changes. Try connecting a ‘p-next’ to the (locked) p-rewrite box in the center, you can eval the ‘p-next’ some times, and see the output change according to your set of rules.

You can also try ‘eval’-ing the various ‘get-pval’-boxes around in the sub-patches, and see how their values change

1 Like

actually, just saw now that in 010c, if you lock the p-rewrite in the middle, so the output chord-seq changes each time you eval, its possibly easier to get a sense of whats happening?

1 Like

Yesssss that was it, silly me! I was always starting from just one element, so no rule applied to make the second generation, so it always returned “Error while evaluating the box P-NEXT : Rewrite generation #2 is empty!”

Now it works! Can’t wait to experiment some more, thanks!

Yeah that’s very helpful in most cases, but the thing that makes that patch hard to understand to me is that it uses the pval stuff that sends values across the patch, making it hard to understand how it works in a step by step basis :confused: