Skip to content

Instantly share code, notes, and snippets.

@samaaron
Created April 29, 2015 13:54
Show Gist options
  • Save samaaron/1fc210841b466dd174cf to your computer and use it in GitHub Desktop.
Save samaaron/1fc210841b466dd174cf to your computer and use it in GitHub Desktop.
#Thanks to Daniel Wagner for the original Overtone translation of the main melody from
# Daft Punk's Giorgio By Moroder
repetition_sub_a = [:C5, :A3, :B4, :A3, :C5, :E5, :A3, :A4, :C5, :A3, :B4, :A3, :C5, :A4]
repetition_a = [:a4, :a3] + repetition_sub_a + [:a3, :a4] + repetition_sub_a
repetition_b = [:F4, :F4, :A4, :F4, :G4, :F4, :A4, :C5, :F4, :F4, :A4, :F4, :G4, :F4, :A4, :F4]
#slight variation of the above with different distances between the 2nd and 3rd note
repetition_b3 = [:E4, :E4, :G4, :E4, :Fs3, :E4, :G4, :B4, :E4, :E4, :G4, :E4, :Fs3, :E4, :G4, :E4]
define :transpose do |updown, notes|
notes.map{|el| note(el) + updown}
end
define :drop_last do |arr|
arr[0..-2]
end
theme = repetition_a +
(transpose -5, repetition_a) +
repetition_a +
(transpose -5, repetition_a) +
repetition_b +
(transpose 2, repetition_b) +
(transpose -2, repetition_b3) +
repetition_b3 +
repetition_b +
(transpose 2, repetition_b) +
repetition_b3 +
repetition_b3
score = drop_last(theme) + [:A4] + theme + drop_last(theme) + [:A4] + drop_last(theme) + [:A4]
score = score.map{|el| note(el)}
define :giorgio do |idx = 0|
idx = idx * 16
score[idx, 16].ring
end
#puts giorgio(3).size
live_loop :foo do
idx = 1
use_synth :dsaw
notes = giorgio(idx)
with_fx :slicer do
with_fx :slicer, phase: 0.5, wave: 0, invert_wave: 0 do
with_fx :flanger do
synth :square, note: notes.first - 36, release: 4, cutoff: 70, amp: 5
end
end
end
use_random_seed 24
with_fx :bitcrusher, phase: 0.125, mix: 0.4, sample_rate: 2000 do
use_synth :square
notes.each do |n|
play n, release: 0.1, cutoff: rrand(60, 120) , amp: 2
sleep 0.125
end
end
end
live_loop :bar do
# sync :foo
# sample arovane_beat(24), rate: 60.0 / 62.5, amp: 3
sleep 16
end
live_loop :machine do
# sync :foo
sample :bd_haus, amp: 5
sleep 0.5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment