amlal / vlmc

Interactive VLMC using FSM paradigm. Based on Pachet's Continuator and prefix tree structure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<amarmlal [at] gmail [dot] com> amlal on github/bitbucket

Distributed under GNU GPL.

This is a variable-length Markov chain based on the prefix-tree structure described in Francois Pachet's work on the Continuator. Branch classes represent the 'tree branches' of the prefix tree. A single Tree class will contain several branches, encompassing the entire model. The Continuator class contains wrapper methods for interacting with this tree structure using the paradigm of Finite-State Automata. Methods include parsing sequences into the tree, generating new states (based on previous states), repeating states, or traversing backwards to a previously generated state in order to move in a different next direction. More than 3 repeated states cannot be generated by the new state generator. Working on methods to break loops of longer lengths.

In order to initiate this class,

model = Continuator(symbolic_seq,dictionary1,dictionary2,boundaries,maxlen)

where: 'symbolic_seq' is the sequence of symbols you wish to model. This program is designed to work with a list or np.ndarray of chars. This also applies the limitation that there cannot be more than 94 unique symbols in the sequence.

'dictionary1' and 'dictionary2' contain features or vectors associated with each of the unique symbols in the symbolic sequence. These are included so the model can be pickled and used independently of an analysis method. In future versions, you will be able to use the model without these.

'boundaries' are the list location indices of boundaries that should be used to segment the symbolic sequence. In the context of music, these are used to segment the symbolic sequence into phrases.

'maxlen' is the maximum allowed phrase length. This will be deprecated eventually.

For further interaction,

new_state, associated_vec1, associated_vec2 = model(type="next")

previous_state, associated_vec1, associated_vec2 = model(type="prev")

same_state, associated_vec1, associated_vec2 = model(type="repeat")

model.printTree() prints the tree branch by branch

the default __repr__ method prints the current memory of generated states

more to come....

About

Interactive VLMC using FSM paradigm. Based on Pachet's Continuator and prefix tree structure


Languages

Language:Python 100.0%