How did you set that up?

I think @zebra just meant use the menu system on the device. reloading a script becomes muscle memory during debugging

that said, the command line version of maiden could be revived. the old version uses IPC which was in place before we moved to websockets

but you can also just execute matron directly as mentioned but there is no readline

Bringing this back up after nearly a year + away from Lua if anyone has ideas!

1 Like

I wrote a basic screen line wrap function a long time ago… I’ll try to dig that up again this afternoon.

@Olivier check out the stuff in my HID-demo - there’s a textwrap() function there which could get you going.

2 Likes

Can anyone point me toward some patterns for midi controller integration/parameter mapping? I got a 16n faderbank lately, and I think enough norns users have one that I’d like my app to have ā€œplug-and-playā€ support for that device, but I don’t know if there is prior work on that.

I’m thinking it would look something like a parameter with a midi device selector, but still wrapping my head around it.

1 Like

I don’t have a 16n, but I think you just use the parameters menu to midi map faders to control type parameters.

So supporting midi devices like knobs and faders is really just about making your params control types.

1 Like

I tried implementing the generate_scale function today for the first time, but I only got halfway there in my amateurish attempt. I added a require for musicutil, and then implemented this as a test (along with a note variable and the midi_to_hz function):

scale = m.generate_scale(0,"minor",2)

This is doing something (sounds like a chromatic scale), but changing the scale type – minor, major, aeolian, etc. – doesn’t seem to have any effect. Is there something obvious I’m missing?

it might be case sensitive (Minor) or some other kind of case error with music util, i vaguely remember messing that up a lot

1 Like

Hi,

I need a hand with something. I would like to draw the waveform of the audio recorded in softcut via softcut.rec(1,1). Is there a simple way to do this using the core libraries?

1 Like

no, there isn’t. it needs implementing thumbnails on crone side for starters

(or, switching to shared memory or some other IPC layer that is more efficient than OSC)

thanks for the fast reply.

I’m trying to make a lib that will impersonate a grid (with data from OSC)

So… How can I emulate a grid key press from a script/library?

Seems like I need to make my own version of norns.grid.key = function(id, x, y, s)
I have x,y,s values but I’m confused looking at the grid.lua source on what happens in the norns.grid.key function.

Any pointers?

just call norns.grid.key normally?

that is what the C layer does when it handles a keypress from libmonome

ed: nevermind let me think of a real answer…

Hmmm. I tried that and there’s no grid, so it errors:

lua: /home/we/norns/lua/core/grid.lua:187: no entry for grid 1
stack traceback:
	[C]: in function 'error'
	/home/we/norns/lua/core/grid.lua:187: in field 'key'
	/home/we/dust/code/oscgrid/lib/oscgrid.lua:31: in field 'key'
	/home/we/dust/code/oscgrid/lib/oscgrid.lua:17: in function 'core/osc.event'
	/home/we/norns/lua/core/osc.lua:87: in function </home/we/norns/lua/core/osc.lua:82>

I figured I’d need to make a copy of norns.grid.key that does not assume a grid is connected

yes, or spoof the device pointer provided by libmonome and stored in the lua Grid class

viz., call grid.new with your virtual device and a made-up id/pointer

you would also need to glue grid.led differently

With Grid.new (or norns.grid.add) I’m not sure what to use for dev tho…

(can’t seem to create userdata table from lua)

yeah - I didn’t get that far yet. :slight_smile:

Feels super hacky so far but I got something working to hijack grid key presses:

and then also LEDs

Also - made a repo for the work so far - I could really use some help to clean up the library part of this. https://github.com/okyeron/oscgrid

6 Likes

Any recommendations for tools to format lua and supercollider scripts? Maiden makes it difficult to tell where you have spaces and tabs, which makes the scripts hard to read when I open them on other machines.

I wrote a small script that just uses expand to make sure the spacing is consistent. I’m wondering what other people do.

I’m considering moving to just use emacs for everything, and letting emacs do the formatting, but from what I’ve seen elsewhere, it seems like the supercollider support for emacs is kind of rotted. lua-mode for emacs is good.

The supercollider IDE does a reasonable job, but I’d prefer something I can run from a terminal.

I’m working on an adding an earthsea page to mlr. I’ve got it pretty much all the way there but I’m trying to get the pattern recorders to watch and play back presses on the keys page. I can get the patterns to count key presses but nothing plays back. If I add something like e={} e.i=i e.t=eNOTE event(e)
I get an error

Summary

/home/we/dust/code/mlr/malarkey.lua:960: attempt to compare number with nil stack traceback: /home/we/dust/code/mlr/malarkey.lua:960: in global 'grid_note' /home/we/dust/code/mlr/malarkey.lua:155: in global 'event_exec' /home/we/dust/code/mlr/malarkey.lua:78: in global 'event' /home/we/dust/code/mlr/malarkey.lua:976: in global 'grid_note' /home/we/dust/code/mlr/malarkey.lua:947: in global '_gridkey' /home/we/dust/code/mlr/malarkey.lua:318: in field 'key' /home/we/norns/lua/core/grid.lua:183: in function </home/we/norns/lua/core/grid.lua:174>

If anyone has a moment to look over this code I would really appreciate it. I’m sure it’s a pretty simple fix, i just don’t really know what I’m doing
The relevant lines are around 154 and 959

2 Likes

Great to see earthsea part of mlr :slight_smile: