code
norns does not need to be programmed. a collection of scripts will be included and updates will bring new instruments for use with grids or midi or OSC or all by itself.
but changing code is encouraged— we’ve focussed on making this process inviting and intuitive. scripts and engines are edited through a web browser. (1)
the interface has the text editor itself, a sidebar file browser, and a command line that gives feedback from the system and allows you to type commands directly into the live environment. (2)
so yes, you can start a script and then manipulate it on the fly! but the more common case is to create a script which is saved internally (6) and then later use the script without the editor-and-other-things-computer involved.
what does a script look like? here’s a super simple one:
-- am i alive?
-- push key 3 to hear different note
-- turn encoder 2 to see a number change
engine.name = 'TestSine'
init = function()
number = 101
engine.hz(200)
end
key = function(n,z)
if n==3 and z==1 then
different = math.random() * 600
engine.hz(different)
end
end
enc = function(n,d)
if n == 2 then
number = number + d
end
redraw()
end
redraw = function()
screen.clear()
screen.move(0,10)
screen.level(15)
screen.text(number)
screen.update()
end
quick explanation:
- top three lines are comments. these get displayed when choosing a script from a list on the hardware.
- select the sound engine with
engine.name. we’re using a simple sine test.
- the
init function gets called when the engine is successfully loaded. here we just set some defaults: make a variable number, set the sine wave’s frequency to 200hz.
- the next functions that are called when key or encoder data is generated (when you touch a key or encoder). key number
n and state z is checked, if it’s key 3 pushed down we set the sine wave to a random frequency. encoder 2 will add its delta d (amount of turn, they are endless rotation) to number and then request a screen redraw.
- a full set of screen drawing operations are available but we simply clear, position, decide how bright, then print the number.
update sends it to the screen.
while i might not be impressing you with the result, it’s the journey and process that matters. adding metronomes, midi, grids (etc) all follow this level of ease. code can be reused across scripts (for example i made a quantizer and pattern recorder) (7) so scripts can build on existing structures. we’ve also built a parameter system that provides lists with ranges/properties with an onboard interface for parameter setting with saving and recall and midi cc mapping. like teletype before it, we’ve shaped norns to help you regard code as a creative asset.
modified scripts can be re-run on the hardware with a click.(8) errors and typos show up on the command line to help you fix problems. but most importantly the code becomes invisible when you don’t want to think about it— just turn it on and you’re on your way.
there’s so much more to say, but that’s it for now.
(1) via wifi. you can also just use ssh if you are one of them/us (who?)
(2) the editor (3) is a monumental effort by greg (@ngwese) which talks to the primary system (4) expertly architected by ezra (@zebra)
(3) called maiden
(4) called matron (5)
(5) further testing nesting possibilities
(6) there is capacity for a lot of scripts. you’ll more likely start to fill up the internal storage with the digital tape function (recording output straight to disk!)
(7) for mlr, that can just as well be used for an earthsea variant
(8) the old anachronistic “click”