# Sonic Pi Monthly Challenge #1

**URL:** <https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442>\
**Category:** Creations & Ideas\
**Created:** [October 1, 2020, 10:48am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442 "2020-10-01T10:48:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![binarysweets](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/binarysweets/32/2683_2.png) [@binarysweets](https://in-thread.sonic-pi.net/u/binarysweets)\
**Post date:** [October 1, 2020, 10:48am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/1 "2020-10-01T10:48:19Z")

</div>

Hello Sonic Pi’ers, hope you are well 😊

I thought it might be fun to run a little monthly project where we can all create new music based on a theme or idea and then share it in the forum - Whether it is a live performance (video), track or just the code, all formats are welcome.

If this turns out to be a popular idea, then we could take turns in thinking up the next theme.

To kick it off, I was thinking this month’s theme could be “One Random Sample” - What can you do with just one sample?

Instructions:

1. Choose a random sample that you like from Freesound here: [Freesound - "Sound 14 - writing with wacom stylus.wav" by jotica012](https://freesound.org/browse/random/)

2. Make some music, only using the sample that you have chosen in step 1. Any style, any length.

3. Post it in this topic - Youtube/soundcloud/bandcamp, whatever your preferred platform is. Just make sure that you tell us about the sample you used and include a link to the original one, if you can.

**The deadline for this one is 31st October.**

Submissions 👇  
https://w.soundcloud.com/player/?visual=false&url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1144140097&show_artwork=true

[![](https://img.youtube.com/vi/FCzZh2LWxKI/maxresdefault.jpg "enkid0 / Echo-cho-ho-oh (feat. Katy T)") ](https://www.youtube.com/watch?v=FCzZh2LWxKI)

Code and links to audio for this challenge are [here](https://github.com/binarysweets/sonic-pi-monthly-challenge/tree/main/challenge-1)

Happy coding!

💻

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 1, 2020, 1:58pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/2 "2020-10-01T13:58:57Z")

</div>

That’s a great idea.

I am not sure if I will find the time but otherwise: one month should be enough. I will try come up with something.

Thanks @binarysweets for the initiative!

---

<div class="post-metadata">

**Author:** ![gregeporter](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/gregeporter/32/1277_2.png) [@gregeporter](https://in-thread.sonic-pi.net/u/gregeporter)\
**Post date:** [October 2, 2020, 1:47am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/5 "2020-10-02T01:47:53Z")

</div>

This is a really cool idea.  
I saw an Andrew Huang video where he and some other musicians did a similar challenge. I’ll give it a shot. 😛

---

<div class="post-metadata">

**Author:** ![alexesc](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/alexesc/32/1592_2.png) [@alexesc](https://in-thread.sonic-pi.net/u/alexesc)\
**Post date:** [October 2, 2020, 3:31am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/6 "2020-10-02T03:31:30Z")

</div>

should we all choose the same sample like in Andrew’s video?

---

<div class="post-metadata">

**Author:** ![gregeporter](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/gregeporter/32/1277_2.png) [@gregeporter](https://in-thread.sonic-pi.net/u/gregeporter)\
**Post date:** [October 2, 2020, 4:40am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/7 "2020-10-02T04:40:22Z")

</div>

For the purposes of this first go, let’s all choose whatever sample we want and, depending on how we like it, for November (or whenever the next one is) we can up the difficulty and choose the same sample. 🙂

---

<div class="post-metadata">

**Author:** ![alexesc](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/alexesc/32/1592_2.png) [@alexesc](https://in-thread.sonic-pi.net/u/alexesc)\
**Post date:** [October 2, 2020, 7:27pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/8 "2020-10-02T19:27:04Z")

</div>

I got a sample from someone making a pancake 🤣

> **[Making pancake.wav by JarredGibb](https://freesound.org/people/JarredGibb/sounds/244887/)**
>
> Jarred Gibb - Catering
> 
> Digital Zero

---

<div class="post-metadata">

**Author:** ![gregeporter](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/gregeporter/32/1277_2.png) [@gregeporter](https://in-thread.sonic-pi.net/u/gregeporter)\
**Post date:** [October 2, 2020, 8:12pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/9 "2020-10-02T20:12:16Z")

</div>

rofl, that’s something I’d have never expected to be a sample

I got a drone sound which I could see working. At least if I could use some drums…and maybe a synth… or two…oh well, I suppose that’s the challenge! 😛

> **[DroneScapeMultiModDelayVar3.wav by WeldonSmith](https://freesound.org/people/WeldonSmith/sounds/13669/?random_browsing=true)**
>
> Variation more Industrial, wind more metallic. 8 VCO's, 8 Flangers, 4 Bandpass filters, many LFOs, several delay lines.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 2, 2020, 8:52pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/10 "2020-10-02T20:52:51Z")

</div>

I think I will use this one:

> **[Car horns in street protest (outdoor) by bienvenido69](https://freesound.org/people/bienvenido69/sounds/537287/)**
>
> Car horns in street protest.
> Horn sounds during a protest in Mendoza, Argentina (Outdoor).
> September 29, 2020, in the afternoon.
> Recorded in wav with Zoom H1, compressed in FLAC (lossless) with FLAC Frontend
> 
> Bocinas de autos en manifestación...

Oh, sorry no. It should be chosen randomly so I have just picked this one:

> **[Tram-arrives.wav by Xampi8](https://freesound.org/people/Xampi8/sounds/153060/?random_browsing=true)**
>
> This sound was recorded in front of the university Pompeu Fabra, Campus Poblenou. Is the sound of the tram arriving.

---

<div class="post-metadata">

**Author:** ![binarysweets](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/binarysweets/32/2683_2.png) [@binarysweets](https://in-thread.sonic-pi.net/u/binarysweets)\
**Post date:** [October 2, 2020, 9:25pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/11 "2020-10-02T21:25:30Z")

</div>

My one came out as this:

> **[puti32.aiff by bbmario](https://freesound.org/people/bbmario/sounds/107919/)**
>
> The putipù is a percussion instrument used in Neapolitan folk music and, generally speaking in the folk music of much of southern Italy. (An alternatate name is "caccavella".) The name putipù is onomatopoeia for the "burping" sound the instrument...

🤠

---

<div class="post-metadata">

**Author:** ![jrm](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/jrm/32/1600_2.png) [@jrm](https://in-thread.sonic-pi.net/u/jrm)\
**Post date:** [October 2, 2020, 9:46pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/12 "2020-10-02T21:46:15Z")

</div>

Mine will be

> **[bottle cork in and out 2012-1-4.wav by Kyster](https://freesound.org/people/Kyster/sounds/140615/)**
>
> Taking the cork out and in of a bottle. Zoom H2.

---

<div class="post-metadata">

**Author:** ![Eli](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/eli/32/116_2.png) [@Eli](https://in-thread.sonic-pi.net/u/Eli)\
**Post date:** [October 2, 2020, 10:36pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/13 "2020-10-02T22:36:00Z")

</div>

Wow… such interesting and versatile sounds.

And I thought I was doing well to get a grasshopper from SP’s very  
own loopamen…

```ruby
use_bpm 90

live_loop :wibble do
  with_fx :whammy do
    if rand(1) > 0.1 then
      sample :loop_amen, rate: 0.55, start: 0.5, finish: 0.6, pitch: 24
      sleep (sample_duration :loop_amen)
      
    else
      sleep (sample_duration :loop_amen, rate: 0.75, start: 0.5, finish: 0.6)+1.0
    end
  end
end

live_loop :wubble do
  with_fx :whammy do
    if rand(1) > 0.5
      sample :loop_amen, start: 0.375, finish: 0.425
      sleep (sample_duration :loop_amen, rate: 0.75, start: 0.375, finish: 0.425)+0.5
      
    else
      sleep (sample_duration :loop_amen, rate: 0.75, start: 0.5, finish: 0.6)+1.0
    end
  end
end

```

Maybe I’ll have to rethink my game.

Eli…

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 3, 2020, 9:44am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/14 "2020-10-03T09:44:15Z")

</div>

Yeah, well, @Eli I think you are bending the rules… 😉

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [October 3, 2020, 10:19am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/15 "2020-10-03T10:19:14Z")

</div>

some results can be not for all ages 🙂 be careful. Yes even with sounds.  
By the way, nobody can check if you only play once the random choice.  
Can we use synths and internal samples or the rule is one sample only ?  
cheers

---

<div class="post-metadata">

**Author:** ![binarysweets](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/binarysweets/32/2683_2.png) [@binarysweets](https://in-thread.sonic-pi.net/u/binarysweets)\
**Post date:** [October 3, 2020, 10:48am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/16 "2020-10-03T10:48:34Z")

</div>

Well, the challenge was to use just one random sample but you could keep searching for a new random sample until you found one that you were more comfortable using. imo it would be better to push yourself out of your comfort zone though.

@Eli, I agree with Martin. You can re-use your code though, just replace the amen sample with the one you get from Freesound. 👍

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 3, 2020, 10:59am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/17 "2020-10-03T10:59:56Z")

</div>

I actually did search 2 times. Then I was satisfied with the random choice (I did avoid getting a sample from an instrument. Too boring…).

---

<div class="post-metadata">

**Author:** ![bitkids](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@bitkids](https://in-thread.sonic-pi.net/u/bitkids)\
**Post date:** [October 4, 2020, 11:33am UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/18 "2020-10-04T11:33:31Z")

</div>

I like this idea !  
And then make this.  
Maybe It’s boring for you but I’m happy to do it 😀

```
use_bpm 120

# sample file
# https://freesound.org/people/zimbot/sounds/122984/?random_browsing=true
freesound = "C:/wavs/samples/freesound/122984 __zimbot__ portalmalfunction-medium.wav"

live_loop :bass_loop do
  
  use_synth :fm
  use_synth_defaults sustain: 0.125
  
  4.times do
play_pattern_timed [:C3 ,:Eb3,:E3 ,:G3 ,:A3,:Bb3],[1 ,0.125, 0.775 ,1 ,0.125, 0.775]
  end
  2.times do
play_pattern_timed [:F3 ,:A3,:Bb3 ,:Eb4 ,:G4,:Ab4],[1 ,0.125, 0.775 ,1 ,0.125, 0.775]
  end
  play_pattern_timed [:F3 ,:Ab3 ,:B3 ,:D4 ,:E3 ,:G3 ,:Bb3 ,:Db4],[1]
  
end

# change rate from 1 to 12 . It's funny and fun !!
live_loop :audio_loop do
  
  sample freesound ,rate: 6 ,amp:0.5
  sleep 5
  sample freesound ,rate: 1 ,amp:0.5
  sleep 3
  
end
```

---

<div class="post-metadata">

**Author:** ![jrm](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/jrm/32/1600_2.png) [@jrm](https://in-thread.sonic-pi.net/u/jrm)\
**Post date:** [October 4, 2020, 1:20pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/19 "2020-10-04T13:20:54Z")

</div>

Ok, I made this kind of tribal loop

```ruby
# Copyleft - Jérôme Prudent
# https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442
# Sonic Pi monthly challenge : "Make any piece of sound from a single sample"
# The sample for this piece is downloadable at https://freesound.org/people/Kyster/sounds/140615/

sample_path = "/home/jerome/p/songs/Library/Sound FX & Scratches/bottle-cork-in-and-out-2012-1-4.wav"
sample_d = sample_duration(sample_path)
puts "sample duration #{sample_d}"

define :sample_slicer do |start_end|
  start_end.collect { |x| (sample_d - x) / sample_d }
end

percu = sample_slicer([3.49, 3.23])
puts "percu : #{percu}"

t1 = 1.0
t2 = t1 / 2
t4 = t2/ 2
t8 = t4/ 2

b = bass = 0.5
m = medium = 0.75
h = high = 1
r = repos = 0
rs = [
  #0
  (ring b, b, m, m, b, b, h, h, b, b, m, m, b, b, h, h),
  (ring b, r, m, m, r, r, h, r),
  (ring b, r, m, m, r, b, h, r, b, r, r, m, b, b, m, r),
  (ring b, m, m, r, b, r, h, h, b, h, r, h, b, r, h, h),
  #4
  (ring h, r, r, h, h, r, m, m),
  (ring b, r, r, b, b, r, m, m),
  (ring h, r, r, h, h, r, b, r, h, r, m, m, h, r, b, r),
  (ring b, b, m, m, b, b, h, h, b, b, m, m, b, b, h, h),
  #8
  (ring b, r, m, m, b, h, h, r, b, r, m, m, b, h, h, r),
  (ring m, m, r, h, m, m, h, r, m, m, h, r, m, m, h, r),
  
]

set :timbre, rs.first
set :rythm, (ring t8)
set :chord, (chord knit(0, 20, 3, 1).choose, knit(:m7, 3, :dim7, 2, :dom7, 1).tick(:x))

live_loop :ticks do |cpt|
  use_bpm 100
  sleep t8+0.001
  set :guiro, false
  if (factor?(cpt, 10 * 16))
    x = rs.tick(:rs)
    puts "Change rythm #{x}"
    set :timbre, x
    set :rythm, (ring t8)
  end
  if (factor?(cpt, 16))
    ch = (chord knit(0, 9, 3, 1).choose, knit(:m7, 3, :dim7, 2, :dom7, 1).tick(:x))
    puts "Change chord #{x}"
    set :chord, ch
  end
  if (factor?(cpt, [4,8].choose*16 + 8))
    set :guiro, true
  end
  
  cpt += 1
end

#you can change the pattern easily

with_fx :lpf do
  with_fx :distortion do
    live_loop :percu do
      sync :ticks
      timbre = get :timbre
      t = timbre.tick(:timbre)
      cutoff = 90
      if (factor?(look(:timbre), 4))
        puts look(:timbre)
        cutoff = 120
      end
      p = false
      if (t != repos)
        p = sample sample_path, amp: 1, start: percu[0], finish: percu[1],
          rate: t, cutoff: cutoff
      end
      rythm = get :rythm
      r = rythm.tick(:rythm)
      
      sleep r
    end
  end
end

live_loop :fast_tictictic do
  sync :ticks
  speed = knit(0, 2, 1, 2, 2, 1).choose
  probability = (knit true, 2, false, 1)
  with_fx :hpf do
    t = (sync :current_rythm) - 0.001
    speed.times do
      sample sample_path, amp: 1, start: percu[0], finish: percu[1], rate: 8
      sleep t / speed
    end
  end
end

with_fx :reverb do
  live_loop :melody do
    sync :ticks
    if ((ring true, true, false, false).tick(:p))
      ch = get :chord
      a, b, c = ch
      if(one_in(3))
        puts "reverse"
        ch = ch.reverse
      end
      
      n = t8 / (ring 2, 1, 1, 1, 1, 1, 1, 1, 1).tick(:n)
      sample sample_path, amp: 1, start: percu[0], finish: percu[1], rate: 2, rpitch: a
      sleep n
      sample sample_path, amp: 1, start: percu[0], finish: percu[1], rate: 2, rpitch: b
      sleep n
      sample sample_path, amp: 1, start: percu[0], finish: percu[1], rate: 2, rpitch: c
      sleep n
    end
  end
end

guiro1 = sample_slicer([3.783, 3.497])
puts "guiro1 : #{guiro1}"

guiro2 = sample_slicer([sample_d, 4.016])
puts "guiro2 : #{guiro2}"

scratch = sample_slicer([0.834, 0.3])
puts "scratch : #{scratch}"

live_loop :guiro2 do
  s, e = [guiro1, guiro2, scratch].tick(:g)
  if(sync :guiro)
    with_fx :ping_pong do
      with_fx :hpf do
        s = sample sample_path, amp: 1, start: s, finish: e, rate: 0.5
      end
    end
  end
end

```

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [October 4, 2020, 1:23pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/20 "2020-10-04T13:23:10Z")

</div>

thanks to this monthly challenge, we clearly see post into this forum mp3 format file would be appreciated no ?

---

<div class="post-metadata">

**Author:** ![jrm](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/jrm/32/1600_2.png) [@jrm](https://in-thread.sonic-pi.net/u/jrm)\
**Post date:** [October 4, 2020, 1:23pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/21 "2020-10-04T13:23:43Z")

</div>

@bitkids you bypassed the “only using the sample” rule 🙂

---

<div class="post-metadata">

**Author:** ![bitkids](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@bitkids](https://in-thread.sonic-pi.net/u/bitkids)\
**Post date:** [October 4, 2020, 1:59pm UTC](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442/22 "2020-10-04T13:59:41Z")

</div>

@jrm  
Oh, I got it. thank you!  
Only one sample not using synth. 😆 I will try again .

[Next page](https://in-thread.sonic-pi.net/t/sonic-pi-monthly-challenge-1/4442.md?page=2)
