Some interesting sounds thrown together

Various snippets from my archive, which
sort of work… I like the intro… could a live
coder use it to keep the audience busy
while setting up, maybe?

Eli…

use_bpm 110

live_loop :bar do
  sleep 1
end

live_loop :beat4 do
  sleep 4
end

# mixer
intro_vol = (line 1,0, steps: 10, inclusive: true).ramp
x=5
#show opener...

with_fx :echo, phase: 2, mix: 0.5 do
  with_fx :panslicer, mix: 0.5 do
    with_fx :hpf, cutoff: 70 do
      with_fx :reverb, mix: 0.4 do
        with_fx :echo, mix: 0.2 do
          
          live_loop :intro do
            sync :bar
            use_synth :prophet
            use_synth_defaults cutoff: rrand(70, 110),
              release: rrand(1, 4), amp: intro_vol.tick
            if x > 0 then
              x=x-1
            else
              x=4
            end
            
            x.times do
              play_chord chord(:D3, :minor )
              sleep 0.75
            end
            sleep 0.5
            play_chord chord(:D4, :minor ), attack: 4, release: 2
            sleep 2
          end
        end
      end
    end
  end
end

sleep 48
# put your own code here...

with_fx :distortion, mix: 0.06 do
  with_fx :nrhpf, cutoff: 30, mix: 0.1 do
    
    live_loop :beats do
      sync :bar
      sample :loop_compus, beat_stretch: 16, amp: 2
      sleep 16
    end
    
    live_loop :drums do
      sync :bar
      sample :bd_haus, amp: 2
      sleep 1
    end
  end
end

sleep 32

with_fx :reverb, mix: 0.2 do
  
  live_loop :bassline1 do
    use_synth :prophet
    use_synth_defaults release: rrand(0.05, 0.25), amp: rrand(1.5, 2)
    notes = (ring :C2, :C3, :r, :Eb3, :r, :G2, :Bb2, :r)
    play notes.tick, cutoff: rrand(40, 120)
    
    sleep 0.25
  end
  
  live_loop :bassline do
    use_synth :blade
    use_synth_defaults release: rrand(0.25, 0.5), amp: rrand(1.5, 2)
    if rand(1) > 0.65 then
      notes = (ring :C2, :C3, :r, :Eb3, :r, :G2, :Bb2, :r)
    else
      notes = (ring :C2, :C3, :r, :Eb3, :r, :G2, :Bb2, :r).shuffle
    end
    play notes.tick, cutoff: rrand(40, 120)
    
    sleep 0.25
  end
end

sleep 32

live_loop :hihat do
  sync :bar
  sample :drum_cymbal_pedal, amp: 0.2
  sleep 0.25
end

with_fx :reverb, mix: 0.5 do
  live_loop :snaps do
    sync :bar
    4.times do
      sleep 2
      sample :perc_snap, amp: 1.5 if rand < 0.8
    end
  end
end
7 Likes

Cool stuff! A goal I have is to put together some miscellaneous sounds and samples that would play between songs in a set while re-tuning, loading patches, etc. and will add these to my small collection. Thank you!

1 Like

Hi Eli,

pretty nice :slight_smile: Could be used as a lounge endless loop :smiley:

Cu.

1 Like

This is great Eli; I really like what you’ve done with the cutoff, so simple, yet effective. I had a play with your code last night and came up with the below edit. :stuck_out_tongue:

use_bpm 110
use_random_seed 20191219

live_loop :bar do
  sleep 1
end

live_loop :intro do
  sync :bar
  use_synth :prophet
  use_synth_defaults cutoff: rrand(70, 110), release: rrand(1, 4), amp: (line 1.5, 0, steps: 10, inclusive: true).tick
  
  (ring 4,3,2,1).look.times do
    play_chord chord(:D3, :minor )
    sleep 0.75
  end
  
  sleep 0.5
  play_chord chord(:D4, :minor ), attack: 4, release: 2
  sleep 2
end

with_fx :distortion, mix: 0.06 do
  with_fx :eq, low_note: 60, low: -0.8 do
    live_loop :beats do ; tick
      s = :loop_breakbeat
      pattern = (ring 1,0,0,0, 2,0,0,0, 1,0,0,0, 3,0,0,1)
      
      sample s, slice: 0, num_slices: 32, amp: rrand(5, 5.1) if pattern.look == 1
      sample s, slice: 8, num_slices: 32, amp: rrand(5, 5.1) if pattern.look == 2
      sample s, slice: 8, num_slices: 32, amp: rrand(5, 5.1), rate: 0.95 if pattern.look == 3
      
      sleep 0.25
    end
  end
end

live_loop :bassline1 do
  use_synth :prophet
  use_synth_defaults release: rrand(0.05, 0.25), amp: rrand(1.5, 2)
  notes = scale(:d2, :minor)
  play notes.tick, cutoff: rrand(40, 120)
  
  sleep 0.25
end

live_loop :bassline2 do
  use_synth :blade
  use_synth_defaults release: rrand(0.25, 0.5), amp: rrand(1.5, 2)
  
  if rand(1) > 0.65 then
    notes = scale(:d2, :minor) + (ring :r)
  else
    notes = scale(:d1, :minor).shuffle + (ring :r)
  end
  
  play notes.tick, cutoff: rrand(40, 120)
  sleep 0.25
end

live_loop :snaps do
  sync :bar
  
  4.times do
    sleep 2
    sample :perc_snap, amp: 1.5 if rand < 0.8
  end
end

live_loop :lead do
  notes = (ring :d5) + (scale :d5, :minor, num_octaves: 2).shuffle
  s = synth :pretty_bell, note: :e5, sustain: 4, note_slide: 0.1, amp: 0.2
  
  control s, note: notes.tick, note_slide: (line 0, 0.1, steps: 2).look
  sleep (ring 1, 1, 1, 1, 0.5, 0.5, 1, 2).look
end
3 Likes

Oh my! That is sweet.

Sorry, but I’m ‘borrowing’ that back off you !!1! yoink :slight_smile:

Eli…

Okay, here’s a couple of other snippets that go together well,
but I can’t seem to take them beyond a basic beat… perhaps
a nice whiny police siren, or a wailing noise of some kind…

Hmmm.

Eli…

this_sample = :loop_breakbeat

use_sample_bpm this_sample

len = sample_duration this_sample
bar = len * 0.25
beats = len * 0.0625

live_loop :drummer do
  cue :loop
  cue :bar
  sample :drum_heavy_kick
  3.times do
    sleep bar
    cue :bar
  end
  sleep beats * 3
  sample :drum_heavy_kick
  sleep beats
end

live_loop :gunshot do
  # Alternate patterns
  # phase = [3,2,1,2].ring.tick
  phase = 3
  with_fx :echo, phase: beats * phase, decay: len, mix: 0.6 do
    # Change speed of gunshots
    # speed = [0.25, 0.5, 1, 1, 1, 0.5].ring.look
    speed = [0.25, 0.5, 1, 1, 1, 0.5].choose
    sync :loop
    if rand < 0.9 then
      sample this_sample, rate: speed
    end
  end
end
2 Likes

Call the police! :sweat_smile:

this_sample = :loop_breakbeat
use_sample_bpm this_sample
len = sample_duration this_sample
bar = len * 0.25
beats = len * 0.0625

live_loop :drummer do
  cue :loop
  cue :bar
  sample :drum_heavy_kick, amp: 2
  
  3.times do
    sleep bar
    cue :bar
  end
  
  sleep beats * 3
  sample :drum_heavy_kick, amp: 2
  sleep beats
end

live_loop :gunshot do
  # Alternate patterns
  # phase = [3,2,1,2].ring.tick
  phase = 3
  with_fx :echo, phase: beats * phase, decay: len, mix: 0.6 do
    # Change speed of gunshots
    # speed = [0.25, 0.5, 1, 1, 1, 0.5].ring.look
    speed = [0.25, 0.5, 1, 1, 1, 0.5].choose
    sync :loop
    if rand < 0.9 then
      sample this_sample, rate: speed, amp: 2
    end
  end
end

live_loop :pads do
  use_synth :prophet
  use_synth_defaults cutoff: rrand(70, 110), release: rrand(1, 4), amp: 0.4
  sleep 8
  
  (ring 4,3,2,1).look.times do
    play_chord chord(:D3, :minor)
    sleep 0.75
  end
  
  sleep 0.5
  play_chord chord(:D3, :minor ), attack: 4, release: 2
  sleep 2
end

with_fx :distortion, distort: 0.9 do
  live_loop :bass do
    sleep 16
    use_synth :tri
    
    32.times do
      play scale(:D1, :minor).choose, release: 0.25, amp: 0.5
      sleep (ring 1, 1, 0.5, 1.5).tick
    end
  end
end

# Below code by emyln
# https://in-thread.sonic-pi.net/t/simulating-a-telephone-in-sonic-pi/2212
#
# https://en.wikipedia.org/wiki/Dial_tone
# https://help.genesys.com/cic/mergedprojects/wh_ia/desktop/dial_tone,_busy_and_ringback_signals_by_country.htm
DIAL_TONES = {
  :uk => [350, 450],
  :us => [350, 440],
  :eu => [425],
  :jp => [400]
}

# http://dialabc.com/sound/dtmf.html
DTMF_TONES = {
  '1' => [697, 1209],
  '2' => [697, 1336],
  '3' => [697, 1477],
  '4' => [770, 1209],
  '5' => [770, 1336],
  '6' => [770, 1477],
  '7' => [852, 1209],
  '8' => [852, 1336],
  '9' => [852, 1477],
  '*' => [941, 1209],
  '0' => [941, 1336],
  '#' => [941, 1477],
  'A' => [697, 1477],
  'B' => [770, 1477],
  'C' => [852, 1477],
  'D' => [941, 1477],
}

# also
# http://www.telephonesuk.co.uk/sounds.htm

define :pulses do |freqs, periods|
  on = true
  periods.each do |t|
    if on
      freqs.each do |freq|
        synth :sine, note: hz_to_midi(freq), sustain: t, release: 0, amp: 0.1
      end
    end
    
    sleep t
    on = not(on)
  end
end

define :dialtone do |tone=:uk, periods=[2]|
  tone = DIAL_TONES[tone]
  pulses(tone, periods)
end

define :dtmf do |digit, length=0.25, pause=0.25|
  tone = DTMF_TONES[digit.to_s.upcase]
  pulses(tone, [length, pause]) if tone
end

define :ringring do |rings=1|
  pulses([400, 450], [0.5, 1, 0.5, 1] * rings)
end

define :phone do |number|
  with_fx :distortion, distort: 0.3, mix: 0.3 do
    noise = synth :pnoise, amp: 0.01, sustain: 15
    dialtone(:uk)
    number.split('').each do |n|
      dtmf(n)
    end
    sleep 1.5
    ringring(3)
    #control noise, amp: 0
  end
end

live_loop :call_the_police do
  phone '999'
end
1 Like

there’s a madman around!

peers at Binary

Did you get into the Christmas Egg-nog a bit early? :slight_smile:

Joking aside, I like it, it works. And thats all that counts. GG!

Eli…

Haha I love it! Nice work you two

1 Like

Hopefully, shortly after you call the police, you hear this. :slight_smile:
still a work in progress).

slider = 4
wails =(ring 2, 3)


live_loop :siren do
  sleep 8
  use_synth_defaults amp: 0.25
  siren = synth :fm,  note: :d6, note_slide: slider, sustain: slider * wails.look * 2
  wails.look.times do
    control siren, note: :d7
    sleep slider / 2
    control siren, note: :d6
    sleep slider
    control siren, amp: 0.5, note: :d7
    sleep slider
    control siren, amp: 0.5, note: :d6
    sleep slider
    control siren, amp: 0
    wails.tick
  end
end
1 Like

Hehe,

quite some things going around here :slight_smile:

1 Like

2 Likes