^^ crow 1.0.0

crow 1.0.0

It’s been a few nights and a few flights, and crow has some tweaks & additions to make things smoother and more expressive. Script uploading is far more robust. There’s a nice crow.reset() function to get a blank slate, and a new awareness of time() passing.

To update crow, follow the instructions on the update page.

To update druid, you can now simply type pip3 install monome-druid into terminal and run it from your scripts folder (or anywhere else!) by typing druid. Shouts to @simonvanderveldt & @csboling for the heavy lifting!

The Max & M4L collection is updated with some great additions from @voidstar.

We’ve also begun a collection of druid scripts called bowery which will host user contributions. You can get the latest here.

The Scripting tutorial has been updated to reflect these changes.

crow 1.0.0

  • NEW time() function returns milliseconds since boot
  • NEW crow.reset() function resets inputs, sets outputs to zero, and frees all metros
  • FIX lfo doesn’t crash if time = 0
  • FIX ^^c clears the user script (previously ran First.lua)
  • NEW ^^F runs First.lua
  • NEW (BREAKING / druid)^^s <script> ^^e now executes up to 8kB of Lua
  • NEW (BREAKING / druid)^^s <script> ^^w now flashes up to 8kB of Lua (runs on reboot of crow)

druid

  • Now a real python package available with pip3 @simonvanderveldt
  • More robust script execute & upload @csboling
  • Typing long lines of Lua at the command line works correctly now @csboling

crow max & m4l

  • Three new devices from @voidstar
    • derwydd let’s you type chunks of Lua at crow from within Live
    • bridges uses Live’s parameter mapping as an interface for crow scripts
    • macros saves a handful of Lua chunks that can be triggered with keys or MIDI
57 Likes

Not sure where to put this, but I just installed Python and I got this message:

You are using pip version 19.0.3, however version 19.2.3 is available.

You should consider upgrading via the ‘pip install --upgrade pip’ command

How do I do this? I tried entering that into Terminal but no go…

This is the downside of being a new at coding…

I’m guessing you’re setting up Python to run Druid, so maybe ^^ crow help: druid?

I believe you’re on an Apple PC, was this installed with Homebrew? i.e. brew install python?

I’m using pip 19.0.3 for Druid development successfully, so this is just a suggestion really, you don’t need to update to get Druid working if you don’t want to. Good to stay up to date though! A couple likely culprits:

  • On OSX and many Linux distros, the command to use with Python 3 versions of pip is pip3. However pip doesn’t know that it’s called something else on your system, so when it tells you to run that command it just says pip install ..., when what you really want is pip3 install ... to work with the version that was installed alongside Python 3. To be extra confusing, the value you’re passing to --upgrade still needs to be the name of the package to update (pip).
  • If the error message tells you something about permissions, this might be because it needs higher privileges to modify pip. In this case you would need to prefix the command with sudo to tell your computer it’s okay to let this program modify something.

So to sum up, the command I would suggest trying next is:

sudo pip3 install --upgrade pip

When you run something with sudo, you’ll often be given a password prompt after you press Enter. This is usually just the same password you use to unlock your computer. Note that when typing passwords into a terminal it’s typical that they show nothing for characters you typed already, no * or bullet or anything, and often the backspace key doesn’t work! Not sure if this how it works in an OSX terminal, but you may have to type carefully. Also just good to be extra careful when using sudo in general to make sure you’re entering the exact command you want! This set of hoops to jump through is basically there to make sure you’re being very deliberate when installing new software and such.

4 Likes

This works, I did it the other day.

1 Like

I used terminal to do the install directly, not brew

I figured out that I needed to do pip3 instead of pip, and got it updated ok

what program should I be in when doing the ^^ crow help: druid? Is that a terminal command or a python one? Do I actually interact with a python command line or is python just something that needs to be installed to run in the background?

Does the double uparrow (?) mean it’s a Crow thing? What is that called, the “^^” symbol?

Sorry for the newb questions, I am actually learning here!!! :slight_smile:

1 Like

druid is a program written in Python (which is why you need Python installed). You don’t type any Python code into druid. The input to druid falls (currently) into three basic groups:

  • commands processed by druid itself. You can ask druid to list all of these by typing h, for example:
    > h
    
     h            this menu
     r            runs 'sketch.lua'
     u            uploads 'sketch.lua'
     r <filename> run <filename>
     u <filename> upload <filename>
     p            print current userscript
     q            quit
    
  • Lua commands to be sent to crow, for crow to evaluate and send back results. The outgoing Lua text will be echoed into the top, larger region of the screen, followed by crow’s output. So if you type print('caw') followed by Enter into druid, you should expect to see:
    > print('caw!')
    caw!
    
    in the large upper region of the screen. This lets you review the last few commands and their output. You can also flip through older commands with the up arrow key.
  • special commands sent to crow. These start with ^^. Sometimes crow sends back special messages that are also prefixed with ^^, and these will be shown in your terminal as well, with the exception of stream and change messages (these are used to show input voltage readings on the top line of druid). For example:
    > ^^version
    ^^version('v1.0.0')
    

druid is written in Python 3, so it needs Python 3 installed to work. It is possible to turn Python programs into standalone executable files that don’t rely on a computer having Python installed, which could make for an easier setup experience on certain platforms where getting Python to cooperate has a lot of pitfalls. You don’t need to write any Python to work with crow - all crow scripting is done in Lua.

For pronunciation guidance, please draw this symbol on a large piece of paper and show it to some corvids in your vicinity.

7 Likes

Thanks! Very helpful.

I’d humbly suggest some of this level of explanation be added to the master docs, for those of us without relevant coding/language background…

Already some great progress being made in the documentation sphere… I’m still pondering the INDEX concept I floated a few days ago…

I wonder if there are any professional or trained reference librarians in here? Hmmm…

2 Likes

What if we just provided downloadable binaries for druid, then noone would have to even think about python?

13 Likes

I feel like I’m being punished for a thousand lifetimes of sins. Okay, I’m so close it hurts. I managed to get python doing python thing, got druid to dru, and forced flash.sh to be opened by terminal instead of textedit. But now I’m getting this…
dfu-util: Could not open file crow.bin for reading: No such file or directory

logout

Saving session…

…copying shared history…

…saving history…truncating history files…

…completed.

[Process completed]

crow update is in my downloads folder on Mac. I’m so close. What am I missing?

1 Like

Make sure you change the location your terminal is running in to the same folder flash.sh is in. Use the command “cd” plus the path to the folder.


Thank you! Is this what you mean? I entered the highlighted text but still I’m failing.Forgive my ignorance.
I’m entering this
Users/michaelmatos/Downloads/crow-v1.0.0/flash.sh
for the file which is in my downloads.

Enter it like this; “Users/michaelmatos/Downloads/crow-v1.0.0/”. You want the terminal to be running in that folder. What’s happening is it’s going to look for the file crow.bin, but it can’t find it unless it is running in the same folder.

Thank you! I had to go to system preferences and enable Shortcuts tab at the top and then select Services on the left.

Under Files and Folders on the right, I checked the New Terminal at Folder and New Terminal Tab at Folder boxes.
Then I could right click the crow folder, open terminal in the folder, and then enter the cd command.

2 Likes

Sorry to be dense but could someone please provide some info on how and why to do all this terminal opening in folders stuff as if explaining it to a smart but inexperienced 13 year old?

Also is it wise to create a specific folder in which to put all scripts, does it need a specific name or location, what would someone who knows this stuff do because they already know it and therefore not think to mention it?

Finally can that level of helpful info get incorporated into the documentation?

Thanks!

(Note: I’m assuming you’re on a Mac, but most of this will be useful regardless of platform.)

Here’s an article that walks you through the basics of how to get around the file system in the Terminal:

Here’s a couple examples to illustrate what’s going on when you type commands.

When you type a command, the system needs to know where the file that you are trying to execute is. For example, you might type:

druid

You probably noticed that will work wherever you are when you type the command. That’s because when druid was installed, it was put in a special place the system looks at when you type a command. That is, not finding druid in the current directory (i.e. the directory you are in when you type the command), the system goes looking in the usual places. So the system still needs the complete path, but it has a clue about how to figure it out itself without you typing it explicitly (or being in the directory with the druid executable file).

However, in the case of the flash.sh, it wasn’t installed in the same way druid was, it’s just a random file sitting on your computer. So in this case you need to provide the path to the file. The easiest way is to navigate to that folder and execute the command there. So, once there, you’d think you could just type this:

flash.sh

But, no luck. You actually need to type:

./flash.sh

The “./“ is a shortcut that means “the current directory.”

It may not be obvious (i.e. it is totally not obvious) how to figure out the path of a file on your system. Luckily, there’s a handy shortcut to help you navigate the file system. Type:

cd

(Important note: there needs to be a space after the “cd”)

Then, drag the folder from the Finder and drop it anywhere onto the Terminal window. The path will then magically appear after the cd. Hit ‘return’ and you’ll be transported to the directory.

That’s a personal preference, but putting all your scripts in one place is probably a sensible choice. In that case you can make a Crow folder (wherever you want), drop the examples folder into that folder and make a “MyCoolScripts” folder there as well. Then navigate to that folder (as described above) and launch druid from there. That way, once in the druid app, you can upload scripts from either collection easily:

u examples/boids.lua

or

u MyCoolScripts/worldchangingalgorithm.lua

Note that, unlike when executing commands in the Terminal, you don’t need the leading ./ when you provide the path to the script.

5 Likes

Thanks, that’s very helpful!

1 Like

You should just be able to double-click flash.sh in finder. None of the terminal business required. I’ll confirm / update the docs on monday.

You shouldn’t need to ‘know terminal’ just to upload a new firmware.

4 Likes

I’m not sure that’s setup by default. I’m not positive, but I don’t think the default on the Mac is to open .sh files with terminal, you’d have to set that up yourself (with get info/command-i on a .sh file, change “Open with” and “Change All…”).

Update: That theory appears to be confirmed in this SO post:

I added this bit to a few docs (Scripting and Update):

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] .

my mac automatically opens flash.sh in Sublime :confused:

2 Likes

Thanks again, and yes, on a Mac…