Genetic algorithm based drum sequencer for max4live

Genetic algorithm based drum sequencer

Sound Demo:


I had some spare time this weekend so I decided to spend it learning max4live and max/msp in general. As a first project I choose a genetic algorithm driven drum sequencer as my experiences in the past with something similar that I wrote in Processing were overall very good and musical. If you don’t know what genetic algorithm is or how it works here is my post from other topic explaining the idea:

Device can be used to drive both drum tracks and melodic tracks as can be heard at the sound demo at the beginning of the post.

If you encounter any problems or have any ideas for improvements feel free to raise them here or at github but I must warn you that I have only around 20 something days of max4live trial left :smiley:


Ableton Live 10, Max4Live


Just drop the device into a midi track and it should start emitting midi notes right away. If that is not the case stop the transport and press play again in Ableton.

First sequencer allows to set target steps pattern and the second one is used to display what is currently output by the sequencer.


  • mutation chance : how big is the probability of sequence “genome” mutation - results in random steps flipping their state
  • population size : how big is the population that takes part in creating patterns. The bigger population the higher chance of target pattern appearing
  • breeding population size : how many genomes are selected to create a new population at the end of each cycle
  • iter/cycle : how many iterations of breeding cycle are run at end of each cycle. Higher values make it possible to “reach” target pattern in fewer cycles.
  • note : midi note value which is output by sequencer
  • dur div : sets note lengths in dividiends of quarter note (synced to tempo). For example value 4 will result in note length of one sixteenth and value 1 will result in note length of one quarter.
  • seq length: sets the length of sequence
  • random population button: randomizes the population.


v0.0.3 -


Just FYI I haven’t given up on trying to find a manufacturer to bring this into Eurorack. It’s just great!


There is new platform coming with a eurorack shield, basically kind of a teensy brain with different shields. It’s a shame the expert sleepers guy doesn’t let people code stuff for his devices

1 Like

Do you have Daisy Smith dev board in mind or something else?
I am still thinking of porting it to ornament and crime hemispheres but there is a problem of how to make good interface for entering steps, I am not fond of how you have to enter steps in existing sequencers for o_c but given the available interface I am worrying that nothing better can be devised.

Yeah. I haven’t heard anything since namm from them. I thought they had a shield that also included a screen, would have been nice for your purposes. I made a dmx controller with a teensy and display, it’s not so hard. Actually, my main gripe with axoloti is lack of a screen, very useful for these applications.

Another device that would be nice to allow you to develop is zoya.

1 Like

This is awesome. Was there any modulation/automation applied on the sequencer for the demo track, or was that all from one setting per track?

1 Like

So clap, hi-hat and melody tracks parameters were untouched, kick had modulation chance automated (from around 0.19 to 0.24).

I also noticed one bug - when track is started mid bar the genetic sequencer still starts from the beginning of the pattern but I will look into fixing it using plugsync~ object.

You can write code for the disting I thought…

Last time I checked only example for mk3 was online, but I see that they also uploaded example for mk4 ( which is generally great, but unfortunately the problem of entering steps easily would still persist. One of the ideas that I had for o_C would be to quantise pitch CV at one of the inputs and map it to sequencer steps so for example by pressing C3 on keyboard you could toggle state of first step in target pattern.

@karol how many steps do you think are ideal for such a sequencer? Would 8 steps suffice?

any steps count should work, but changing it without changing other parameters would affect how fast algorithm would arrive at „target” pattern so this is something that should also be taken into account. I should have some time over the weekend so I will add possibility to change steps length in max4live device so it can be tested empirically :wink:


I have updated sequencer so it is now possible to set sequence length between 1 and 16 steps (setting odd values is especially nice for hihat parts ;)). I also fixed sequence not restarting when Ableton transport was stopped. I still need to work on starting the sequence on proper step when Ableton playhead is on position other than 0 (currently sequence always starts from step 0 disregarding the Ableton playhead), but hopefully the sequencer will be useful as it is to you :smiley: