is the kernel image link broken?

bear:tmp kodiak$ wget https://monome.nyc3.digitaloceanspaces.com/kernel-4.9.59-rt52-0.0.4.tar.gz
--2018-06-07 13:51:46--  https://monome.nyc3.digitaloceanspaces.com/kernel-4.9.59-rt52-0.0.4.tar.gz
Resolving monome.nyc3.digitaloceanspaces.com... 162.243.189.2
Connecting to monome.nyc3.digitaloceanspaces.com|162.243.189.2|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2018-06-07 13:51:47 ERROR 403: Forbidden.

I can get kernel-4.9.59-rt52-0.0.3.tar.gz, just not 0.0.4, and would prefer the latest version

if possible could someone post the config.txt, thats what im really interested in :slight_smile:

that’s an old kernel. i’ll get the newest one posted.

or you can build the newest: https://github.com/monome/linux

also FYI we no longer use RT. so a vanilla raspbian-lite should do ok (we mostly made optimizations for boot speed)

1 Like

in the current kernel we also have preemption enabled and hopefully 1000hz timers will follow too.

2 Likes

can i confirm, your not getting xruns on any of the current apps shipped?
im seeing a few on earthsea on a straight pi, so thats what i was looking to optimise.
(with a similar jack configuration)

EDIT:
ok, for now Im building a kernel with preemption, performance governor (default) , 1000hz timer on 4.14 kernel
will see how that goes, once its built…
thanks for the info.

so at the moment we’re not explicitly supporting (say) executing arbitrary sclang code on norns.
norns Engines are sclang classes, and editing one means recompiling sclang class lib.

why we did it this way is, i dunno, a little subtle and a little arbitrary.

  • one simple reason is performance. sclang classes are compiled into bytecode and if you are doing a lot of computations in sclang, this is significantly more efficient.

  • another is that it just seems (to me) that using classes is good practice, will help enforce some consistency, and makes for tidier code and more/easier code reuse.

anyways, after saying all that, and without debating the merits of classes vs global environment - the structure of an Engine is quite open:

an engine defines “commands,” which are OSC messages that it can receive , and “polls” which are (currently) single values that it can transmit (either sporadically or periodically.) polls and commands are automatically exposed in lua scripts - the former as functions in the engine table, the latter as Poll objects.

“commands” can be OSC messages in any format (well, excluding binary blobs.) so at one extreme, an engine could accept arbitrary strings and attempt to evaluate them as sclang expressions (play them as sctweet-like JIT synthdefs, for example.)

less extremely, there are of course many approaches to making a structured but flexible modular environment in a sclang class. @jah’s ack engine is one approach. (i think a very good one worth extending.)

7 Likes

26 posts were merged into an existing topic: Norns: help

[moved this from the “help” thread since it seems relevant. sorry for fumbles with mod tools]

earlier you said why don’t i do that in SC

what i meant was to respond to the line of questioning like, (and i’m paraphrasing / interpolating) “i have X years of experience in SC, i have all these patches i wanna port, whats the easiest way?”

well. you make a subclass of CroneEngine, this can execute any sclang code you want. [*]

your (non-interactive) lua script could be as simple as
(myscript.lua)

engine.name = 'MyEngine'

that’s it. running the script from the norns menu will run .free on any running engine and .alloc on a new Engine_MyEngine. i’m mentioning this in response to the (again mostly hypothetical) query like: “hey, i don’t want to do all my sequencing, control mapping, tuning, &c, basically musical logic, in lua. sounds like a pain.” and you don’t technically have to. but at minumum you probably want to have some things in Engine_MyEngine.alloc like

(in Engine_MyEngine.sc)

this.addCommand("foo", "f", { 
  arg val = msg[1]; // get the single float argument
  // ... set a control bus, set a variable, do whatever you want
});

so that you can e.g. control it from the norns hardware UI

function init () state = 0 end -- initialize a state variable

-- map encoder to change state variable and send it to the engine
enc = function(n, d) 
  if n == 1 then 
    state = state + d
    engine.foo(state)
  end
end

and of course we kind of think that the more control you can hand over to lua, the better. makes it easier for other nornians to adapt.

but yea - go ahead, make an engine that collects a bunch of sctweets and turns them on and off. maybe with some extra control parameters. sounds great

[*] the exception, on norns hardware, is graphics / GUI

6 Likes

i think i follow you but what does this mean

i want to have encoders do math and stuff is that a no-no?
or am i missing something?
I want to play around a bit and learn the lua stuff and simple random jukeboxers are usually a way to learn file handling reading from a folder parsing strings and what not i hope that i am not too off base

sorry about the context switching. your original question was “is all of sclang available.” to which my response is “yes, and sc3-plugins,” with the (probably obvious) qualification that you can’t use SC graphics or UI classes. those rely on graphics frameworks (Qt, etc) that don’t exist on the norns system.

we don’t have a way to draw to the norns screen directly from SC. (we could add it, but it would break the norns menu. we’d want to add additional glue for lua to hand-off screen control to the engine, and take it back in menu mode. maybe this is a good idea, maybe not, i’m open to opinions but again, tend to think we should try to use the lua side for UI and compositional logic, even if we’re really used to sclang.)

we also don’t have a way to read encoder and key movements directly in SC. here i’d really like to draw a hard line, and keep enc/key handlers hardcoded through matron, so the norns menu can make appropriate use of them (saving and restoring callbacks.) if you want to just directly send encoder deltas and key states to an SC engine, you can do so:

(Engine_MyEngine.sc)

Engine_MyEngine : CroneEngine { 
  alloc {
    this.addCommand(\enc, "ii", { 
      var which = msg[1];
      var delta = msg[2];
      do_something_with_encoder_movement(which, delta);  
   }
}

(msyscript.lua)

engine.name = 'MyEngine'

enc = function(n, d) engine.enc(n, d) end

in the lua script, enc is a special global variable, and the menu system will save and restore callbacks defined this way when toggling in and out of menu mode.

(and similar for keys)

so: “having encoders do math and stuff” - of course, its necessary to perform computations in response to encoder movements. we’ve built out some methods for mapping controls in lua that closely parallel ControlSpec and related sclang classes, and can be easily plumbed into the “parameter” and “parameter set” abstractions in lua.

we’ll will continue to build this out as well, and i imagine some useful abstractions could be broken out like long-presses and momentary mode toggles.

i tend to think this is the best place to do all your musical parameter logic, and engines should accept “raw” values like frequency.

but other options are available and not a big deal.

re: jukeboxers, files:
i tried to show a simple example of loading a file this with my silly sample-flapper script. for a more sophisticated approach see mlr or playfair scripts - the former uses the SoftCut engine and the latter uses the Ack engine. they tie a little deeper into some path-handling abstractions and also store sample paths as script parameters.

in both cases, lua side doesn’t actually load sound files, it just sends paths to the engines. (the engines have load commands accepting sound file paths.) matron does link libsndfile just so you can query soundfile durations from lua.

3 Likes

right
that’s what i was thinking
and again so much of this Ezra if we had a 5 minute conversation i coudl stop bothering you but thanks for being so patient with the ka-zillion questions, sincerely.

That’s why i thought maybe a coffee/code/chat could be cool so we could share some ideas and walk away with a more firm direction of what can and cannot be done and what might be a goose chase or a rabbit hole — i am sure you know what i mean

TY

yes totally
if we’re gonna do a discourse tomorrow/sun maybe that will be a good opportunity
lmk so i can plan my days a bit

I bet ya’ll get together to talk about Norns development and a really cool DnD game breaks out.

3 Likes

Wizard is about to die…

Small point of correction (forgive me if I misunderstand what you’re getting at here!) - there is no performance difference between sclang code compiled in the classlib, and sclang code compiled at runtime. Compilation itself is not free, but is quite cheap - compiling something of the complexity of the engines in dust is on the order of <1ms. Of course if you’re compiling code every time a parameter changes, or building a new synth for each note, it’s a performance problem because of bad design, not because of compilation itself. :slight_smile:

You’re right that a class-based approach is best practice, though - there are clear benefits in terms of having Engine’s be something stable and well defined, so that norns can interact with and manage them.

2 Likes

thanks for the correction. of course you’re totally right, there’s no difference in execution time once a chunk has been compiled. but runtime compilation has its own (marginal) overhead, is what i meant - not just for synthdefs. and its surprisingly common for beginner code (or just sloppy last-minute performance code) to call interpreter in a hot loop or calback at runtime. (i totally overstated the point though.)

anyway that’s a trivial consideration compared to the architectural advantages of using classes. the debate in my mind is whether those advantages are worth forcing a recompilation of the class lib anytime anything changes.

1 Like

i’m able to edit matron code and update it on norns now. here are the steps for other windows users:

after editing, copy updated files to norns (using SFTP here, haven’t tried sshfs):

  • connect to norns over wifi
  • using Far Manager change drive to NetBox
  • create new connection, type SFTP, port 22, norns.local, username we, password sleep, try and connect
  • if you get unexpected SSH2_MSG_UNIMPLEMENTED packet error, edit connection, navigate to “Options controlling key re-exchange” and move Diffie-Hellman group exchange to after Diffie-Hellman group 14 and group 1

should be able to connect now and update files on norns:

  • open bash
  • ssh we@norns.local or IP (i had to use IP address)
  • once you’re in cd norns, then ./waf to compile
  • restart matron by doing ./stop.sh and ./start.sh

i’m able to make changes and update matron by doing ./stop.sh and ./start.sh. however when i run ./crone.sh > /dev/null i get the following error:

we@norns:~/norns $ ws-wrapper: ../ws-wrapper/src/main.c:43: bind_sock: Assertion `( *eid = nn_bind(*sock, url) ) >= 0' failed.
./crone.sh: line 8: 26151 Aborted                 ./build/ws-wrapper/ws-wrapper $SCLANG ws://*:5556
2 Likes

error likely means something already bound to that port. if you did ./start.sh it already ran crone.sh so there’s your trouble. if you wan to run matron alone with terminal I/O, run the executable directly (norns/build/matron/matron)

2 Likes

I’ve been doing some work on a flexible lua class for drawing graphs, WIP video below.

The idea is you can load it up with points and draw them in a variety of styles scaled to axes and screen area (so it can sit next to other UI). Or you can give it a y=f(x) function and it’ll plot that, as shown at the start of the video.

I’m keeping the interaction examples to just using enc2, enc3 and key3 so that these could potentially be integrated into sub-pages of the Parameters screen at some point, keeping the back button free.

Couple of questions:

  • I’d like to align the envelope curves with those defined in SC, does anyone have an understanding of how the curve argument is used by SC in Env? I had a look at the code but… yeah :grimacing:
  • Also if anyone has advice for how to graph filters (Bode plot?), code snippets, etc that’d be much appreciated. Maths is hard :sweat_smile:

Thoughts and feedback very welcome!

41 Likes

Can you pass compile options to waf (with current wscript) or do I need to edit wscript?

( I want to pass some compiler defines as you would in make/ cmake )

do you mean when you give a numerical value for “curvature”? good question, i’m finding it oddly difficult to pin down. @jah has added warping functions to norns/lua/util.lua that parallel SC’s explin, linexp, &c. maybe those are useful. we’ve also added a taper with a bipolar curvature control in norns/lua/params/taper.lua, which is, i’m guessing, neither the exact same curve, nor very different. in lua it’s formula is
y = (math.exp(x * k) - 1) / (math.pow(math.exp(1), k) - 1)
where k is the curvature param, and x is the input (nonnegative.)

i’ll see if i can spot SC’s formula for envelope curvature.

re: bode plots. indeed that’s a bit daunting. the math is not necessarlily too bad depending on how far down the rabbit hole. but the mag response would have to be worked out for each individual filter type. then that could be painful. for some types there may not be an easy analytical solution at all.

  • LPF, HPF, RLPF, RHPF ,Resonz, Ringz, Formlet i think are all standard 2nd order IIRs, should be prettty straightforward. but some use have different weird formulas for their arguments - e.g. Ringz is constant-skirt gain.
  • MoogFF is documented in a paper somewhere. MoogLadder is not documented at all (i think it is ripped from random musicdsp.org code)
  • SVF would just have to look at the code. it could be easy (if it’s straight outta chamberlin) or impossible (if it uses nonlinearities)

i would find this a fun and useful project (tracking down mag response functions for all SC filters) but ATM i have no time for it :frowning:

then pragmatically, youd have to ensure you are using the correct filter type. that’s part of a larger discussion we’ve been having, which is to enforce paran type documentation for engine commands (hm, i’ve lost the GH issue right now :confused: )

general-purpose bode plotters (and say, MATLAB) just cheat and do a brute-force measurement - FFT of the filter’s response to white noise and sweeps. but that’s not really a feasible option here

and i’ve seen more than one commercial software UI that just cheat and use a simple filter to stand in for a complicated / proprietary one, for UI purposes. which is not always the worst choice esp. in a low-rez environment like this.

lovely work by the way. more drawing abstractions extremely useful indeed

youd need to add options to wscript. or use CFLAGS env variable maybe?

1 Like