Euclidean MIDI Patterns

Euclidean MIDI patterns screenshot


In January I posted a Euclidean rhythm generator in Flash. Polyrhythms generated by a mathematical algorithm. I wanted the next version to be able to send MIDI, so I could use it with software like Ableton Live and hardware music machines like my Elektron Machinedrum.

Since Flash doesn’t do MIDI I spent the last few months learning Java and rebuilt the pattern generator to add MIDI capabilities.

Running the application

The Java app doesn’t run in the browser, so I can’t show it embedded on the web page like I’m used to with Flash projects. Instead you’ll have to download the Java .jar file and run it on your computer like you would any regular desktop application. For Mac users there’s a OS X .app file as well.
I haven’t looked into creating an .exe file for Windows users yet, but double clicking the .jar file should start up the program just like an .exe.

Download Java JAR file. *
Download Mac OS X APP file.
Download Java source files (Eclipse project), JAR and APP, all in one ZIP file.

* The JAR file needs the runtime for Java v1.6 (also known as Java SE 6) to be installed. On Mac this version is automatically installed with OS X 10.6 (Snow Leopard), but OS X 10.5 (Leopard) has the older Java v1.5 (or J2SE 5.0). I tested on Windows XP with Java v1.6 and that runs fine. You can test your Java version by opening Command Prompt (Windows) or Terminal (OS X) and typing “java -version” (without the quatation marks and press return after typing).

To compensate for the lack of an embedded app here’s a video with a short overview of what the Euclidean Pattern Sequencer does:


The features are basic in this first version:

  • Double click anywhere in the lower panel to generate a new pattern. A new pattern is 16 steps with 4 notes by default.
  • Click a pattern’s center circle to select the pattern. A selected pattern shows a double center ring and it’s settings are displayed on the panel at the right.
  • Drag a pattern’s center circle to move the pattern. So you can visually reorganize your screen when there’s a lot of patterns.
  • All patterns with their settings and location can be saved in a file. This is a regular XML text file. The File menu has the familiar New, Open, Save and Save As options. The project tempo is saved in the file as well.

Pattern generator control bar

Pattern generator control bar

Pattern and MIDI Settings

Pattern Settings Panel

On top are the main controls: Start / stop playback, a slider and input field to set the tempo in BPM and a combobox to choose a MIDI out port. The MIDI In port is not used at the moment.

Once a pattern is selected it’s settings can be edited:

  • The Steps and Fills sliders determine the pattern. Each time one of them changes the algorithm is recalculated.
  • Rotate rotates the pattern. As you’ll note when you play with the Steps and Fills sliders, a pattern always starts with a note on the first step. To overcome this limitation you can rotate the pattern with this slider.
  • MIDI settings Channel, Pitch and Velocity are parts of the MIDI Note On and Note Off messages that the pattern sends to the MIDI port.
  • Length is the duration of the note. Once the end of a note is reached a MIDI Note Off message is sent to the MIDI port. The length of a note can be 16 steps maximum. At the moment length is measured in the internal sequencer resolution, which is 24 PPQN. Because one step is seen as a 16th note, the maximum slider value is ( 16 steps / 4 ) * 24 PPQN = 96. Not very intuitive, I know. I’ll think of something better in an update.
  • Mute, Solo and Delete do what you’d expect them to do.


Here are two pieces of music I’ve already made with the app. I tried to get them to be a bit more like finished track than just demos of layered polyrhythms.

The first one is the same setup as in the video above but with more patterns. About sixteen of them sending MIDI to sixteen tracks in Ableton Live with mainly samples being played. I recorded the MIDI patterns in Live, did some arranging and automation and exported the result as audio.

Euclidean Patterns Demo 1 by Wouter Hisschemöller

The second one are patterns sending MIDI notes to a hardware drum machine via the soundcard’s MIDI output. This is my new Machinedrum UW that plays samples as well as synthesizing drum sounds. All sounds are the Machinedrum’s sixteen tracks playing and recorded on the computer.

Euclidean Patterns Demo 2 by Wouter Hisschemöller

This entry was posted in Java, MIDI and tagged , , , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.


  1. Posted October 30, 2011 at 00:06 | Permalink

    Hi Douglas,
    Just now reading these comments. (A bit late). We already mailed and your version works great and is much neater.
    It will be in the next (1.2) update.


  2. steveo
    Posted November 17, 2011 at 20:15 | Permalink

    Has anyone found a solution to the IAC driver not showing up in the Midi out of the application? I am running mac osx 10.5. I had to install soylatte to get java 1.6 on my mac which was a bit of a hack having to edit my PATH & JAVA_PATH variables. As a consequence I am not running the mac version i am executing the jar via the terminal with “java -jar MIDI Sequencer 001.jar” from the command line but it runs. Its just giving the IAC option for the midi out.

  3. steveo
    Posted November 17, 2011 at 20:16 | Permalink

    edit “Its NOT giving the IAC as an option for the midi out”

  4. kfractal
    Posted December 11, 2011 at 20:51 | Permalink

    masterful! thanks for the app and source code.

  5. Posted December 12, 2011 at 15:08 | Permalink

    @kfractal: Thanks!

  6. Posted February 12, 2012 at 17:00 | Permalink

    It’s a superb piece of work! Many thanks for sharing.

  7. Johnny
    Posted February 24, 2012 at 15:04 | Permalink

    This is a fun tool. Midi clock sync would be wonderful.

    Thanks for sharing.

9 Trackbacks

  1. [...] Lots of detail and documentation on how to use the tool on Wouter’s updated blog post from earlier this week: Euclidean MIDI Patterns [...]

  2. By Music of Sound » Detritus 102 on May 25, 2011 at 21:23

    [...] euclid via cdm [...]

  3. [...] este outro vídeo aqui, que usa um gerador de escalas Euclidianas e transfere isso para o Ableton Live, pronto para executar o groove criado. Sem usar partitura ou [...]

  4. [...] video serves as an illustration for an article about the software. Read it here: Like [...]

  5. [...] download in Java .jar and Mac .app format. Java source files are also available.More information: Wouter Hisschemöller No Comments Share/Save var a2a_config = a2a_config || {}; a2a_config.linkname="Wouter [...]

  6. [...] Hisschemöller released the free java app Euclidean MIDI Patterns. Its a really amazing java application that generates midi notes in realtime, or how the developer [...]

  7. [...] Hisschemöller veröffentlicht die kostenlose Java App Euclidean MIDI Patterns. Diese App erzeugt Midi Noten/Sequenzen in echtzeit. Ich finde die Idee wirklich [...]

  8. [...] Hisschemöller heeft de Euclidean Rythm Generator (ERG) uitgebracht voor Java 1.6. Met deze midi-generator kun je verrassende drum- en percussieloops [...]

  9. By music web toys part 1 | pulvereus on August 6, 2011 at 01:56

    [...] EUCLIDEAN SEQUENCER: It’s just not a web toy, but it is funny too. An explaination  can be found here. The sequencer was programmed by Wouter Hisschemöller :  [...]