Created
March 25, 2016 02:00
-
-
Save Enkerli/f01b79a9515aafc2617b to your computer and use it in GitHub Desktop.
“Rranding Ring Chains”, coded by Alex Enkerli, March 24, 2016. Playing with ring chains in Sonic Pi, using a previously-built script to play with “licks”. <https://gist.github.com/Enkerli/0687533338c5e40516fc> In several cases, the basic “lick” using degrees 3, 5, 1, and 4 of a given scale makes for intriguing combinations, once shuffled and cut…
This file contains hidden or 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
# “Rranding Ring Chains” | |
# Coded by Alex Enkerli, March 24, 2016 | |
# Playing with ring chains in Sonic Pi, using a previously-built script to play with “licks”. https://gist.github.com/Enkerli/0687533338c5e40516fc | |
# In several cases, the basic “lick” using degrees 3, 5, 1, and 4 of a given scale makes for intriguing combinations, once shuffled and cut apart. | |
def play_lick(lick, root, scale, time) | |
spark lick | |
lick.each{|note| play((degree_to_note note, root, scale)) ; sleep time } | |
end | |
DEGREES = {:i => 0, | |
:ii => 1, | |
:iii => 2, | |
:iv => 3, | |
:v => 4, | |
:vi => 5, | |
:vii => 6, | |
:viii => 7, | |
:ix => 8, | |
:x => 9, | |
:xi => 10, | |
:xii => 11, | |
:r => 999 | |
} | |
def degree_to_note(degree, tonic, scale) | |
local_scale = Scale.new(tonic, scale) | |
if degree.is_a?(Numeric) && degree==0 | |
return 0 | |
elsif idx = DEGREES[degree] | |
index=idx | |
elsif degree.is_a? Numeric | |
index=degree - 1 | |
else | |
raise InvalidDegreeError, "Invalid scale degree #{degree.inspect}, expecting #{DEGREES.keys.join ','} or a number" | |
end | |
local_scale.notes[index] | |
end | |
root=50 | |
use_tuning :just, root+1 | |
lick=(ring 3, :r, 5, 1, :r, 4) | |
scale=([:major, :whole_tone, :minor, :diminished, :lydian, :phrygian]).choose | |
live_loop :licking do | |
use_synth :blade | |
use_synth_defaults release: 0.1 | |
play_lick(lick.stretch(2).shuffle.reflect.drop(4).mirror, root, scale, rrand(0.09, 0.29)) | |
sleep 0.45 | |
end | |
live_loop :beed do | |
sample :bd_haus | |
sleep 1.15 | |
end | |
live_loop :bs do | |
use_synth :fm | |
use_synth_defaults release: 0.3 | |
route=40 | |
play_lick(lick.shuffle.drop(4).mirror, route, scale, 0.6) | |
sleep 1.65 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment