‹ RPi Audio Codec udssrKontroll ›

Solar Powered SuperCollider

2017-08-01 17:07 supercollider

Here's how to run SuperCollider on power coming from the sun...

The main component is a Raspberry Pi Zero with WiFi that at startup creates a wireless access point, starts jackd+SuperCollider and launches a default sound patch.

To play around with the system and change the default sound log on to the access point with a laptop and start live coding SuperCollider via the terminal or use the standard SC-IDE via VNC. One can for example also set up a couple of OSC responders and let friends log on with their phones to control sounds.

Front of solar powered SuperCollider
Front of solar powered SuperCollider
Front of solar powered SuperCollider
Back of solar powered SuperCollider
Back of solar powered SuperCollider
Back of solar powered SuperCollider

The connections are pretty straightforward...

solarpanel -> dcdc converter -> battery -> rpi0 -> soundcard -> amplifier -> speaker(s)

The DC-DC converter is taking the higher voltage coming out of the solar panel (~6V) and turns it into a stable 5V. This is then either charging the battery, or directly powering the Raspberry Pi Zero. Note that the amplifier also needs 5V and here I have taken that from pins 4 and 6 on the RPi.

The power bank battery is optional and can be omitted but then the solar panel will have to stay in the sun at all times - else the system will turn off or reboot when the power from the panel drops. The battery acts as a reservoir for when clouds are passing by but not only that - it also lets the system be used for a couple of hours in the evening.

Material/modules needed:

Download Raspbian Jessie (here Jessie Desktop 2017-07-05-raspbian-jessie.zip) and burn it onto the SD card with balenaEtcher.

Do the usual setup (change default password, activate SSH), optionally activate VNC and then install supercolliderStandaloneRPI1.

To set up a WiFi access point do the following (basically the same as this tutorial)...

sudo apt-get install dnsmasq hostapd
sudo systemctl stop dnsmasq
sudo systemctl stop hostapd
sudo nano /etc/dhcpcd.conf  #and add...
  denyinterfaces wlan0
sudo nano /etc/network/interfaces  #and make sure wlan0 looks like...
  allow-hotplug wlan0
  iface wlan0 inet static
sudo service dhcpcd restart
sudo ifdown wlan0
sudo ifup wlan0
sudo nano /etc/dnsmasq.conf  #and add the following...
sudo nano /etc/hostapd/hostapd.conf  #and add the following...
sudo nano /etc/default/hostapd  #and change to the following...
sudo service hostapd start
sudo service dnsmasq start

Last change the file mycode.scd and add this default sound (tweet0340)...

  play{a=SinOscFB;Mix(AllpassN ar:a.ar(midicps(Duty.ar(c=a.ar(1/[12,8])+3/24,0,Dseq([0,8,5,1,5,4,5]*round(c*18),inf))+60),c*2)/4)}// #SuperCollider

If the sound is distorting try lowering the volume in alsamixer.

‹ RPi Audio Codec udssrKontroll ›