I’m getting some very strange behavior when connecting crow to norns. It seems like crow keeps running its script (in this cast, the default First script outputting 2 pitch/env pairs whenever a gate is received on input 1) even when it’s connected to norns. It’s doing this in addition to whatever commands my script sends it. I’ve tried calling crow.reset(), but that doesn’t seem to help.
Additionally, it seems that my crow <-> clock integration is basically broken. It’s worked a few times, but most of the time no matter what clock I send to crow input 1, it doesn’t change the tempo.
Maiden is showing now errors, crow.connected() returns true, so I don’t know what’s going wrong…
EDIT: callling crow.clear() when the script starts seems to have fixed all my issues… reading back through the thread this has affected a few people, so I’d love to hear if this is the “right” way to use Crow with norns, and if so it should probably be mentioned somewhere in the documentation
I’m also wondering how to be robust to crow disconnect/reconnects. If I unplug my crow, then plug it back in, it seems to no longer send or receive any values. Interestingly, its ability to detect clock seems to keep working, so there’s probably something that the main norns system is doing to fix this that I could port into my script
Can you confirm what version of crow firmware (crow.version()) and what norns software release you’re working with?
It appears that what this function does is causes crow to evaluate this function, which resets crow’s input handlers, clears crow’s metros, and zeros the outputs but does not otherwise clear the script. This gets run when a norns script initializes or when a crow device is added (here) so it seems odd that this would need to be called manually during your norns script’s init function, but the behavior you describe seems consistent with crow.reset() not being sent and hence crow still using the input handlers from the First script. When I have first loaded and connect crow to norns, matron prints:
>>>>>> norns.crow.add / 2 / crow: telephone line
and crow stops outputting envelopes / doing First stuff. Additional disconnects / reconnects show:
I have yet to learn about the clock system so I can’t really advise here but I would guess that this could also be explained by norns not setting up some default code to run on crow when your crow is connected.
This was always returning true due to a bug but this should have been fixed in the 200604 update. But maybe the connection detection logic is not working or something, hence crow.reset() not getting re-run?
Yeah this will clear the crow userscript from flash and reset crow’s Lua VM. As such it is not probably a good thing to do in norns scripts intended for public distribution since it might wipe out a stored script.
crow v1.0.0, norns 200604. I just got this crow brand new a bit more than a week ago, so I assumed it was on the latest (which https://github.com/monome/crow/releases shows as v1.0.3), but I guess not. I’ll update to v1.0.3 and see if that fixes things.
Yeah, crow.reset() didn’t help, it was crow.clear() that did.
I get the same printout, and at first crow stops running First. But if I switch norns scripts, crow goes back to doing First stuff
That makes sense, but it also seems to be the only way to get crow to stop running whatever user script it has on it, at least for v1.0.0. I’ll update to v1.0.3 and see if that fixes the issue.
Thanks for the thorough reply!
EDIT: updated to v1.0.3, no change in behavior. To quickly summarize repro steps:
Make sure the user script on crow is First, crow and norns are powered on, not yet connected
Get sound from First (send a clock to crow input 1, send outputs 1 and 2 to a vco v/oct input and a vca cv input, respectively)
Connect crow to your norns, hear First stop running
Go to norns menu, select a different script, launch that other script
First resumes running. If the script you just launched uses crow, its communication with crow will be added to First’s behavior, rather than replacing it. Also, the crow->norns clock connection is broken: the tempo norns sees doesn’t match the tempo crow is being sent, and changing the tempo of the clock gate that crow is receiving results in no changes on norns’ end (although it does change the speed at which First runs)
2nd EDIT: this seems to only affect some scripts. Here’s the minimal reproduction script I’ve found:
for track=1,4 do
crow.output[track].action = "ar()"
(as in that’s literally the entire norns script). Upload that script to your norns, then follow the reproduction steps listed above, and where the steps say “select a different script”, select this minimal reproduction script.
Thanks for the procedure. I’m not actually able to reproduce this behavior at these versions with this script, unfortunately – First stays stopped until I explicitly restart the crow firmware by sending ^^r. Quite puzzled by this at this point!
spent some time this morning testing and i believe there’s something wonky happening when redefining the norns clock source. if norns clock is already set to internal when loading the test script, then everything works as expected – eg. First stops running, each of crow’s outputs are AR envelopes and can be triggered with crow.output[x]() messages in the REPL.
however, as soon as the norns clock source is changed to crow, i get the described behavior. i’m running 200604 on norns and the public 1.0.3 crow firmware.
here were my steps
had awake loaded on norns, First running on crow, both disconnected from the other
norns clock set to internal
connected crow to norns, First stopped running
switched from awake to the test script, still nothing
executing crow.output() in repl produced AR envelopes
changed norns clock to crow, First restarted and executing crow.output() in repl would not produce an AR envelope
changed norns clock back to internal, First continued running
executed crow.init() in maiden repl, first stopped
switched norns clock to crow, First’s out 1 action (v/8) restarted though i did not see pulses from out 2
reran the test script with norns clock set to crow, First restarted with both v/8 (out 1) and pulses (out 2)
additionally: from the clock code, it seems that crow.input.mode("change",2,0.1,"rising") gets executed when source is set to crow – executing this in the repl with the test script + clock source set to internal (the known “good” state from my testing) immediately re-enables First’s actions
Awesome work! I can confirm that I’ve had clock in crow follow mode the whole time, so that matches my experience. To be clear: I’m not switching from not-crow-clock to crow-clock at some point during the steps I listed, the norns is just in crow-clock mode as effectively step 0 and just stays there throughout the reproduction steps.
The clockcode just turns on the change mode on crow again.
The issue here is that First redefines that change event to control things internally on crow, rather than send the default message to norns. I’m going to change this behaviour so that the crow.reset function doesn’t just set input[n].mode = 'none' but also resets the event to the default usb message.