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
# Standard 12 bar blues | |
# I7 | IV7 | I7 | I7 | |
# IV7 | IV7 | I7 | I7 | |
# V7 | IV7 | I7 | I7 | |
# Choose a root note (one) and everything else will fall into place. | |
one = :G2 | |
four = one + 5 | |
five = one + 7 |
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
# Ambient experiment for Sonic Pi (http://sonic-pi.net/) | |
# | |
# The piece consists of three long loops, each of which plays one of | |
# two randomly selected pitches. Each note has different attack, | |
# release and sleep values, so that they move in and out of phase | |
# with each other. This can play for quite awhile without | |
# repeating itself :) | |
live_loop :note1 do | |
use_synth :hollow |
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
# Super simple drum and bass | |
# Coded by Sam Aaron w/ Sonic Pi | |
# To play: download Sonic Pi from the link below, paste the code in and hit Run | |
# http://sonic-pi.net | |
use_bpm 100 | |
live_loop :amen_break do |
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
#samples = Dir.glob("/path/to/samples/*.wav") | |
#samples = [:loop_amen_full, :ambi_choir] | |
#samples = [:ambi_choir] | |
samples = [:guit_harmonics] | |
#starts = (ring 0, 0.25, 0.5, 0.75) | |
#starts = range(0, 0.875, 0.125) | |
starts = range(0, 0.875, 0.0625) | |
#starts = (0..10).collect{rand(1)} |
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
live_loop :drums do | |
with_fx :level, amp:1.0 do | |
sample :bd_ada, attack:0, sustain_level:0, decay: 0.1, start: 0, amp:2, rate:0.5 | |
sleep 0.125 | |
with_fx :reverb, mix:0.2, room:0.5 do | |
sample :perc_snap, attack:0, sustain_level:0, decay: (ring 0.1, 0.1, 0.1, 0.5).tick(:t1), start: 0, amp:1, rate:(ring -2, -3, -4, -5).tick(:t1b) | |
sleep 0.125 | |
with_fx :krush, mix:0.7 do | |
sample :misc_burp, attack:0, sustain_level:0, decay: 0.4, start: 0.5, amp:(ring 0.4, 0.6, 0.8, 0).tick(:t2), rate:0.9 | |
end |
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
#loading...#scaletypecontrolledarpeggios.rb by Robin Newman, July 2015. Requires sp2.6 | |
#A study using arpeggios with different scale formats. Also utilising rings and ticks | |
#This was a great exercise to explore different Sonic Pi (and Ruby) commands | |
#eg tick, look, ring, note_range for SP and string manipulation commands and eval for Ruby to mention some. | |
#First of all in the defined procedures which enable you to extract info about different scale types | |
#and to generate the rings required for the piece to work. | |
#Basically the code generates a pool of notes for three separate chords and then transposes those notes | |
#using notes 0,3,4 and 4 (down an octave) for each of the distinct 8 note scales supported in Sonic Pi |
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
live_loop :thing do | |
sample :drum_bass_hard | |
sleep 0.75 | |
4.times do | |
sample :drum_cymbal_soft, rate: rrand(2,4) | |
sleep 0.125 | |
end | |
end | |
live_loop :snare do |
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
def note_range_demo(low_note, high_note, options={}) | |
low_note = Note.resolve_midi_note(low_note) | |
high_note = Note.resolve_midi_note(high_note) | |
potential_note_range = Range.new(low_note, high_note) | |
if options[:pitches] | |
pitch_classes = options[:pitches].map {|x| Note.resolve_note_name(x) } | |
note_pool = potential_note_range.select {|n| |
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
theNotes = [:a2, :a3, :e3, :a4, :g4, :e4] | |
define :foo do |samp, n| | |
sample samp, | |
rate: pitch_ratio(note(n) - note(:a3)), | |
sustain: 0.05, | |
release: 0.1, | |
amp:3 | |
end |
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
in_thread do | |
loop do | |
sample :drum_bass_hard, amp: 2 | |
sleep 2 | |
end | |
end | |
in_thread do | |
loop do | |
sleep 1 |