Norns: studies

granted they’re in HTML and not rendered…

@tehn tried to jump on that typo from @wolfgangschaltung and got some permission errors from git. Just a heads up

ERROR: Permission to monome/docs.git denied to atomboyd.

Thanks, but as I wrote, I am not familiar at all with github. Which document you pointed to is the reference doc and how do I open it?

1 Like

You could download the zip file folder from Git:



And then open them locally from the unzipped folder in your web browser:



Anything with a .html file ending should auto load in whatever default browser you use.

6 Likes

Got it, thank you very much!

2 Likes

Not sure whether the following should be asked here, or in Norns: help or in Norns: dust, but as I encountered it in both studies (and as I do not yet have a norns):
The engines used in the studies (TestSine and PolyPerc) seem to require their pitches be defined in Hertz values only.

On the danger of coming across as lazy (or showing that I have missed something), I have to admit I assumed that all norns engines also offer a way to define their pitches in note values (be it as e.g. C3 or as e.g. 60). I guess I can write a Lua function that converts e.g. integer numbers into Hz values, but it strikes me as odd having to do that in a musical instrument.

P.S.
Study 2 starts by saying that engine PolySub will be used, but the example actually uses PolyPerc. Is this intentional?

Typo in study 2:
“tables are created with curly brackets. above, nothing is am empty table, drumzzz is a table with 8 elements.”
“…an empty table…”

Hmmm… seems like it’s a couple wednesdays away from grids. midi. sync. OSC, HID.

I’d like to figure out how to get OSC messages doing something.

I’ve got a TouchOSC template I’m working on to emulate a grid. Maiden shows me OSC messages recieved, but beyond that I’m not sure what I need to do to tell the script to do something with the OSC message. Ideally I’d like the script to believe it’s just getting messages from a grid.

Any quick pointers?

we’re working on a set of musical helper functions— so yes you won’t need to do it by hand.

by in the meantime, here’s a midi to hz function:

function midi_to_hz(note)
  return (440 / 32) * (2 ^ ((note - 9) / 12))
end

throw this in your script, then use:

engine.hz(midi_to_hz(60))

to play middle c

ps. functions are covered next week

8 Likes

Here is some code I worked out the other day. Change the IP address and port as needed.

-- turning a knob moves a 
-- number randomly around 
-- the screen
-- and sends OSC

require 'osc'

engine.name = 'TestSine'

local value="turn a knob"
local speed=0

function init()
  engine.amp(0.2)
end

-- screen redraw function
function redraw()
  -- clear screen
  screen.clear()
  screen.move(math.random(0,120),math.random(0,50))
  screen.text(value)
  screen.update()
end

function enc(n,delta)
  value = n
  osc.send({'192.168.1.10',6000},'/goto/prev/',{n})
  engine.amp(0.2)
  engine.hz(n*delta*400)
  redraw()
end

function key(n,z)
  value = n 
  osc.send({'192.168.1.10',6000},'/goto/next/',{n})
  engine.hz(n*20)
  engine.amp(0.5)
  redraw()
end
1 Like

And whoops I see now you were more interested in doing something with received OSC messages. Check out the OSC docs for osc.event(from, path, args) See: http://norns.local/doc/modules/osc.html

Yup - i’ve been banging my head against those docs for awhile and trying to make sense of it.

Still trying to wrap my head around lua

1 Like

I’ve got a draft musicutil.lua on the go here that has functions for converting notes to freqs and back, converting notes to friendly names, generating scales and snapping notes to a table (scale). Pull request coming soon!

5 Likes

Oooh… this turned out to be very helpful in getting my virtual grid buttons to light up in touchosc.

:+1: Thanks!

2 Likes

It’s Wednesday :clap:

2 Likes

somewhere in the world - like here! :slight_smile: my Wednesday nornsday is actually a Thursday nornsday for me

2 Likes

wednesday!

https://monome.org/docs/norns/study-3/

27 Likes

“pause. really consider the possibilities, and i hope your mind explodes a tiny bit. this is why programming in a musical context is so incredibly powerful and interesting.”

Yep, my mind exploded just watching that demo video. First I was like “oh great a sequencer [yawn]. Then I was like “wait what is happening?!? [head explodes]

7 Likes

You know these series of studies really give me the same feeling as the Micro Adventure books of the 80s where you’d type BASIC programs into a computer as part of the story. These are great ways to learn about programming. Norns is really turning into an excellent platform for learning about creative coding and music. Thank You!

10 Likes

@tehn I love the creative possibilities in adding additional functions to the sequencer. Here is the edited list that is working for me right now.

function on() engine.amp(0.2) end
function inc() on() note = util.clamp(note + 5, 40, 120) end
function dec() on() note = util.clamp(note - 5, 40, 120) end
function bottom() on() note = 40 end
function top() on() note = 120 end
function rand() on() note = math.random(80) + 40 end
function metrofast() counter.time = 0.125 end
function metroslow() counter.time = 0.25 end
function positionrand() position = math.random(STEPS) end
function rest() engine.amp(0) end
function filt() res() engine.cutoff(math.random(5000)+50) end
function res() engine.gain(math.random(4.0)) end
function randsynth() width() release() end
function width() engine.pw(math.random(1.0)) end
function release() engine.release(math.random(3.0)) end

act = {inc, dec, bottom, top, rand, metrofast, metroslow, positionrand, rest, filt, randsynth}
COMMANDS = 11
label = {"+", "-", "<", ">", "*", "M", "m", "#", "r", "f", "s"} 

7 Likes

This is a really nice study.

Reading it, the things that leap out at me are a slight glossing over scope, which you use as a term a few times without fully clarifying. My gutfeel is to not slow down the study with endless explanation, though; I almost want footnotes, or something. (My notes on scope would be about “local scope” inside a function, and basically where variable names are relevant and not - eg how argument names are chosen, how local variables in a function are freed, etc. Also “class function” isn’t quite fully explained).

Sorry for nitpicking - just know that these tutorials are largely aimed at users whose exposure to programming, or at least programming Lua, might be limited. Mainly, it makes me appreciate how effective the narrative of the studies is - I’m only ever thinking about polish/reference/clarity.

3 Likes