# Stochastic Markov Beats

[Attoparsec] has been building intriguing musical projects on his YouTube channel for a while and his latest is no exception. Dubbed simply as “Node Module”, it is a rack-mounted hardware-based Markov chain beat sequencer. Traditionally Markov chains are software state machines that transition between states with given probabilities, often learned from a training corpus. That same principle has been applied to hardware beat sequencing.

Each Node Module has a trigger input, four outputs each with a potentiometer, and a trigger out. [Attoparsec] has a wonderful explanation of all the different parts and theories that make up the module at the start of his video, but the basic operation is that a trigger input comes in and the potentiometers are read to determine the probabilities of each output. One is randomly selected and fired. As you can imagine, there are loops and even dead-end nodes and for some musical pieces there is a certain number of beats expected, so a clever reset signal can be sent to pull the chain back to the initial starting state at a regular interval. The results are interesting to listen to and even better to imagine all the possibilities.

The module itself is an Arduino-based custom PCB that is laid out quite cleanly. The BOM, code, and KiCad files are available on GitHub if you want to make one yourself. This isn’t the first instrument we’ve seen [Attoparsec] make, and we’re confident it won’t be the last.

Thanks [smellsofbikes] for sending this one in!

## 7 thoughts on “Stochastic Markov Beats”

1. lukilukeskywalker says:

Really an interesting Idea. And awesome board, even if the crystal is so far away from the micro-controller. It shows what dedication can create

2. repkid says:

that’s pretty cool

1. smellsofbikes says:

He comes up with a lot of “you did WHAT” ideas, many of which explore topics in computer science in ways I never expected.

3. BrightBlueJim says:

The thing that bothers me is that I don’t see how to implement a mostly-regular beat with these. That is, if I want something that’s mostly in 4/4 (but with variations in which instrument is used on each beat), but which occasionally throws in a 5/4 or 3/4 measure, I don’t know how to get there. Like, maybe there are four nodes, one for each beat, where the outputs from each node trigger different instruments, with beat 1, for example, almost always being a bass. But then it seems like I’ve fixed the measure to four beats.

Comparing this with the linguistic application of Markov chains, it’s like trying to implement poetry in a state machine that doesn’t recognize a higher order of meter, such as by treating words with different numbers of syllables differently. It just doesn’t work with a single loop – there’s more than one state involved, the state within a chain that only cares about what can follow what, and an overriding chain that only cares about the syllables.

But maybe that’s what the reset input is good for. ? Like, if you have a chain that separately counts the beat, it can almost always reset the lower-level chain that chooses the instruments after N beats. ?? Doesn’t work for the poetic application, since it would cut off phrases that were not complete, and likely would have a similarly discordant effect on a beat, where the inner loop with very high probability wants there to be a hi-hat, but the outer loop says “nope. beat 1 now”.

And while Googling for a better word to replace ‘discordant’, I come to “is it possible to design chaos in music?”, to which I knee-jerk say, “design chaos? No. If you design something it is by definition not chaotic.” But that’s not right either, because chaos is something we deliberately throw into all things creative, because no matter how long a sequence is (temporally or spatially), if it is deterministic it is boring.

So yeah, it concerns me.

4. Mike says:

I only grasp a fraction of what is going on here, but I can see the theory and the result is very impressive.

5. So this is how 90’s spam email sound? Sounds great! I think there are some implementations of this in PureData (or PurrData) and MaxMSP if I recall correctly, in case you have not soldered your eurorack psu yet.

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.