Norns: scripting



I don’t think there’s currently a way to do so, see


Ok. Shame but understandable. I’ll keep drawing interfaces in Sketch until it arrives :slight_smile:


i mock up ui design for oleds with Processing with noSmooth() enabled

i think a lot of the drawing methods are similar to the Cairo stuff used on norns.


Oh cool. Would you mind sharing an example?

Ignore me, it’s so simple! I’ll share my creations. I’m a UI designer by trade. Keen to start contributing.



Great idea! 20characters


Trying to create a parameter option for grid rotation that includes textual representation of the degrees. As the grid_rotation values are 0 to 3, I’m having a bit of trouble getting things set up. Here’s what I have:

local grid_display_options = {"0", "90", "180", "270"}

    params:add{type = "option", id = "grid_rotation", name = "Grid Rotation", options = grid_display_options, default = 0,
        action = function(value)

The result of this is that grid rotation gets set to the 90 degree value (1 in the array).

Any ideas for how I can fix this? Thanks.


You may want a key/value pair table where you look up the selection so you could do something like
grid_value = {
“0” = 0,
“90” = 1,
“180” = 2,
“280” = 3 }

Then maybe use params.add_option and params:set_action


looks like a zero vs 1-based array problem. maybe a bug - probably my fault

Maybe this would fix:

or use Jonny’s solution above. :slight_smile:


Thanks, @jonny and @okyeron. Those were things I had tried. I tend to think it’s the zero vs 1-based array conflict. No worries. Will stick to original plan.


How can I make sure that when saving parameters to the “default” preset slot of a script that those parameters load up next time that I launch the script? Each time I load up my script the default values hardcoded into the script are loaded.


on 2.0, I think you’re looking for



20 characters of Thank you!


Just wanted to throw out a kudo to @markeats and the several libraries he’s made available for norns. The MusicUtil library makes selecting and assigning note values to scales a relative breeze.

The one I’ve been working with lately is the UI lib. As norns is a screen and knob limited device, scripts which offer multiple options for user control/modification have a challenge.

Among others, the UI lib offers a handy way to create and move through multiple “pages” of Norns-based controls. Mark’s loom script shows how this works. Norns v2 uses a horizontal version, rather than the standard vertical, in the menu system.

I want to offer encouragement to script writers to take a look at this method if you haven’t yet. It’s relatively simple to implement. Everything needed gets located in the KEY, ENC, and REDRAW functions. I’ve added this to my ‘Strum’ script, as it now has on screen 5 performance controls that users should have ready access to. It took me about and hour and a half to implement. EDIT: Those with actual coding skills will be much quicker. :grin:

The UI Pages can also benefit users by having a recognizable way to move through the various controls provided in a script.

I’m not encouraging all scripts look and work the same way. Still, if we think about users, it can be beneficial to have some common method of interacting with norns scripts.



Any ideas why params always show up as a float when rendered on norns itself? For example, when I spec:

params:add_control("compress", "compress",, 100, 'lin', 1, 10, "%"))

this.addCommand("compress", "i", { arg msg; synth.set(\compress, msg[1]); });

it shows up in norns as
compress 10.0 %


numbers in lua are always double-precision float, unless specific contortions are performed to make them integers.

currently on norns lua side, we don’t really use integers at all (AFAIK). certainly the parameter “control” class doesn’t.

(the only case i can think of where this would really, really matter is if the param value was acting as a bitfield. which would entail its own parameter class i’d think.)

at the C level (between lua and OSC) the value in your example will be cast to int before its sent, b/c of the command format specification.

i suppose it would make sense to tweak the parameter display routine (in lua) to drop the decimal when step size is an integer.


There is also a ‘number’ param type that works well for integers :blush:


Are Lua drawing libraries compatible with Norns? Or, can we import SVG? Thinking of creating more complex interfaces.


norns uses cairo



I did some preliminary research on svg here - Norns: Development

I’ve been experimenting with reading images to pixel arrays to make “sprites”

There’s also a display-png function added in 2.0