Euclidean Pattern Generator 1.2

March 2, 2017

Euclidean Pattern Generator 1.2

This is the final version of the Euclidean Pattern Generator as a Java desktop application. I built this version five years ago, but never quite finished it. Now I want to get it out of the way to make a fresh start with a new online Javascript Euclidean patterns app that runs in the browser.

New in this last Java version is MIDI note triggering of patterns. That means individual patterns can be started and stopped by external MIDI Note On and Note Off messages. A drawback of earlier versions was that all patterns always played. There was just one button to start or stop all of them. I wanted to control patterns individually so that I could more easily make some sort of song arrangement.

I decided that the easiest way to do this was to rely on an external MIDI sequencer to create the arrangement with, and to have it interface with the Euclidean Patterns app through MIDI notes. That saved me the work of building an internal song mode, which would never have been as user friendly and full featured as existing MIDI sequencers like Ableton Live or Cubase.

Triggering patterns with MIDI notes

To use the new feature a few steps must be taken to set things up.

First some preferences must be set. This can be done by opening the preferences panel with the button in the header bar or from the Edit menu. In the Preferences panel:

Tick the ‘MIDI In’ checkbox and select a MIDI input port from the dropdown next to it. Now the app can receive external MIDI.

Tick the ‘Trigger by MIDI note’ checkbox under the dropdown. This lets the app listen to MIDI Note On and Note Off messages.

Preferences panel

That’s it for the preferences, the panel can be closed.

If you have selected a pattern in the window’s main area, or create one by double clicking on the area’s background, you’ll see a ‘MIDI In’ section in the Settings panel on the right. Here the settings for individual patterns can be changed:

Tick the ‘Trigger by Note On / Off’ checkbox to bring the pattern under external note control. This makes it possible to have that pattern triggered by external notes while others run continuously.

Use the sliders to select a MIDI channel and note pitch. The pattern will be controlled by MIDI notes on that channel with that specific pitch. This way it’s possible to control 128 different patterns on just one MIDI channel!

MIDI in settings

To graphically indicate that the pattern is triggered by MIDI notes you will notice that the shape of the pattern’s pointer has changed. Instead of a triangle it’s a diamond type of shape. Initially the pointer is short, just like when a pattern is muted. When a Note On message is received it the pointer will change to full length to indicate the pattern plays, until it’s followed by a Note Off message.

Pattern pointers

Using the new pattern trigger feature

I’ve tested the MIDI note control with Ableton Live.

On one MIDI track one clip holds the whole arrangement. It contains all the MIDI notes that start and stop the patterns. So the clip is in fact a six minute long song arrangement. The track sends its MIDI messages on channel 1 to the Euclidean Pattern Generator.

Ableton MIDI clip

In the Euclidean Pattern Generator all patterns are set to listen to channel 1, but each pattern is triggered by a different pitch.

The rhythms that are generated by the Euclidean patterns in the app are also MIDI notes. They are sent back to Ableton Live on different MIDI channels. The MIDI channels trigger instruments on various tracks within Ableton live.

So in a way you could see the Euclidean Pattern Generator used here as an external MIDI effect for Ableton Live: It receives MIDI data, processes it and sends the resulting data back to Ableton. Much like an insert effect on a mixer would, but with MIDI data instead of audio.

Here’s the result of the test, a completed track on SoundCloud:

Download the application

The Euclidean Pattern Generator is free and open source. Download the Java JAR file here or, if you’ll run it on a Mac, an APP application bundle.

As it’s written in Java, it requires the Java Runtime Environment to be installed on your computer. If you haven’t already, the app should ask you to do so. On my Macbook running OS X 1.11 (El Capitan) I had to downgrade to an older JRE version.

I hope you can run the app successfully, and if not please let me know in the comments or through the Contact page.

20 Comments

Hi Matthew, Yes, the preference settings should be stored immediately. The ‘Trigger by MIDI Note’ probably doesn’t because the error prevents it to. I don’t develop the app anymore, so I’m sorry to say that I won’t fix any errors anymore. A new version is on its way, but still in testing phase. Irregular updates of the online version appear here: https://hisschemoller.github.io/music-pattern-generator/

Er, maybe it doesn’t work on Ubuntu 18.10. When I select the MIDI In and Out ports in Preferences the selections don’t persist after closing the Preferences dialog. There’s no “Save” button or similar in that dialog, maybe the selections are immediate. The “Sync to MIDI In Clock” selection persists but the “Trigger by MIDI Note” selection does not, and toggling it throws an NPE at MidiInClockSource.(MidiInClockSource.java:40).

Hi Jacob, thanks! I’m sure the app will stop working at some point in the future. The problem in that it needs an older version of the Java runtime, and with OS and Java updates it will unfortunately get increasingly difficult to downgrade to older Java versions.

Hi Slatva, Unfortunately I think the app might be too old by now. I tried some time ago on a Macbook with Sierra (I think) and couldn’t downgrade Java enough anymore. I didn’t try very hard though because I’m almost finished with a new version of the app that doesn’t rely on old Java runtimes anymore. I hope to find time to have a working version early 2018.

Hi Denis, yes, you need an internal MIDI connection to connect the MIDI input of one program to the output of another. As you have FL Studio I suppose you use a Windows computer. MIDI-Ox is a free virtual MIDI bus for Windows that has been around for years, but I read it doesn’t run on Win10 anymore. I see that there are a lot more virtual MIDI apps now, like VirtualMIDI, loopMIDI and LoopBe. I have no experience with those, but they are small utility apps that should be easy to install and use.

Do you have any suggestions on how I can run this through FL Studio? I run your app, run FL Studio, but I see no way to connect them together — adding a MidiOut in FL Studio doesn’t seem to hook up your app. Any thoughts?

Hi GsfO, it should run on Windows. Maybe with an older Java runtime though. I tried this latest version on a Windows computer, but I’m not sure anymore exactly which Windows and Java version were installed.