# ^^ crow: druid scripts

I’ve not tried it yet but I’m reading through the Boids script and it’s blowing my mind. This module is so exciting.

I was messing around making a Krell patch (I’ll share that later…) where I wanted some more control over the weight of the randomness than a simple exponential curve. I figured other people might find the curve function useful so I put together a simple example script. In addition to the min/max value settings, the method has three parameters that control how the randomness is weighted, each an integer value 1 -6:

• curveLevel - higher values make a steeper curve favoring one end
• bellFactor - higher values focus the curve more sharply in the middle
• direction - which end the curve favors - up or down

Here’s a chart that will hopefully help make sense out of how the curveLevel and bellFactor interact.

Click to see chart

Here’s the example script. It doesn’t do anything interesting, it just has a metro sending random voltage out of output 1 based on the settings. Connect output 1 to an oscillators pitch and you can hear how the curve sounds as you adjust the values (curveLevel, bellFactor, and curveDirection) via druid.

curvedrandom.lua (1.1 KB)

6 Likes

I made another little utility. I’m always finding myself befuddled about the CV range a given input wants to see. The main function of this script is to take CV into input 1 OR input 2 and scale it out the outputs.

• If it sees voltage at input 1, it sends a separately scaled voltage out each output
• If it sees voltage in input 2, it sends the same scaled voltage out of every output

You can also send it a message in order to just send an arbitrary fixed voltage out each of the outputs, or a different fixed voltage out of each.

Hopefully the comments in the script will make usage clear. Let me know if something doesn’t make sense.

vults.lua (3.1 KB)

7 Likes

Hey,

I’m not lua or music theory wiz, but i think the major chord should be {0, 4, 7, -12} (or if 0 doesn’t work {1, 5, 8, -11}).

So all the starting notes (or following notes) are off by 1.

Ah yes I think that is correct. Heh. I’ll have another look, thanks! Haven’t had time to look at crow in the last few weeks, must get back to it.

Here’s my take on the Krell patch. If you are unfamiliar with this idea, find info here:

https://learningmodular.com/glossary/krell-patch/

My Crow version outputs envelope and pitch plus two other user selectable CV values. I hope that between the comments in the script and the sensibly (?) named variables, the use of this patch should be fairly clear (though perhaps not simple…but if we have to wait for me to write a more thorough manual, we’re all going to grow old and die). Of course, feel free to ask questions if anything is unclear.

krowll.lua (4.9 KB)

Here’s an example of the patch in use:

11 Likes

I’ve been working on this script off and on and wanted to share something I thought might be useful to others.

Here’s the script: jfInt.lua (1.3 KB)

In short it plays notes from an array of arrays using integers for rhythmic information.

All the variables used for incrementing live in single-entry arrays because Lua passes arrays by reference (and passes numbers/strings by value), which is useful for maintaining global state while also allowing me to cut down the amount of repeated code.

6 Likes

Hey

I’m looking for ideas on how to write a burst generator that would automatically calculate incoming clock before delivering bursts - basically, I don’t want to specify a “BPM” value for my script to work. I guess there are different possible strategies, but maybe you guys have hands on experience on something like this?

More generally, I’d love to read more code around timing events and using metros

Also, posted in another Crow channel:

2 Likes
``````last_tick = time()
bpm = 0

function init()
input[1].mode('change',3.0,0.1,'rising')
metro[1].time = 1
metro[1]:start()
metro[1].event = function(c) print(string.format("metro[1] bpm: %d", math.floor(bpm))) end
end

input[1].change = function(state)
local elapsed = time() - last_tick
bpm = 60000/elapsed
metro[1].time = elapsed * 0.001
last_tick = time()
end
``````

That will take an incoming clock and adjust a metronome to be set to the rate of the incoming clock. Then you could just take that metro and fire on every X events to divide or whatever, have another metronome set to be a multiple of it to multiply… Gives you BPM as well if you want to do something with BPM within a range or whatever…

I don’t know if updating the metro speed that often has any drawbacks but it seems to work ok for me.

Actually in the first post Voidstar’s modes.lua sets up his ms-interval checking by calculating a running average of the last 2 numbers cumulatively to smooth out tempo changes that’s a good way to do it.

1 Like

Does anyone have any ii specific Just Friends druid scripts they could post? Just hooked up my crow and JF via i2c and interested to start testing things out!

1 Like

Blame it on the lack of time I had yesterday, but I found the shift register script with jf ii built in and it’s working great!

I’m a complete coding noob, but excited to have more ammo for my dangerous copy and paste skills.

1 Like

This is exactly what I’ve been wanting. Does it work like the qubit chord auto harmozing?

it works at a basic level, but it’s not very musical, and could do with some work to make it more functional. Also I never got round to updating or testing what the chord voicing should be. @Taubaland above suggested some changes about to how to voice chords, but really this needs a bit of work to make it useful.

is there a detailed description somewhere about how the qubit module works?

Hey @forrest thanks a ton for the code and pointers to @voidstar’s script. I tried something in that vein on my side here (in JS…): https://github.com/hypervillain/crow/blob/master/kompass/burst.js#L44 (with some burst related code if anyone is interested).

I’ll definitely use metros like you do when luafying my code

1 Like

Ah ok, I tried to add JF to the code but couldn’t work it out. Hopefully this could be added as I would love to replace my chord v2 with JF if it could play the correct chord voicing and quality. There is some fantastic information on chord quality and voicing at the back of both manuals for chord and chord v2. You could use those to get all the info you need.

I can try and help with adding JF but my coding skills are super basic.

my skills are rudimentary too I’ve updated my original post with a slightly updated version that uses chords as set in the music thing chord organ module.

oh cool ill have a look at it. Ive been thinking that I would need to create a proper reference table for the chords as well and make an input on crow change the voicing. Don’t think this will be easy but it will be a very cool script once done. Maybe dm me and we can work on the script together?

3 Likes

Seems silly but I can’t find the ‘First’ script anywhere and it doesn’t appear to be in the Bowery? Can anyone share it please?

First.lua gets included into the firmware image so that it’s always available, so it’s among the built-in lua files in the crow source here.

Hmmm I guess I don’t know how to get it back playing on crow now that I have the clockdiv.lua script on crow. If I try r first.lua in druid I get a syntax error. I just started uploading scripts to crow today and it works but all the scripts I’ve uploaded successfully to crow are in the Bowery. First isn’t in the Bowery though?