Skip to content

Possible bug in MarkovSetN #31

Description

@jreus

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions