oooooh. I’m about to go to work but first thing when I get home :slight_smile: I wouldn’t be surprised if my script broke crow.

If you any issues getting into bootloader mode, remember you can always use this method!

1 Like

If I start an LFO like so:

output[n](lfo(4,2))

The only way I can find to change the rate, is to reassign it. Something like:

output[n].action = lfo(1,2)

But this appears to wait to the end of the cycle before switching, and it also seems to (sometimes?) have a bit of a delay before the new LFO starts.

Is it possible to dynamically change the rate of an LFO so that it can smoothly change rate at an arbitrary time/point in it’s cycle?

2 Likes

Here ya go - this handles changing lfos without creating entirely new actions - off the top of my head, pretty sure the effects wait until the next break point to take effect, but I could be wrong…

period = 2.5
amplitude =5

dynamicLFO = lfo(function() return period end, function() return amplitude end)

output[1](dynamicLFO)

then send new vals - you do not need to create a new action:

period = 0.4
amplitude = 1.3

instead of creating new variables “period” and “amplitude” above, you can also take advantage of the output tables:

output[1].rate = 1
output[1].level = 5

output[1]( lfo(function() return output[1].rate end, function() return output[1].level end) )

more info here

2 Likes

it would be awesome to have these little functions and patterns collected somewhere in the docs (thinking of your quantize function as well) so people didn’t necessarily have to go digging through the forum or reading other people’s scripts to figure it out.

just a thought. since you can’t include external library functions in a crow script, it might be cool if this type of thing was centralized somewhere for reference

3 Likes

See this thread

Maybe the index can gather or link to collections of code…

In addition to the scripting reference and scripting tutorial, I think that bowery can serve that purpose to an extent - while some of the scripts are more complex (e.g. boids.lua), others are clear demonstrations of brief, useful concepts on crow (e.g. samplehold-basic.lua). I’ll upload my quantizer script tonight as another basic example!

Having said that, there is of course always lots of room for more educational analysis of scripting, whether in video, text, or tutorial form - something I (and many others I’m sure) hope to continue working on!


and the relevant discussion thread:

2 Likes

Yes, that appears to be the case, so unfortunately, this doesn’t solve my problem. It is a useful construction though, so thanks for the example.

In an attempt to solve my own LFO problem, I’ve come up with a (very) rough solution. The script below is just a proof of concept, and this example is limited to a sawtooth wave, but it does seem to work pretty well (as far as it goes).

I’ll make a more full featured version and post it in the script thread when I’m finished, but I think I’m about done for the night so I thought I’d post the rough version here in case anyone finds it useful in the meantime (or has any better ideas…).

Does anyone know what the smallest interval that is recommended for the metros? Values as small as .001 seem to work, but I wonder if that’s a Bad Idea.

--- cv controlled lfo
-- in1: LFO rate
-- out1: LFO

function init()
    resolution = 0.01
    rate = 1
    depth = 3
    phase = 0

    input[1].mode = 'stream'
    input[1].stream = function(volts) rate = (volts / 5) + .05 end

    lfo = metro.init{event = run_lfo, time  = resolution, count = -1}
    lfo:start() 
end

function run_lfo()
    phase = phase + ((1 / rate) * resolution)
    if phase > 1 then
        phase = 0 -- + (phase - 1)
    end

    output[1].volts = phase * depth
end

Everything was working great a couple days ago, but now everytime I try and run druid, it says ‘can’t find crow device’, and crow doesn’t seem to be responding to incoming triggers. I’ve tried rebooting, different USB cables and still nothing. Am I missing something?

ran into this the other day, do the steps outlined here help?

I haven’t tried forcing the bootloader yet because I was confused about what a jumper was, and it was hard to tell what I needed to do.

gotcha – a jumper is just a bit of plastic-enclosed metal that goes over pins on a board to open, close or bypass circuits:

image

if you don’t have any, you can just use a regular ole (unpatched) patch cable and just place it on the top and middle pin in this orientation:

power on your synth with the cable touching those two pins and after a second or two, you can remove the patch cable. crow will be in bootloader mode.

the reason why a cable works as a jumper is because either is just metal bridging the pins

can i use i2c cables on the center pins or ground pins when booting up? i tried with an unplugged patch cable and i’m still getting the ‘can’t find crow device’ after i power up.

no, different construction.

once you use the patch cable to bridge the ground and center pin (either side of the two columns of pins, doesn’t matter), you used terminal to successfully connect to crow and were able to successfully execute ./erase_userscript.sh? or did those steps fail? in other words, druid will still report ‘can’t find crow device’ until you perform those steps. just looking to figure out where things are going wonky :slight_smile:

No problem----after I did the grounding with a patch cable, I typed ‘druid’ into the terminal and still got the ‘can’t find crow device’ message.

SCOTTs-MBP:~ scottburton$ druid

can’t find crow device

SCOTTs-MBP:~ scottburton$ ./erase_userscript.sh

-bash: ./erase_userscript.sh: No such file or directory

SCOTTs-MBP:~ scottburton$ ^^c

-bash: :s^^c: no previous substitution

SCOTTs-MBP:~ scottburton$

This is what it’s giving me unfortunately.

gotcha, thanks for that!

the trouble is that you cannot perform this task through druid:

  1. please open a fresh terminal session (quit terminal if it’s open and start it again)
  2. use cd to change directory to the downloaded firmware folder
  3. then you can enter ./erase_userscript.sh

you should not be executing druid at all. do those steps work?


Having trouble using the cd command?

  • Mac: right click the unzipped crow-vx.x.x folder and then press the OPTION key. This will reveal a Copy “crow-vx.x.x” as Pathname action. Select it and then paste into terminal after cd [spacebar] .
  • Windows: hold the SHIFT key and right click the unzipped crow-vx.x.x folder. This will reveal a Copy as path action. Select it and then paste into terminal after cd [spacebar] .
  • Linux: right click the unzipped crow-vx.x.x folder and select “ Copy ”. Then, simply Paste into terminal after cd [spacebar] .

okay I’ve got that part to work, and now there is this, when i try to execute flash.sh

SCOTTs-MBP:crow-v1.0.0 scottburton$ ./flash.sh

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.

Copyright 2010-2016 Tormod Volden and Stefan Schmidt

This program is Free Software and has ABSOLUTELY NO WARRANTY

Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature

dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

Deducing device DFU version from functional descriptor length

dfu-util: No DFU capable USB device available

SCOTTs-MBP:crow-v1.0.0 scottburton$

thanks so much for walking me through this!

happy to help!

apologies, but you are executing commands that are not part of the instructions :joy:. this is a super helpful data point to have, but it’s also causing some false negatives

the only things you should be typing into a fresh terminal session to clear a persistent ‘can’t find crow device’ status are:

  • cd [wherever your downloaded crow firmware folder is]
  • ./erase_userscript.sh

this just means that the bootloader isn’t running (or crow isn’t connected via USB)-- can you try forcing it again by power cycling your synth and placing the cable on those aforementioned pins?

I tried it and got the same message:

dfu-util: No DFU capable USB device available