Skip to content

Instantly share code, notes, and snippets.

View nicoder's full-sized avatar

Nicolas Dermine nicoder

View GitHub Profile
@nicoder
nicoder / 20150312_sonic_pi.rb
Created March 13, 2015 03:48
20150312 sonic pi
# wlazł kotek na płotek
use_bpm 120
live_loop :mel do
play_pattern [67, 64, 64, 65, 62, 62]
play_pattern_timed [60, 64, 67], [0.75, 0.25, 2]
play_pattern [67, 64, 64, 65, 62, 62]
@nicoder
nicoder / 20150313_sonic_pi.rb
Created March 13, 2015 14:00
20150313_sonic_pi.rb
live_loop :l do
use_synth :sine
with_fx :wobble, phase_offset: 0.66, wave: 1 do
play 60
with_fx :echo, phase: 0.125, decay: 0.5 do
play 67, attack: 0.2
play 60, attack: 0.2
end
@nicoder
nicoder / 20150314_sonic_pi.rb
Created March 14, 2015 07:54
20150314 sonic pi
define :mel do
play_pattern_timed [64, 59, 66, 59, 64, 59], [0.5]
play_pattern_timed [68, 64, 59], [0.25, 0.25, 0.5]
end
c = [:e, :b, :a, :a]
c2 = [:e, :b, :cs, :a]
@nicoder
nicoder / 20150319_sonic_pi.rb
Created March 19, 2015 03:35
20150319 sonic pi
use_bpm 90
live_loop :m1 do
sleep 1
end
live_loop :m do
sync :m1
use_synth :fm
@nicoder
nicoder / 20150320_sonic_pi.rb
Created March 20, 2015 03:44
20150320 sonic pi
# random == jazz?
define :random_notes do |synth|
in_thread do
use_synth synth
loop do
[1, 2, 3].choose.times do
play rrand_i(36, 72), pan: rrand(-1, 1), release: rrand(0.1, 0.7)
end
# derived from the example in 09.4 Ticking
live_loop :arp do
play (scale :e3, :minor_pentatonic).tick(:foo), release: 0.1 unless one_in 12
play (scale :e4, :minor_pentatonic).tick(:foo), release: 0.1 if one_in 7
sleep (ring 0.125, 0.25).tick(:bar)
end
with_fx :echo, phase: 1, phase_slide: 2 do |e|
loop do
use_synth :dsaw
play 50, release: 5
control e, phase: 0.025
sleep rrand(1, 5)
end
end
live_loop :foo do
use_synth :fm
play choose(chord(:e2, :minor)), release: rrand(0.01, 0.12), cutoff: rrand(60, 120)
sleep 0.125
end
@nicoder
nicoder / lightly_row.rb
Created November 22, 2015 11:08
Lightly Row
use_bpm 180
play_pattern_timed [:e4, :cs4, :cs4], [1, 1, 2]
play_pattern_timed [:d4, :b3, :b3], [1, 1, 2]
play_pattern_timed [:a3, :b3, :cs4, :d4], [1]
play_pattern_timed [:e4, :e4, :e4], [1, 1, 2]
define :second do
play_pattern_timed [:e4, :cs4, :cs4, :cs4], [1, 1, 1, 1]
play_pattern_timed [:d4, :b3, :b3, :b3], [1, 1, 1, 1]
use_bpm 240
define :descent do
play_pattern_timed [:e5, :d5, :d5, :d5], 1
play_pattern_timed [:d5, :cs5, :cs5, :cs5], 1
play_pattern_timed [:cs5, :b4, :b4, :b4], 1
end
define :long_note do |note|
play note, release: 2