From 76bcb48b0b91aba34677985fc035bbe6b58b4951 Mon Sep 17 00:00:00 2001 From: Richard Sewell Date: Sat, 8 Aug 2015 08:32:03 +0000 Subject: [PATCH] Fixing file locations --- README.md | 27 +++++++++++++++++++ acid2.rb | 76 ------------------------------------------------------ startup.sh | 9 ++++++- 3 files changed, 35 insertions(+), 77 deletions(-) delete mode 100755 acid2.rb diff --git a/README.md b/README.md index 2af173f..d4dc24b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,29 @@ # world-o-techno Location-based techno with Sonic Pi and gpsd + +Getting started: + +Check this out into /home/pi + +Install gpsd (thanks to http://blog.retep.org/2012/06/18/getting-gps-to-work-on-a-raspberry-pi/) with +pi@raspberrypi:~$ sudo apt-get install gpsd gpsd-clients python-gps +and start it with +pi@raspberrypi:~$ sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock + +Check it works with +pi@raspberrypi:~$ cgps -s + +Install sonic-pi-cli to give Sonic Pi a command line (via https://github.com/Widdershin/sonic-pi-cli) + +pi@raspberrypi:~$ gem install sonic-pi-cli + +Make your pi start Sonic Pi and play our tune on boot (thanks to +https://rbnrpi.wordpress.com/autoboot-for-telegram-and-sonic-pi-jukebox/) + +pi@raspberrypi:~$ sudo vi /etc/xdg/lxsession/LXDE-pi/autostart + +and add these lines at the end: + +@sonic-pi +lxterminal --command "/home/pi/world-o-techno/startup.sh" + diff --git a/acid2.rb b/acid2.rb deleted file mode 100755 index d98c5cb..0000000 --- a/acid2.rb +++ /dev/null @@ -1,76 +0,0 @@ -# Welcome to Sonic Pi v2.6 -# Acid -# Coded by Sam Aaron -# Hacked around by RJS & JHR - -require '/home/pi/gps/gps.rb' - -gps = Gps::Receiver.create('gpsd',:host => 'localhost', :port => 2947) - -gps.start - -sleep 2 - -puts gps.latitude - - - -use_debug false -load_sample :bd_fat - -8.times do - sample :bd_fat, amp: (line 0, 5, steps: 8).tick - sleep 0.5 -end - -live_loop :drums do - sample :bd_fat, amp: 5 - sleep 0.5 -end - -live_loop :acid do - cue :foo - 4.times do |i| - long = (gps.longitude.abs * 10**9) % 100 - use_random_seed long - 16.times do - use_synth :tb303 - play chord(:e5, :minor).choose, attack: 0, release: 0.1, cutoff: rrand_i(50, 90) + i * 10 - sleep 0.125 - end - end - - cue :bar - use_synth :tb303 - 32.times do |i| - gspeed = gps.speed.modulo(1) - puts gspeed - play chord(:b4, :minor).choose, attack: 0, release: 0.05, cutoff: rrand_i(70, 98) + i, res: gspeed - sleep 0.125 - end - - cue :baz - with_fx :reverb, mix: 0.3 do |r| - 32.times do |m| - control r, mix: 0.3 + (0.5 * (m.to_f / 32.0)) unless m == 0 if m % 8 == 0 - use_synth :prophet - play chord(:e6, :minor).choose, attack: 0, release: 0.08, cutoff: rrand_i(110, 130) - sleep 0.125 - end - end - - cue :quux - in_thread do - use_random_seed 668 - slat = (gps.latitude.abs * 10**7).modulo(1) - with_fx :slicer, mix: 0.75, wave: 3, phase: slat do - 16.times do - use_synth :tb303 - play chord(:d3, :major).choose, attack: 0, release: 0.1, cutoff: rrand(50, 100) - sleep 0.25 - end - end - end - - sleep 4 -end diff --git a/startup.sh b/startup.sh index 8c85c77..851ca6c 100755 --- a/startup.sh +++ b/startup.sh @@ -1,6 +1,13 @@ #!/bin/bash -x +# wait for sonic-pi to start sleep 20 + +# set the default audio output to be the headphone jack amixer cset numid=3 1 + +# set audio volume to full amixer sset PCM 100% -cat acid2.rb|sonic_pi + +# play our tune +cat /home/pi/world-o-techno/world-o-techno.rb|sonic_pi