^^ crow help: norns

will there be a standard way for norns to read the value of a global variable from a running crow script?

i’m guessing currently i would crow.send a print statement and parse the result?

1 Like

This is something I’m wondering about too.

I have a project in mind where I would love to run code on directly on Crow written in Druid, and have it communicate back to my Norns, rather than make the Norns do all the work and treat the Crow as an input/output expander.

Also FYI, for those of you with an Ansible I added a study example here for connecting together your Crow and Ansible via i2c.

1 Like

you might be able to hack this now with crow.send paired with redefining crow.receive (this is in norns master, so you’d need to pull from git, not released yet)

we could probably integrate some sort of value query helper function into crow itself? @Galapagoose what do you think?

1 Like

Absolutely possible (i’m working on something similar to this for a norns+crow script right now), and doesn’t even require updating crow’s firmware - just adding a function to your script. Will post again with that example script once it’s working!

5 Likes

Awesome, doable without a firmware update is the best kind. Thank you and excited to see how it works!

Awake now has crow clock output

6 Likes

thanks for the help. I’m a little confused how this would work. each ET semitone is 1/12 a volt, correct? if I tried to play a 3/2 though, that would be the same as sending jf.play_note(18/12) which would play an ET note 18 and not a just fifth. am I missing something?

I was confused about this a few days ago as well. I found that what I needed was to use the log base 2 of the ratio:

crow.output[1].volts = math.log(3/2) / math.log(2)

There’s also a nice little library of JI tunings built into norns. You can use it like this:

local ji = require 'intonation'
local ratios = ji.overtone()
crow.output[1].volts = math.log(ratios[scale_degree]) / math.log(2) + octave
2 Likes

I am also finding that I cannot get input[1] to respond to gates:

  crow.input[1].mode('change',1.0,0.1,'rising')
  crow.input[1].change = function(s)
    step_channel_1()
  end

  crow.input[2].mode('change',1.0,0.1,'rising')
  crow.input[2].change = function(s)
    step_channel_2()
  end

but only channel 2 is working.

@germinal what modules are you clocking with?
Have you tried changing the threshold value (currently 1.0 in your codeblock). I’d try something around 2.0, and if that still doesn’t work, something lower like 0.4V.

Thank you @Galapagoose -
I’m using gate outputs from Marbles - the spec says 0-8v gates.
I tried setting the threshold to 2.0, 4.0, and 0.4 - input[2] triggers accurately with all of those threshold
settings, no response from input[1]

I tried using input.query() to check what values are present at each input, got this:

>> crow.input[1].query()
<ok>
crow input stream: 1 0.05141783
>> crow.input[1].query()
<ok>
crow input stream: 1 7.651477

>> crow.input[2].query()
<ok>
crow input stream: 2 0.05831957
>> crow.input[2].query()
<ok>
crow input stream: 2 7.721452

I think this suggests that I am reading the right voltages at both inputs, but for some reason only input[2] is triggering the action?

I started looking at the Norns crow lib - if i understand right, it’s sending Lua over the serial connection? - and I wonder if Norns should be sending the command set_mode instead of mode here:

to match the crow API?

Update: since this looks like a Norns issue rather than a crow issue, I made an issue and a pr on norns – no idea if I’m on the right track or not though.


1 Like

Any tips for using asl actions like lfo or the ar envelope in norns scripts? I tried including a local copy of the asllib.lua file and pointing to it from my norns script, but I still get errors when attempting to call the ar function - for example - from init(), i.e.

crow.output[1].action = ar(0.01,0.5,5)

Is this a syntax thing, or am I better off creating an envelope manually with to{}?

It has to be wrapped in double quotes like a string, I think it’s getting run on Crow itself.

crow.output[1].action = “ar(0.01,0.5,5)”

2 Likes

wow, this is totally confusing as i swear the crow studies were working. thanks for investigating, i’ll check this out tomorrow.

1 Like

Amazing — got it working just now, thanks!

1 Like

Been thinking about bi-directional communication between Crow and Norns a little more. I would love to be able to run an algorithm on Crow and plug in Norns in order to say, manipulate some parameter values with my Arc, but not have to keep the Norns plugged in beyond that point.

That ability to add a layer of abstraction as opposed to directly setting output values from the Norns code, could let people do some pretty cool stuff with hybrid Crow/Norns scripting,

I have this kind of thing working, but it’s a lot of boiler plate to keep the devices synced. Working on a little library for norns to standardize these kinds of interactive setups. Hoping to have something posted this week, there’s just so many things to focus on!

6 Likes

I’m pretty sure this will work already. I’ve asked a question about doing something similar, and my understanding is the crow script is always running, so you could have a second norns script for modifying your crow script params (which would work the same as updating those values by livecoding in druid), and if you switch norns scripts (or disconnect norns) it should remain in that state.

1 Like

ok i’ve stumbled upon this crow norns connection issue: https://github.com/monome/norns/issues/915

working on it. this crept in with v1.0.0

edit: fixed it! norns update forthcoming (tomorrow)

1 Like

fwiw @nosollution @jakecarter - I managed to fix my input[1] by running crow.clear() from the maiden console - no clue if y’all are still seeing that issue or even if it’s the same root cause, but thought I’d share in case it helps.

In general, I wonder if it should be best practice for norns scripts that use crow to call crow.init(), crow.reset(), or crow.clear() at startup?

I’ll admit to being a little bit confused by crow keeping a stored script in flash that is different from, and can interfere with, what it receives from norns.

1 Like