# If You Listen Until the Drone Ends

**URL:** <https://in-thread.sonic-pi.net/t/if-you-listen-until-the-drone-ends/7878>\
**Category:** Creations & Ideas\
**Created:** [June 13, 2023, 12:10am UTC](https://in-thread.sonic-pi.net/t/if-you-listen-until-the-drone-ends/7878 "2023-06-13T00:10:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitsware](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@hitsware](https://in-thread.sonic-pi.net/u/hitsware)\
**Post date:** [June 13, 2023, 12:10am UTC](https://in-thread.sonic-pi.net/t/if-you-listen-until-the-drone-ends/7878/1 "2023-06-13T00:10:09Z")

</div>

```ruby
########### If You Listen Until the Drone Ends ##########
mn=[:r]; use_bpm 110
for jn in 1..127; mn[jn]=hz_to_midi(44*jn); end
m=[0,0,0,0,6,7,8,9]; p=[0,0,11,13,15]
n0=[]; n1=[]; n2=[]; p0=[]

use_synth :dsaw
play mn[2], detune: 0.01, attack: 18, sustain: 999, amp: 0.1
play mn[3], detune: 0.01, attack: 18, sustain: 999, amp: 0.1

loop do
  for x in 0..31; v=1-(x%2); y=x%8; vp=1.0/choose([2,3,4])
    if rand_i(24)==3 then p0[y]=mn[choose(p)]; end
    if rand_i(9) ==3 then n0[x]=mn[choose(m)]; end
    if rand_i(9) ==3 then n1[x]=mn[choose(m)]; end
    if rand_i(9) ==3 then n2[x]=mn[choose(m)]; end
    synth :beep, note: p0[y]-12, release: 0.01, amp: vp
    synth :fm, note: n0[x], release: 1.00, amp: 0.4 * v
    synth :pretty_bell, note: n1[x], release: 0.20, amp: 0.4 * v
    synth :pluck, note: n2[x], release: 2.00, amp: v
sleep 0.25; end; end
```

---

<div class="post-metadata">

**Author:** ![Relaxnow](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/relaxnow/32/2172_2.png) [@Relaxnow](https://in-thread.sonic-pi.net/u/Relaxnow)\
**Post date:** [June 13, 2023, 12:10pm UTC](https://in-thread.sonic-pi.net/t/if-you-listen-until-the-drone-ends/7878/2 "2023-06-13T12:10:30Z")

</div>

Very nice drone + I learned something new today: We can use “;” to format code.

---

<div class="post-metadata">

**Author:** ![just\_Ayush](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@just\_Ayush](https://in-thread.sonic-pi.net/u/just_Ayush)\
**Post date:** [August 29, 2023, 2:14pm UTC](https://in-thread.sonic-pi.net/t/if-you-listen-until-the-drone-ends/7878/3 "2023-08-29T14:14:36Z")

</div>

I really like how you’ve used dsaw, it really adds a good ambience and does go well with the melody you’ve created. Keep up! 🙂
