Monday, February 8, 2016

Tinkering with Sonic Pi tutorial on Raspberry Pi

Sonic Pi comes bundled with Raspbian (I'm currently running Wheezy); you can find it in the Raspbian menu under Programming.



Sonic Pi offers basic tutorials in its help section on entering specific commands to generate synthesizers and manipulate sound samples (both included within the program). I tinkered with various commands such as sleep (pauses), amp (to control volume of individual sounds), sustain, release, panning, and loops with randomizing functions that will repeat the until the stop button is clicked. One very nice feature of this program is the log window to see the script running in real time. Sonic Pi utilizes a version of Ruby programming language. I think I'll definitely start to tinker a bit more in upcoming days.




Here's the saved project's code:
use_synth :prophet
play 70, pan: 1
sleep 0.5
sleep 1
play 75, pan: -1
sleep 0.5
use_synth :saw
play 49
play :f4,release: 5, pan: 1
sleep 0.4
play 61, amp: 1.9
use_synth :tb303
play 70, pan: 1
sleep 0.5
sleep 1
use_synth :zawa
play 75, attack: 2, pan: -1
sleep 0.5
sample :drum_cymbal_open, attack: 0.01, sustain: 10.3, release: 10.1
use_synth :saw
play sample :ambi_glass_rub, sustain: 12, rate: 0.5
play 49, sustain: 3, release: 5
play :f4, amp: 0.8, pan: 1
sleep 0.4
use_synth :sine
loop do
  sample :perc_bell, rate: (rrand 0.925, 0.2)
  sleep rrand(0.2, 2)
end


No comments:

Post a Comment