scamp_extensions.process.markov.MarkovIterator

class scamp_extensions.process.markov.MarkovIterator(markov_model: MarkovModel, order: float, start_values: Optional[Sequence] = None, keep_looping: bool = False)[source]

Bases: object

Iterator that returns generated values from the given MarkovModel. Order can be fractional and can change during iteration.

Parameters:
  • markov_model – the MarkovModel used for resynthesis.

  • order – the Markov order used in generating new states. Can be floating point, in which case the order for any given move is a weighted random choice between the adjacent integer orders.

  • start_values – Values with which to seed this iterator’s history. If none, simply starts at random state from within the data set.

  • keep_looping – if True, then when we hit a dead end, keep reducing the order by one until we find a next move (once it gets to order zero, it just chooses randomly)