Skip to content

Instantly share code, notes, and snippets.

@hzulla
Last active March 12, 2020 21:09
Show Gist options
  • Save hzulla/6b25f695fcdbc997dd46 to your computer and use it in GitHub Desktop.
Save hzulla/6b25f695fcdbc997dd46 to your computer and use it in GitHub Desktop.
Sonic Pi: Noodling Around
# Noodling around with random melodies on Sonic Pi
# Audio here: https://soundcloud.com/hanno-zulla/sonic-pi-noodling-around
#
# Drum loop via Ethan Hein at https://docs.google.com/spreadsheets/d/19_3BxUMy3uy1Gb0V8Wc-TcG7q16Amfn6e8QVw4-HuD0/edit#gid=0
use_bpm 105
drum_loop = [
# Take Me To The Nerdy Gras
{
:bd_haus => "X.........X..X..",
:elec_snare => "....X.......X...",
:elec_flip => "X.X.X.XXX.X.X.XX",
:elec_plip => "X.X..X...X..X...",
:elec_blip => "....X..X..X..X.X"
},
{
:bd_haus => "X..X......X.....",
:elec_snare => "....X..X.X..X...",
:elec_flip => "X...X.XXX.X.X...",
:elec_fuzz_tom => "..............X.",
:elec_plip => "X.X..X...X..X...",
:elec_blip => "....X..X..X..X.X"
}
]
live_loop :drums do
4.times do |l|
sample :bd_boom if l.even?
d = l == 3 ? 1 : 0
16.times do |i|
drum_loop[d].each do |drum_sample, drum_pattern|
sample drum_sample, amp: 0.8 if drum_pattern[i] == "X"
end
sleep 0.25
end
end
end
progression = [
chord(:Eb3, :major),
chord(:G3, :minor),
chord(:Ab3, :major),
chord(:Bb3, :major7)
].ring
live_loop :chords do
with_fx :slicer do
with_fx :ixi_techno do
use_synth :supersaw
play_chord progression.tick, release: 3
sleep 4
end
end
end
live_loop :noodle do
sync :chords
m = progression.tick
use_random_seed look.modulo(16)
[8,10].choose.times do
use_synth :tb303
play m.choose, amp: 0.4, release: 0.5
sleep [0.25, 0.25, 0.5].choose
end
end
@emrox
Copy link

emrox commented Dec 14, 2015

hmm .. just some remix

# Noodling around with random melodies on Sonic Pi
# Audio here: https://soundcloud.com/hanno-zulla/sonic-pi-noodling-around
#
# Drum loop via Ethan Hein at https://docs.google.com/spreadsheets/d/19_3BxUMy3uy1Gb0V8Wc-TcG7q16Amfn6e8QVw4-HuD0/edit#gid=0

use_bpm 123

drum_loop = [
  # Take Me To The Nerdy Gras
  {
    :bd_haus       => "X...X...X...X...",
    :elec_snare    => "....X.......X...",
    :elec_flip     => "X.X.X.XXX.X.X.XX",
    :elec_plip     => "X.X..X...X..X...",
    :elec_blip     => "....X..X..X..X.X"
  },
  {
    :bd_haus       => "X..X......X.....",
    :elec_snare    => "....X..X.X..X...",
    :elec_flip     => "X...X.XXX.X.X...",
    :elec_fuzz_tom => "..............X.",
    :elec_plip     => "X.X..X...X..X...",
    :elec_blip     => "....X..X..X..X.X"
  }
]

live_loop :drums do
  4.times do |l|
    sample :bd_boom if l.even?
    d = l == 3 ? 1 : 0
    16.times do |i|
      drum_loop[d].each do |drum_sample, drum_pattern|
        sample drum_sample, amp: 0.8 if drum_pattern[i] == "X"
      end
      sleep 0.25
    end
  end
end

progression = [
  chord(:Eb3, :major),
  chord(:G3,  :minor),
  chord(:Ab3, :major),
  chord(:Bb3, :major7)
].ring

live_loop :chords do
  sleep 1
  with_fx :slicer, seed: 331251, amp_min: 0.8 do
    with_fx :reverb, mix: 0.8, room: 0.9 do
      with_fx :echo, mix: 0.5, decay: 6, phase: 0.8 do
        with_fx :echo, mix: 0.5, decay: 4, phase: 0.7 do
          use_synth :supersaw
          play_chord progression.tick, release: 0.5, cutoff: 80
        end
      end
    end
    sleep 3
  end
end

live_loop :noodle do
  sync :chords
  m = progression.tick
  use_random_seed look.modulo(16)
  [8,10].choose.times do
    with_fx :reverb, mix: 0.3, room: 0.2 do
      use_synth :tb303
      play m.choose, amp: 0.4, release: 0.8, cutoff: 90, res: 0.4, wave: 1
      sleep [0.25, 0.25, 0.5].choose
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment