Here you go. There are lots of things you could do. This is just one set of ideas I used.
#Seagulls by Hitsware and BaybyJLD combined and tweaked by RBN
#there are many possibilites for this. This is just one.
#added some comments where changes made. Bayby is delayed before starting.
#also added fadeout end (set to start at 140 seconds)
set :kill,false
use_bpm 60
endsequence=140 #time to start finishing off (can adjust)
############## Calling the Seagulls ################
w=[1,2,3] # wave timing
m=[3,6,9] # pad timimg
n=[48,52,55,60] # note choice
k=[:bnoise, :cnoise, :gnoise, :pnoise] # wave timbre
with_fx :level,amp: 1 do |v1| #add fx level to enable fade out at end
set :v1,v1
live_loop :pad_1 do; use_synth :hollow #choose synth
t=choose(n); a=choose(m); s=choose(m); r=choose(m)
play t, attack: a, sustain: s, release: r
sleep a+s+r;stop if get(:kill); end
live_loop :pad_2 do; use_synth :hollow #choose synth
t=choose(n); a=choose(m); s=choose(m); r=choose(m)
play t, attack: a, sustain: s, release: r
sleep a+s+r;stop if get(:kill); end
live_loop :pad_3 do; use_synth :hollow #choose synth
t=choose(n); a=choose(m); s=choose(m); r=choose(m)
play t, attack: a, sustain: s, release: r
sleep a+s+r;stop if get(:kill); end
live_loop :wave do; use_synth choose(k) #choose synth
t=choose(n); a=choose(m); s=choose(m); r=choose(w)
play t, attack: a, release: r, amp: 0.3
sleep choose(m)*3;stop if get(:kill); end
live_loop :bell do; use_synth :pretty_bell #choose synth
t=choose(n); a=choose(w); s=choose(w); r=choose(m)
play t,release: r, amp: 0.7 #boosted volume RBN
sleep a+s;stop if get(:kill); end
in_thread do
sync :finish #wait for cue to start fadeout
control get(:v1),amp: 0,amp_slide: 10 #10 sec fade
end
end
# This function generates a stream of repeated notes
# Parameters:
# start: initial number of notes to skip (will produce silence)
# reps: number of notes the stream produces before dying
# n: Note to repeat. If it is an array, one random
# note from the array is selected in each iteration.
# Do not abuse of this feature
# imin: Minimal interval between note repetitions
# imax: Max interval between note repetitions
# len: Length of the note to produce in each repetition
# vmin,vmax: range of "velocity" for the notes. In the original
# implementation, the values were MIDI velocities. In
# this implementation they are used to set amplitude
# and cutoff frequency
define :generate do |start, reps, n, imin, imax, len, vmin, vmax|
puts start,reps,n,imin,imax,len,vmin,vmax
reps.times do |r|
if r<start # Wait the specified initial delay
sleep rrand(imin, imax)
next
end
# Choose a different synth in each iteration
use_synth (ring :hollow, :prophet, :blade, :tb303).tick #added extra synth
# Adjust the volume, depending on the synth selected above
# (:hollow is much quieter than :prophet, so I pump up the volume)
vol_multiplier = (ring 1.2, 0.6, 0.7,0.5).look #add 0.5 for #tb303
# Select the note to play in this iteration
if n.is_a?(Array)
chosen_note = n.choose
else
chosen_note = n
end
# Uncomment next line to get "Bay at night" :-)
chosen_note += -1 + rand_i(2)
# Play the note. Several parameters are set to get a random
# volume and length, between the limits specified
play chosen_note, amp: vol_multiplier*rrand(vmin, vmax)/120,
attack: len/2, decay: rrand(0.2,0.8)*len/2,
pan: choose((stretch rrand(-1, -0.6), 45, rrand(-0.2, 0.2), 10, rrand(0.6,1), 45)),
cutoff: rrand(vmin, vmax),
vibrato_delay: len/2, vibrato_onset:1,
vibrato_rate: 2, vibrato_depth: 0.09
# Wait a random time before triggering the note again
sleep rrand(imin, imax)
break if get(:kill)
end
end
# The above function is the basic infrastructure. Next, I'll call several instances
# of the function, each one in a separated thread. For this, I'll define some
# arrays with the paramaters to be passed to the function in each invocation
use_random_seed = 66776
piece_length = 40
args = [
[0, piece_length-3, :f2,9,12,9,60,90],
[0, piece_length-3,:a2,9,12,9,60,90],
[0, piece_length-3,:c3,9,12,9,60,90],
[1, piece_length-2,:e3,9,12,9,60,90],
[2, piece_length-3,:f3,9,12,9,60,90],
[1, piece_length,:e4,9,12,9,60,90],
[3, piece_length-2,:a4,8,12,9,60,70],
[3, piece_length-2,:b4,8,10,9,50,70],
[3, piece_length-2,[:c4,:cs4,:d4],10,20,3,60,90],
[5, piece_length-4,:c5,8,10,9,50,80],
[5, piece_length-5,:d5,8,10,9,50,90],
[6, piece_length-5,:e5,8,10,9,50,70],
[8, piece_length-5, [:b6,:c7,:d7],4,7,5,70,98]
]
# Now, I create another array containing the time at which each instance of the
# function has to be called. I fill the array with random values below 5, so that
# each call starts at a random instant, but all of them in the first 5 secs
instants = []
instants2 = []#added two more sets of instances
instants3 = []
args.each do
instants.push(20+rand(5)) #delay start for 1st set by 10s
instants2.push(25+rand(5)) #set2 delayed further 5s
instants3.push(35+rand(5)) #set3 delayed further 15s
end
# Using "at", I launch several instances of the function, each one at a
# random instant (specified in "instants" array) and with different
# parameters (specified in "args" array). All those functions share
# the same reverb and flanger effect
with_fx :reverb, spread: 0.9, mix: 0.8, room: 0.99 do
with_fx :flanger do
at instants, args do |params|
generate *params
end
at instants2, args do |params| #add playing data for 2nd set of instances
use_transpose -12 #transpose down an octave
generate *params
end
at instants3, args do |params| #add playing data for 23d set of instances
use_transpose 12 #transpose up an octave
generate *params
end
end
end
at [endsequence] do #start finish sequence
use_bpm 60
cue :finish #cue fadeout sequence for Seagull live_loops
sleep 10
set :kill,true #send kill signal to live loops and break to generate
end