Skip to content

Instantly share code, notes, and snippets.

@xavriley
Created March 14, 2015 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavriley/81c9b00995be6cdf2ea2 to your computer and use it in GitHub Desktop.
Save xavriley/81c9b00995be6cdf2ea2 to your computer and use it in GitHub Desktop.
Bath Ruby piece
live_loop :dr do |c|
with_fx :reverb do
synth :zawa, note: (knit :c2, 32, :a1, 8)[c], release: 3, phase: 0.25, wave: 1, phase_offset: 0.5 if factor?(c, 16)
end
with_fx :echo, mix: 0.3 do
synth :pulse, pan: Math.sin(vt), note: (scale :a3, :minor_pentatonic).choose, release: 0.1 if spread(7,16)[c]
end
sample :bd_haus if spread(5,8)[c]
sleep 0.25
c += 1
end
uncomment do
# This code just plays some samples
speech_samples = "/Users/xavierriley/Dropbox/public/sounds/"
# sounds are downloadable from Dropbox
# ben.wav = https://dl.dropboxusercontent.com/u/11192828/sounds/ben.wav
# ko_bug.wav = https://dl.dropboxusercontent.com/u/11192828/sounds/ko_bug.wav
# nsa_question.wav = https://dl.dropboxusercontent.com/u/11192828/sounds/nsa_question.wav
# saron2.wav = https://dl.dropboxusercontent.com/u/11192828/sounds/saron2.wav
# named threads only get eval'd once
in_thread(name: :foo2) do
with_fx :echo, mix: 0.2, pre_amp: 3 do
sleep 16
sample "#{speech_samples}nsa_question.wav", amp: 2, attack: 3
sleep sample_duration "#{speech_samples}nsa_question.wav", amp: 2, attack: 3
end
with_fx :pitch_shift, pitch: 5, pitch_dis: 0.01 do
sleep 16
sample "#{speech_samples}ko_bug.wav", rate: pitch_ratio(-5), amp: 2, attack: 0.1
sleep sample_duration("#{speech_samples}ko_bug.wav")
end
with_fx :pitch_shift, pitch: 5, pitch_dis: 0.01 do
sleep 32
sample "#{speech_samples}ben.wav", rate: pitch_ratio(-5), amp: 5, attack: 0.1
sleep sample_duration("#{speech_samples}ben.wav")
end
with_fx :pitch_shift, pitch: 5, pitch_dis: 0.01 do
sleep 48
sample "#{speech_samples}saron2.wav", rate: pitch_ratio(-5), amp: 5, attack: 0.1
sleep sample_duration("#{speech_samples}saron2.wav")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment