markov applied to music?

Mike Brenner mikeb at
Tue Jan 23 21:02:35 CET 2001

> Plan A. ... generate more complex game music based on a static score: i.e. ... apply the Markov chains to the ... score. ...

> Plan B. ... take a score with a gradually changing mood and use a sliding window to determine what portion of the score is used, thus allowing a "mood" parameter to control the output.  Whenever the mood changes, the markov chain generator would have to  re-analyze the new window and start generating output. ... I presume the Markov algorithm would take care of the transition problem, so that it doesn't just sound like random clips all hashed together. Would it be feasible to use the module to do this sort of thing?

The Markov algorithm alone would not take care of the transition problem
because it requires consciousness over more than just the previous few
notes. The mood is a function of the emotion (i.e., helpful vs. hurtful
of our goals, approved vs. tabu of our values, immediately satisfying
vs. requiring patience of our valuable time, true vs. illusionary,
pleasant vs. yucky of our sensibilities,  creative loving vs. boring
usualness, service to the planet vs. satisfaction of compulsive
addictions, and will vs. fate). These would require several parameters
over a period of time in order to recognize, or in order to generate.

Part of the problem is the inherent blurring between nouns and verbs at
the Markov Chain level, because of the duality of the nodes and the
edges. It is like a reversed parse (esrap) where a probabilistic context
free grammar GENERATES sentences instead of taking in a sentence and
matches it to a grammar. The same happens with the moods of the music.

To implement this in Python requires several steps: an emotional
repository, an method of discovery of the mood of the current game
segment, a method of composing two moods, a method of transitioning from
one mood to another, a reverse mapping from the emotional repository to
each game-world context, hyperlinks between each of the game parameters
into the emotional repository and the into the context encyclopoedia, a
fast method of looking all of this up (like a semantic web), clustering
tools to bring together those contexts which have similar emotions,
personoid simulators that apply the contexts to various personality
types (warrior, thief, mage, maiden, errand boy, or whatever), etc.

The exponential nature of the interactions is reduced considerably by
the fact that most of the emotions humans feel is of the first (greedy)
type: either you are helping along my path or you are holding me back,
and the second most is the good-evil: do I approve or am I disgusted by
your behavior. This takes care of at least 80 percent of the emotional
space of mortal human beings.

I believe that mere Markov chains are just one of the many tools needed
to generate the proper emotional responses to the game contexts.

Mike Brenner

More information about the Python-list mailing list