Created
November 25, 2017 20:49
-
-
Save frjurado/4cbfe9cde5db71e84974bbb0f95330d9 to your computer and use it in GitHub Desktop.
My first try at Sonic Pi - a live coding environment for music creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My first try at Sonic Pi - a live coding environment for music creation | |
# More info here: http://sonic-pi.net/ | |
live_loop :bass_drum do | |
sample :bd_haus, amp: 1 | |
sleep 0.25 | |
sample :drum_cymbal_closed, amp: 0.5, sustain: 0.1, release: 0.05 | |
sleep 0.25 | |
end | |
live_loop :bass_drum2 do | |
sample :drum_bass_soft, amp: 0.5 | |
sleep 0.33333333 | |
end | |
live_loop :electric_beat do | |
sleep 0.25 | |
2.times do | |
sample :elec_tick, amp: 0.6 | |
sleep 0.125 | |
end | |
sleep 0.25 | |
sample :elec_tick, amp: 0.8 | |
sleep 0.25 | |
end | |
live_loop :bass do | |
with_fx :reverb, room: 1 do | |
12.times do | |
sample :bass_thick_c, sustain: 0.0, release: 0.6 | |
sleep 1 | |
end | |
4.times do | |
sample :bass_thick_c, sustain: 0.0, release: 0.6, rate: 0.67 | |
sleep 1 | |
end | |
end | |
end | |
live_loop :guitar do | |
3.times do | |
sample :guit_em9, rate: 1, amp: 0.75 | |
sleep 4 | |
end | |
sample :guit_em9, rate: 0.7937, amp: 0.75 | |
sleep 4 | |
end | |
chord01 = [:e4, :b4, :d5] | |
chord02 = [:c4, :eb4, :bb4] | |
define :myChord do |chord, time| | |
play_chord chord, amp: 0.75, release: 0.2 | |
sleep time | |
end | |
define :sequence do |chord| | |
myChord chord, 0.375 | |
myChord chord, 0.375 | |
myChord chord, 0.25 | |
sleep 0.25 | |
myChord chord, 0.25 | |
myChord chord, 0.5 | |
end | |
live_loop :synth do | |
with_fx :reverb, room: 1 do | |
use_synth :fm | |
6.times do | |
sequence chord01 | |
end | |
2.times do | |
sequence chord02 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment