Bingo! Thanks, Justmat

1 Like

metro questions!

I’d like to make a delay() or wait() function but not real sure what to do.

As an example - On a specific user interaction I’d like to have a function fire x amount of times with a 1 second interval. So with Arduino (that I know pretty well) I could just use a delay(1000). Here on norns I need a metro, but this seems different than doing a callback function every tick of the metro.

1 Like

yes, you’ll have to indeed create a metronome and stop it after X runs (see count parameter to metro.init). or create a bunch of oneshot metros running one after another. there’s no delay() as such because it will block the lua interpreter from doing other work (handling messages, etc.).

i’m currently working on a clock module that uses coroutines for concurrent wait operations and it will provide a more intuitive way to do the above.

8 Likes

FWIW - I tried this but was getting -1 for count so I must’ve been doing something wrong. I’ll have to look at that again.

I ended up making my own counter in the metro callback and then stopping the metro as you suggest. I wasn’t sure at first if it was OK to stop the metro from within the callback, but that seems to work just fine.

Is there a way to execute run script via ssh?
(i.e. whatever magic that the Maiden ‘run script’ button does)

Working in a text editor and sftp right now and I have to reach over and click buttons everytime I want to re-load the script I’m working on. Gets tiresome after the 100th time.

2 Likes

options

  1. run matron directly instead of using the websocket wrapper, call script.load(foo) directly from the REPL.

  2. roll a little utility with readline and nanomsg to act as a local websocket endpoint.

but no, there’s no utility to make this easier at the moment. would be a nice addition.

1 Like

What @zebra said but I believe the function is norns.script.load(...) - at least that is what maiden is using.

Could I curl whatever maiden is doing?

Unfortunately no - while maiden uses HTTP for all the file I/O the REPL and the play button work by talking with matron and sc via separate web socket connections.

The play button works by sending lua code directly to matron as if one had typed it into the REPL.

You could make a web socket client to do it - it wouldn’t disrupt the other parts of the system but it is work.

Thanks! I’ll investigate that aspect further. What’s the format for that message/request?

1 Like

Does anyone have any code for selecting an IP address within the parameter menu? I have a script that is sending OSC and I’d like to be able to select the IP address it’s sending to via the parameters menu.

i don’t believe there’s a good way to do this presently. we need to create a string type for params, and then use the textentry for interfacing.

your use case is a good reason to add this. https://github.com/monome/norns/issues/735

2 Likes

Is there a way for me to simulate the Norns screen while I wait for the Norns itself to arrive? I have a few ideas for patches and want to get coding. Also it would be useful generally for coding at work during quiet periods.

1 Like

I don’t think there’s currently a way to do so, see https://github.com/monome/norns/issues/732

1 Like

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.

2 Likes

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.

3 Likes
6 Likes

Great idea! 20characters

1 Like

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)
        grid_device:all(0)
        grid_device:rotation(value)
        grid_device:refresh()
    end}

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.