Cyrene: a drum sequencer based on Mutable Instruments Grids (v1.5.1)

Cyrene

A drummer in a box for the norns sound computer. Based on Mutable Instruments Grids by Émilie Gillet and Step by @jah

Cyrene-landing

Cyrene-pattern-and-density

While I love the sample sequencers for norns, I’m also sometimes lazy. I typically use them for drumming while I play another instrument, and I don’t want to write a new drum part from scratch to start jamming. Mutable Instruments Grids comes with around 65,025 preset kick, snare, and hi-hat patterns (derived from the interpolation of 25 patterns, with those patterns derived from analysis of a huge drum pattern data set). They are organized such that similar rhythms are positioned near each other in a two-dimentional grid, and the musician is able to select a position in that grid (and change that selection over time). In Cyrene, these rhythms are then fed into a rather direct port of Step, which is a sample based, monome grid-enabled step sequencer using the Ack engine. If you have a grid, you can then edit the pattern coming from the Mutable Instruments Grids algorithm as you see fit, add additional tracks (MI Grids only supports kick, snare, hi-hat), and other fun stuffs.

And yes, this means that we now have Grids for grid :wink:

Oh and if you’re wondering about the name: I thought calling it “Grids” would get way too confusing what with the monome grid and all, so it’s named after Eratosthenes of Cyrene, the ancient greek polymath who is generally credited with inventing a grid-based system for mapping the world (what we now call latitude and longitude).

Requirements

  • norns (update to software version 200424 or later)
  • the Ack engine
  • grid optional (varibright encouraged, 8 or 16 wide)
  • crow optional
  • arc optional

Documentation

  • Change samples (and effects) via the params menu
  • E1 controls page

Landing page:

  • E2 controls tempo
  • E3 controls swing
  • K2+E2 controls volume
  • K2 stops playback, K3 resumes playback
  • K2 while stopped resets pattern to the first beat
  • Hold K2 + Tap K3 for tap tempo

Pattern & Density page:

  • K2 and K3 cycle through the sections of the page
  • E2 & E3 control selected values (X/Y, Kick/Snare density, Hat density/Chaos)

More Densities page:

  • K2 and K3 cycle through the sections of the page
  • E2 & E3 control selected values (densities for tracks 4 thru 7)

Euclidean page:

Euclidean Rhythms

  • K2 and K3 cycle through the tracks
  • E2 controls euclidean fil
  • E3 controls euclidean length
  • K2+E2 controls euclidean rotation
  • K2+E3 to enable/disable euclidean mode for the highlighted track
    • While euclidean mode is disabled, editing the euclidean settings has no effect
    • When turning euclidean mode from on to off, the kick, snare, and hi-hat tracks go back to their MI Grids patterns based on the current X/Y settings

Grid (optional)

  • Each row is a track, with the first 3 being kick, snare, and hi-hat respectively
  • Each column is a beat in the sequence
  • Clicking a key toggles whether or not the sample for that track will play on that beat
  • Click on the last row jumps playback to the beat matching the clicked column
  • Bottom right key is an alt key, hold to enter alt mode
    • Bottom left now shows page indicators: bright for current page, faded for inactive pages. Click an inactive page to switch to that page of the grid. Only relevant if you have a sequence length longer than your grid is wide
    • Click any track (rows 1-7) to enter probability editing mode for that track. Y axis now shows probability of a trigger firing on that step. Probabilities also control volume of the sample, and the output MIDI velocity. Pagination works as usual, and you can click the key to the left of the alt key to go back to the default multi-track view

Crow (optional)

  • Editable from the params menu:
    • Cyrene track associated with each output
    • Output mode (gate or envelope)
    • Each output’s attack and release when in envelope mode
    • Which param is modulated by each input voltage

Arc (optional)

  • Encoder 1 controls tempo
  • Encoder 2 controls swing
  • Encoder 3 controls pattern X
  • Encoder 4 controls pattern Y

Roadmap

  • Multi-sample mode: use multiple samples on the same track (e.g. two slightly different kick drums) for more realism (likely interacts with MI Grids-style “accent” support)

Demo


Nothing too fancy going on, kinda just basic usage of the app. All the samples are norns’ built-in 808 samples (these are auto-loaded for you on first launch, and you can of course change any and all of them). I’ve turned swing to 22%, set kick to 40%, snare to 25%, hi-hat to 70%, and chaos at 60%. Tracks 4 thru 7 are in euclidean mode (4: (8,2,2), 5: (8,2,0), 6: (9,3,1), 7: (10,4,0)). The track starts with X/Y in the bottom right, then throughout the first minute or so I’m just dialing the X/Y counterclockwise in a circle. Then in the second half of the track I play with the euclidean settings (first swapping kick and snare back and forth between euclidean / grids modes, then changing the euclidean settings for some of the other tracks)

Download

Current version: v1.5.1 (e8c1d25)
Available via the standard Maiden project manager install process at http://norns.local when your norns is on WiFi
Also available as a direct download

82 Likes

Congrats on the release, looking forward to getting back into fates again!

1 Like

Hehe- you beat me to it @21echoes I’ve been working on a Grids port, too. Damn.

2 Likes

This is super fun! I’m using a GS64 monobright grid and DIY Norns, currently blasting this through the compressor and a gentle reverb.

2 Qs: Is there a way to modify the patterns that are interpolated on the grid? And I’m able to edit the 8-step pattern on my grid, and the bottom row jumps to that step, but do the other 3 rows (5,6 and 7) do anything? They just light up so I was curious if I was missing something in the docs. Anyway this is super fun, thanks!

2 Likes

Yes, clicking any grid key on the top three rows should toggle whether or not the sample plays on that step. Right now, grid-based edits are ON/OFF (vs the X/Y patterns you dial in are much more fine-grained probabilities – I’m planning to add probability editing via the grid in a future update), but yeah anyway the edits on the grid still affect the playback. Phrased differently: use X/Y to seed a pattern, then you can completely edit it by touching the grid. Any X/Y edits you make on the norns encoders after you touch the grid undoes your grid touches.

Oh yeah, forgot to mention that the last grid row does that – I’ll update the docs

Yup! Just like the first three rows, clicking a key to turn on the light makes a sample play back on that step. Samples are set in the parameters menu. You may be getting confused by the fact that the app has default samples for the first three tracks, but does not for the rest of the tracks. I may give every track a default sample just to reduce confusion :woman_shrugging:

If you haven’t checked out the Step docs that may be helpful – this app is more or less just a direct extension of that app (for now).

Oh no! haha, sorry. Feel free to fork this and make any pull requests or whatever with stuff from your script!

Not your fault. I should have chosen something a bit more obscure, for my first Norns project. I’m kinda surprised someone didn’t do a Grids port earlier, actually, given how ubiquitous Pichenettes’ code has become.

1 Like

Thanks for getting back to me so quickly! I’ll check out the Step docs.

I suppose I should refine my question more: is there a way to modify the seeds?

Thanks!

Interested to see you you kept the original data in 8-bit int form, @21echoes .

I actually converted everything to floats in the 0-1 range, and did all the interpolation on the float values.

In practice, it probably doesn’t make much difference, but I figured in theory, there would be slightly more variation in the patterns between nodes that way, and the bit-shifting business to do the interpolation was really not required on the Pi. The original code was written for a Cortex microprocessor, with no Floating Point Unit. Pichenettes switched to floating-point arithmetic in later modules where a hardware FPU was available.

I also split the nodes dataset into a 3-dimensional array, with separate sub-arrays for each of the 3 channels’ 32-step pattern, which simplifies looking up values each step marginally.

I did the int-to-float conversion using a little JavaScript, then spend some time editing the data in a spreadsheet program to separate the node blocks into their own sub-arrays.

If it helps, I’m more than happy to pass on the nodes datafile I created to save you the grunt work.

I also did a nice animated graphic for the XY display which you can also have if you want it (though it may not fit the aesthetic of your script).

Other than that, you managed to extend the original in ways I hadn’t even considered, so well done!

Oh! Sorry I misunderstood. The patterns are in code here: https://github.com/21echoes/cyrene/blob/master/lib/grids_patterns.lua so feel free to edit them then drop the new file onto your norns. The format is:

  • Each “node” is a 96-length array of 8bit numbers (0-255) representing the probability that a trigger will fire on that step (“probability” isn’t quite the right word – it sets the level that the density parameter must be above for that trigger to fire in a deterministic way, barring the actually random influence of the Chaos parameter)
  • Within one node, the first 32 values are the kick, the second 32 values are the snare, and the last 32 are the hi-hat
  • The nodes are then arranged into a 5x5 “map”, which the x and y values range over. For x/y values “between” nodes in the node map, the probabilities from the adjacent nodes are averaged together at different strengths depending on the x/y values

So I’d encourage being a bit thoughtful about your edits to the nodes and map – Émilie did a lot of machine learning/data analysis to determine the 25 nodes and arrange them appropriately, such that small changes in x and y result in small changes in the beat, vs two drastically different beats being next to each other and the interpolation between them being jarring / unmusical.

2 Likes

Yeah I found it easier to just copy/paste Émilie’s node maps unedited, and preserve her 8bit-centric code, vs re-inventing the wheel :woman_shrugging: There were definitely some moments in there where I was like “wait this bitshifting is technically losing some fidelity”, but it was easier to just translate the code rather than to think too deeply about it honestly lol. I’d love if you sent over what you have if you don’t mind tho! If I have a spare moment and it’s not too daunting to rewrite as floats I’ll take a crack at it. And I’d love to see that animation too! :smile:

That’s the clever bit! That, and the original idea, which Pichenettes thought up for the Anushri DIY hardware synth, before they started producing the Eurorack modules.

1 Like

It was my first attempt at Lua, and I was fairly familiar with the core of the original Grids code, having worked on a melodic sequencer ideas based on it a few years ago, so I thought I’d try doing it a bit differently.

I kept the node data, but rewrote the step function from scratch.

I kinda of like wheel-reinvention :wink:

Absolutely. It’s a bit of a mess, at the moment. I got a bit hung up on the GUI, and ended up implementing it in a somewhat over-complicated way, I think, but I’m more than happy to pass it on.

I think I’ll carry on with the project, because I’m finding it a useful project in terms of learning a bit of Lua, and SuperCollider, and it seems a shame to abandon it now.

My thought on extending it beyond the original Grids functionality differ from yours, so it might actually still prove useful to someone, even though there’s a large overlap with your version.

I’ll send you mine. You can have that bit, if you like. You might have to modify the return values a bit, but it should slot in quite easily.

Again, I’m new to Lua, so it may well be done in a stupid way, but you’re welcome to have a look and take anything you find useful.

I’ll clean it up a little, and drop a .zip to you.

1 Like

A little wrapped up in work-related things today, but I’m hoping to ship a v0.9.1 today or tomorrow. A few small changes (don’t let chaos play triggers in fully empty slots, provide some more default sample selections on first boot), and one bigger change: the MI Grids patterns are at 32nd note resolution, while the app currently defaults to 16th note resolution. I switched my resolution param (“beats per pattern”) to match MI Grids (8, aka 32nd note resolution), but didn’t realize I left the default in code at the value it was in Step’s code (4, aka 16th note resolution). Tl;dr everything sounds twice as slow as it should by default, you can switch your “beats per pattern” param to 8 for now to fix this

2 Likes

I noticed when following the migration guide for the new Norns Clock that my step function was running at 8th, rather than 16th notes, too.

I’ve got my script running well with the new script, now, and I’m really enjoying using Link sync, with the iPad!

Alright, v0.9.1 (b188c66) is up! ZIP File

  • Treat the MI Grids data as 32nd notes instead of 16th notes to match the module’s real behavior.
  • Switch “beats per pattern” in params to “grid resolution” – each column can now be quarter notes, 8th notes, 16th notes, or 32nd notes. The MI Grids data is scaled appropriately onto the grid depending on your selection (but be aware that MI Grids data more fine-grained than your resolution will be lost! E.g. if you choose 16th note resolution, MI Grids patterns with triggers in between 16th notes will no longer have those triggers loaded)
  • Chaos now has a separate effect on each track, vs globally increasing activity when it takes effect
  • Default samples for every track for easier plug-n-play (this only takes effect on your first-ever launch)
  • Being picky, but: my X and Y axes were swapped when comparing with the real MI Grids module, so I switched those
  • Write less data to disk to save patterns between sessions. This may mess up your pattern on load if you were using any pattern other than pattern slot 1 (I mean the 99 available numbered pattern banks in params, not the MI Grids patterns)
15 Likes

v0.9.2 (7d8f058) is up! ZIP File Consider this a release candidate for v1.0.0 aka listing in the primary Maiden library. The only other thing I may try to fit in before then is 32-step patterns and a grid pagination system to match.

Anyway, release notes:

  • Port to using the new global clock system. Small UI updates to indicate to the user if the clock is currently defined by an external leader
2 Likes

v1.0.1 (3de9b95) is up! It should be available via the standard Maiden project manager install process at http://norns.local when your norns is on WiFi. Also available as a ZIP File

Release notes:

  • Now supports sequence lengths up to 32 steps. This was an important bit to get into 1.0.0 as it allows for the full 32nd-note-resolution patterns from MI Grids to be easily usable. To support sequence lengths longer than the grid is wide, the bottom right grid key is now an “alt” key. Hold it, and you’ll see page indicators in the bottom left. Bright for current page, faded for inactive pages. Click an inactive page to switch to that page of the grid
  • No longer crashes/stalls when loading a bad autosave file
9 Likes

Tried this out syncing the to my modular via crow clock in. Works a dream! Grids was/is always one of my favorite euro modules. Excited to make some of my own samples and load them up into Norns!

1 Like

v1.1.0 (4642c46) is here! Available via the normal install process in Maiden, or here: ZIP File

This is a pretty big upgrade! Probability editing on the grid, additional density controls, and Euclidean mode :smile:

  • Probability editing mode on the grid. Just like with paginating the grid: bottom right key is an alt key, hold to enter alt mode. Alt key + any key within a track row (rows 1-7) enters probability editing mode. Y axis now represents the probability of a trigger firing on that step for the selected track (the row you clicked to enter this mode). Click to change. Pagination works the same while in this mode (hold alt, use the bottom left). Click key to the left of the alt key to go back to the default trigger editing mode
  • Added a third norns page to control the densities of tracks 4 thru 7. Use these density params same as how we use the densities of tracks 1-3. Extra helpful now that we can control fine-grain probabilities for all tracks
  • Euclidean mode: fourth norns page, shows euclidean settings for every track. K2/K3 to change focused track for editing. E2 to change fill count, E3 to change pattern length. K2+E2 to change rotation, K2+E3 to enable/disable euclidean mode for the highlighted track. While euclidean mode is disabled, editing the euclidean settings has no effect. When turning euclidean mode from on to off, the kick, snare, and hi-hat tracks go back to their MI Grids patterns based on the current X/Y settings. Shout-out to the UI @tehn designed for multi-track euclidean patterns on norns :raised_hands:
  • Re-organize and group the parameters for a cleaner params menu
15 Likes