This is a silly question, but I’m going to ask it - in the very beginning of crow studies there is this:

This sets up a knob and screen interface for two very simple commands:

crow.output[1].volts = 3.33
crow.output[1].slew = 0.1

Is maiden the intended coding environment for these commands since we are using Norns in this case to interface with crow?

Sorry for such a basic question, but I’m an absolute beginner when it comes to anything code related, though I am really interested in contributing once I start gaining some competency.

I don’t have my crow yet, but looking at the studies it looks like you should be downloading the studies file to the Norns and then walking through the code in the files you downloaded. Maiden would be a great way to read and edit the files.

1 Like

Currently the most direct way to “live code” with crow connected to norns is to use the matron REPL area within maiden. For example here is what interacting with crow looks like:

One thing to keep in mind is that when using norns + crow all the crow functions/data need to be prefixed with crow. (unlike if using druid to directly connect to crow)

If experimenting with the code listed in the studies you can use maiden’s editor to enter or modify the code just as you would any other lua script on norns. Press the play button to run the script and norns + crow should do their thing.

4 Likes

Not sure the best thread to post this but I’d love for there to be a way to send microtonal/just intonation notes to just friends from norns. Something like the crow.ii.play_note() that accepts hz or a ratio. Is this something that can be done in lua?

It would also be great to have this for the crow.output methods to easily translate a frequency or ratio to V/8.

1 Like

you can do this now!

crow.ii.jf.play_note( note, velocity )

“note” is in volts. so you can absolutely send a ratio, ie: crow.ii.jf.play_note( 5/3, 5.0 )

(here, “velocity” is also in volts, so it’ll make a 5.0 volt amplitude shape)

you can make a scale then:

scale = { 1, 5/3, 7/2, 9/5 }

and then reference notes in that scale

crow.ii.jf.play_note(scale[2], 5.0)

(this would play 5/3)

13 Likes

Hi all. I’m having trouble getting input[1] to respond to rising/falling changes correctly. input[2] works fine, but when trying with input[1] I get the following error “[string “eval”]:9: attempt to perform arithmetic on a nil value (field ‘?’)”

Here’s my sample script. If input_num is set to ‘2’ (and you have a clock in input 2) everything works fine, but switch input_num to ‘1’ (and move your clock to input 1) you should see the error.

local state = 0
local input_num = 1

function init()
  crow.input[input_num].mode("change",1,0.1,"both")
  crow.input[input_num].change = function(s)
    state = s
    redraw()
  end
  screen.level(15)
  screen.aa(0)
end

function redraw()
  screen.clear()
  screen.move(10,40)
  screen.text("Change: "..state)
  screen.update()
end
1 Like

I’m seeing the same behavior. STREAM or CHANGE works as expected into input 2; STREAM works as expected into input 1, but CHANGE does not appear to respond to the input signal (I tried gates and LFO’s).

1 Like

thanks for the heads up— i’ll check this out

2 Likes

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

7 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
4 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{}?