Norns: scripting



Aha - Thanks! I hadn’t found a list that had Binary, hex and dec versions of the status byte. That helps a bunch.

I ended up using this in a test script

if data[1] == 144 and data[3] > 0 then
  note_on(data[2], data[3])
elseif data[1] == 144 and data[3] == 0  then

But your example is a bit cleaner.


Great to know. Thanks!

I had been trying to get midi.send working in hello_gong so that’s where I copy/pasted that part. Although I ended up using the earthsea script to get my midi send working.

I’ve got a Livid Block grid controller and it needs to have the midi note sent back to it for the LEDs to light up. I’m guessing this would be similar for other controllers like launchpad or apc40.

FWIW here’s what I added:

local function note_on(note, vel)
   if nvoices < 6 then
     midi.send(midi_device, {144, note, vel})
     --engine.start(id, getHz(x, y-1))
     engine.start(note, getHzET(note))
     nvoices = nvoices + 1

local function note_off(note, vel)
  midi.send(midi_device, {144, note, 0})
  nvoices = nvoices - 1

midi.add = function(dev)
   print('earthsea: midi device added',,
   dev.event = midi_event
   midi_device = dev


metro is in next week study, but until then see playfair's init, or:

  t = metro.alloc()
  t.count = -1
  t.time = 0.5
  t.callback = function()


@shreeswifty @babatunde – Updated my Oblique Strategies script this morning to improve the linear scroll idea I had for this (you can see it in action around the 20-second mark in the video below).

If you’re interested in checking it out, I created a public gist for the script on Github:
Oblique Strategies for Norns

Keep in mind that, while the script is fully functional, the code could definitely be improved (I’m still pretty new to Lua and coding in general)! If you have any ideas for improvements, I’m all ears.


this is awesome!

PM winging your way :+1:


Oh man… there’s probably something wrong with me that the first thing I thought of looking at your code was… Hmmmm - what if we could access a large number of Oblique Strategies (or other interesting data) from a mySQL database?

which led me to…



I want to do Angus Maclise’s YEAR or book of Days so when you start Norns it loads what day it is^google|twcamp^serp|twgr^author

according to Angus of course :slight_smile:


After figuring out midi.send last night I went ahead and tried to fully-midi enable the earthsea script so the pattern stuff would work from my Livid Block midi controller.

Here’s my work in progress. I’m not sure everything is working properly yet. Not sure how other controllers map note numbers so YMMV.

earthsea midi for Block


Thanks for this example. Could you direct me to where I could find an example of a poll in a lua script? I know how to create one in the CroneEngine, just not how to access it in lua.


this is a confusing example (because it’s an array of polls) but:

i’ll explain polls in week 5’s study


I saw local TRACKS = 4 up at the top of the code and had a brief moment of excitement about more MLR tracks … is the CPU powerful enough to handle this?


we’re working on it, and changing the TRACKS var will not auto-magically increase the number… there’s more plumbing beyond that


Hey, it’s fathers day: if I can be a father, anything is possible.


Thanks for directing me to that snippet. It helped and I have my poll working now. Thank You! Looking forward to the next few norns studies.


@markeats did you manage to make any progress on this? I was considering adding the same, but so far only wanted to add a midi_to_hz function.


Yep, been apart from norns for a few days but should get that integrated this week. Nearly-done version is on the musicutil branch of my fork if you’re curious in the meantime.


So let’s say i’m starting a new script.

Is there a way to list available engines?


typing report_engines() on the command line will show you a list.
more useful info:


Ok cool. Thanks for that link. But where is this function listed in the docs? I suppose I should actually read the README files, eh :slight_smile:

FWIW - i thought I looked thru all the docs http://norns.local/doc, but didn’t find it.

Also FWIW - I can’t find a bunch of the functions on the page you linked in the documentation.


right. that doc is a bit out of date. i opened an issue on GH; feel free to pile observations on there.