https://sonic-pi.net/
https://twitter.com/sonic_pi
https://twitter.com/samaaron
https://www.patreon.com/samaaron
https://sonic-pi.net/ . For Windows, Mac, Raspberry Pi
https://github.com/samaaron/sonic-pi/blob/master/INSTALL-LINUX.md For Linux distros (build from source)
https://in-thread.sonic-pi.net/ (official help forum)
https://www.reddit.com/r/SonicPi/
https://www.raspberrypi.org/magpi/issues/essentials-sonic-pi-v1/
https://sonic-pi.net/tutorial
http://sonic-pi.mehackit.org/exercises/en/10-cheatsheet/01-cheatsheet.html
https://rbnrpi.wordpress.com and YoutTube channel https://www.youtube.com/channel/UCtUhMj_RnVKy5Jiyr-fWZwg
https://www.youtube.com/watch?v=xpaO8HTrQ1M - YOW! Perth talk
https://codeclubau.org/projects - Sonic Pi lesson packs, a great way for anyone to get started!
https://gist.github.com/xavriley/87ef7548039d1ee301bb - Mario NES
https://www.earthtoabigail.com/blog/audio-representation-bubble-sort-with-ruby-sonicpi
https://gist.github.com/danreedy/a0f0aa1ec2eb275c55a2 - Let It Go
https://in-thread.sonic-pi.net/t/sonic-pi-architecture/329/3
https://github.com/samaaron/sonic-pi/wiki/Sonic-Pi-Internals
ADSR envelope
https://blog.landr.com/wp-content/uploads/2016/10/ASDR-01.jpg
https://www.youtube.com/watch?v=4HIS9Tqukr8#t=16s
play 50
Plays midi note 50 - higher number -> higher pitch, lower number -> lower pitch
play 55.2341234
You can use decimals...
play 50 + Math::PI
... and do maths too
and even use musical notation!
play :c2
Plays C in the second octave
play :bb
Plays B flat in the 4th octave (default)
play :fs6
Plays F sharp in the 6th octave (in music, a hash is used for sharp but that's the ruby comment symbol)
This will play two notes at the same time
play 60
play 61
This will play the two notes sequentially with a gap of one beat (NOT seconds)
play 60
sleep 1
play 61
play chord(55, :major)
or
play_chord([60,62,67])
You can play each note individually too!
loop do
play chord(:d, :major).tick
sleep 0.5
end
See Four_Chord_Song.rb
play_pattern_timed <array of notes>, <array of beat numbers>
e.g.
play_pattern_timed [70, 65, 72, 61, 54], [1, 0.5]
or taking a shortcut and randomising notes from a scale
play_pattern_timed scale(:d, :egyptian).shuffle, [1, 0.5]
With ADSR envelopes
Plays note 65 held for 4 beats
play 65, sustain: 4
Plays note 65 with a short fade out for a short cut-off effect or staccato
play 65, release: 0.5
You can combine args and make the sustain longer than the sleep for a slurred or legato effect
play 65, sustain: 1.1, release: 0.5
sleep 1
play 68
https://sonicpisamples.100yen.co.uk/ - website with Sonic Pi samples
sample :perc_till
changing the speed
sample :loop_amen, rate: 2
or
sample <path_to_file_on_your_laptop_as_a_string>
See Addams_Family_Intro.rb
Game Of Thrones theme synth tester
use_bpm 120
synth_names.each do |s|
use_synth s
puts "using synth #{s}"
play_pattern_timed [:g, :c, :eb, :f, :g, :c, :eb, :f, :d ],[1, 1, 0.5, 0.5, 1, 1, 0.5, 0.5, 2]
sleep 1
play_pattern_timed [:d, :bb3, :eb, :d, :f, :bb3, :eb, :d, :c],[2, 2, 0.5, 0.5, 1.5, 2, 0.5, 0.5, 2]
end
in_thread
and live_loop
allow you to execute blocks of code concurrently.
in_thread
will execute the block once whereas live_loop
will create an infinite loop.
Both will take a delay: n param which will delay execution by n beats(see Frere_Jaques.rb)
converting from time(seconds) to beats seconds/60\*bpm
using https://play.google.com/store/apps/details?id=com.ffsmultimedia.osccontroller
live_loop :slider_tune do
use_real_time
note = sync "/osc/test/slider1" #change this to match your OSC interface
puts "playing note #{note[0]} "
play (note[0])
end