Csound on the organelle

Hi!

I recently bought myself a Critter & Guitari Organelle M, which in fact is a Raspberry Pi Compute Module 3+ hosted on a custom board that connects to power, audio, keys, screen etc.

I naturally immediately started investigating how to get it to run csound, and after some pointers from Owen Osborn, one of the Critter & Guitari founders who uses the handle oweno at the Critter & Guitari forum, I have a proof of concept running.

For csound to start you need to create a folder in the Patches folder on the sd-card, where you put a (bash) script called run.sh. I named my folder Csound, which causes a new patch of the same name to show up in the organelle menu.

That script is automatically executed when you start the patch from the organelle menu.

I ran into some trouble in the beginning where I couldn’t get csound to shut down when choosing another patch on the organelle, but now it seems to work, although there may be better ways to design the script for the same functionality - I’m no expert…

In addition to the run.sh script you of course need a csd file for csound, and I have made a simple proof of concept one that outputs sound, reacts to key presses and knob turns and outputs to the screen (and led) using Open Sound Control.

This is a very simple example where everything is included in one csound instrument, but ideally one would perhaps handle all the OSC-stuff in an always-on instrument, and then trigger separate instruments for each key press and perhaps utilize the shift/aux key to e.g. flip though parameter pages or choose include files to build up your orchestra or whatever - the possibilities are of course endless…

My /sdcard/Patches/Csound/run.sh script contains the following:

#!/bin/bash -e

cleanup() {
  kill $(pidof csound)
}

trap cleanup TERM HUP INT

/usr/bin/csound organelle.csd > /dev/null 2>&1 &

wait $(pidof csound)

My /sdcard/Patches/Csound/organelle.csd contains the following:

<CsoundSynthesizer>
<CsOptions>
-odac           -iadc     -d
</CsOptions>
<CsInstruments>

sr      =  44100
ksmps   =  128
nchnls  =  2
0dbfs   =  1



; Organelle OSC -> Csound inbound messages port 4000
;
;    /key ii
; keys send two values - the key number (0-24) and the key value (0 or 100)

;    /knobs iiiiii
; knobs have vaules between 0 and 1023
;
;
; Csound -> Organelle OSC outbound messages port 4001
;
;    /led i
; the led accepts values between 0 and 7:
; 0=off
; 1=red
; 2=yellow
; 3=green
; 4=cyan
; 5=blue
; 6=magenta
; 7=white
;
; Lines of text and values can be sent to the oled screen:
;    /oled/line/1
;    /oled/line/2
;    /oled/line/3
;    /oled/line/4
;    /oled/line/5
;
; There is also the /oled/vumeter OSC address, as well as /oled/gSetPixel and other versatile functions to explore
; which can be found in the graphics demo patch at https://patchstorage.com/graphics-demo/
; From that demo patch we can identify an address for clearing the screen: /oled/gClear
; the inputs of which seems a bit unclear but two integers 3 and 1 seems to do the trick (copied from the demo patch).

gilisten OSCinit 4000   ;keys and knobs send OSC data on port 4000
                        ;the display and led receives OSC data on port 4001

turnon 1

        instr 1
        gkkey1 init 1
        gkkey2 init 1
        gkkn1 init 1
        gkkn2 init 1
        gkkn3 init 1
        gkkn4 init 1
        gkkn5 init 1
        gkkn6 init 1

kmsg    OSClisten gilisten, "/key", "ii", gkkey1, gkkey2
kmsg2   OSClisten gilisten, "/knobs", "iiiiii", gkkn1, gkkn2, gkkn3, gkkn4, gkkn5, gkkn6

        OSCsend     kmsg+kmsg2, "127.0.0.1", 4001, "/oled/gClear", "ii", 3, 1
        OSCsend     kmsg+kmsg2, "127.0.0.1", 4001, "/oled/line/1", "sisi", "KEY", gkkey1, "VOLUME", gkkn5
        OSCsend     kmsg, "127.0.0.1", 4001, "/led", "i", 7*gkkey2/100

gic     = 440/2^(9/12)

kcps    = gic*2^(gkkey1/12)             ;the first key value is the key numeber
                                        ;from 1 (low c) to 24 (high b)

kamp    = 0.01*gkkn5/1024*gkkey2/100    ;knob5 is the volume knob
                                        ;the second key value toggles
                                        ;between 0 and 100, lika a simple
                                        ;velocity level


a1      vco2 kamp, kcps
        out a1, a1

       endin

</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>

Very cool. I was considering picking up an organelle but I personally am not too partial to development in puredata, but this very much intrigues me and has me more interested haha

1 Like