I found a possible bug in the behavior of MarkovSetN. I'm in the process of trying to find the source.. but perhaps it's more obvious to ya'll with your familiarity with the code.
Here's an example code snippet that reveals the error (I'm running SC 3.10.4 on Ubuntu Linux)
a = Pseq([[1,1],[2,2],[1,1],[3,3],[2,2],[4,4],[3,3],[1,2],[1,1],[4,4],[1,2]], inf);
b = MarkovSetN.fill(30, a.asStream, 2);
b.makeSeeds;
c = b.asStream;
c.next; // produces scalar values sometimes...
repeated evaluations of c.next shows the following in the post window:
chose a seed at random
-> [ 2, 2 ]
-> [ 1, 1 ]
-> 3
chose a seed at random
-> [ 1, 1 ]
-> [ 2, 2 ]
-> 1
chose a seed at random
-> [ 1, 1 ]
-> [ 4, 4 ]
-> 2
Similar behavior is encountered when using Pfsm2
Pbindef(\mkv2, *[amp:0, markov: Pfsm2(b, inf), dur: 1, print: Pfunc({|e| e.markov.postln})]).play;
I would expect the stream to always return a 2-element array. Unless I'm misunderstanding how MarkovSetN is intended to work?
I found a possible bug in the behavior of MarkovSetN. I'm in the process of trying to find the source.. but perhaps it's more obvious to ya'll with your familiarity with the code.
Here's an example code snippet that reveals the error (I'm running SC 3.10.4 on Ubuntu Linux)
repeated evaluations of
c.nextshows the following in the post window:Similar behavior is encountered when using
Pfsm2I would expect the stream to always return a 2-element array. Unless I'm misunderstanding how MarkovSetN is intended to work?