# Answer to a query on sonic pi github site

**URL:** <https://in-thread.sonic-pi.net/t/answer-to-a-query-on-sonic-pi-github-site/4920>\
**Category:** Support, Help & Resources\
**Created:** [January 4, 2021, 5:27pm UTC](https://in-thread.sonic-pi.net/t/answer-to-a-query-on-sonic-pi-github-site/4920 "2021-01-04T17:27:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [January 4, 2021, 5:27pm UTC](https://in-thread.sonic-pi.net/t/answer-to-a-query-on-sonic-pi-github-site/4920/1 "2021-01-04T17:27:24Z")

</div>

An “issue” has just been posted [Play and Sleep Function · Discussion #2616 · sonic-pi-net/sonic-pi · GitHub](https://github.com/sonic-pi-net/sonic-pi/discussions/2616#discussion-1475499)  
Rather than answer it there a possible solution is below.

```ruby
use_bpm 120
use_synth :pulse
define :pl do |nl,dl|
  nl.length.times do
    play nl.tick,sustain: 0.9*dl.look,release: 0.1*dl.look
    sleep dl.look
  end
end

notes=[:gs5,:gs5,:gs5,:gs5,:gs5,:gs5,
       :fs5,:fs5,:fs5,:b4,:cs5,:ds5,
       :ds5,:ds5,:ds5,:ds5,
       :cs5,:cs5,:cs5,:ds5,:fs5,:gs5]
durations = [1,1,0.5,0.5,0.5,0.5,
             0.5,1,1,0.5,0.5,1.5,
             1,1,0.5,0.5,
             0.5,1,1,0.5,0.5,0.5]

notes2=[[:e3,:fs3,:b3],[:e3,:fs3,:b3],[:e3,:fs3,:b3],
        [:e3,:fs3,:b3],[:e3,:fs3,:b3],[:e3,:fs3,:b3],
        [:ds3,:fs3,:b3],[:ds3,:fs3,:b3],[:ds3,:fs3,:b3],
        [:fs3,:b3,:cs4],[:fs3,:b3,:cs4],[:fs3,:b3,:cs4]]
durations2=[1.5,1.5,1,
            1.5,1.5,1,
            1.5,1.5,1,
            1.5,1.5,1]
in_thread do
  pl notes,durations
end
in_thread do
  pl notes2,durations2
end

```

---

<div class="post-metadata">

**Author:** ![Michael55555](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/michael55555/32/1739_2.png) [@Michael55555](https://in-thread.sonic-pi.net/u/Michael55555)\
**Post date:** [January 4, 2021, 5:58pm UTC](https://in-thread.sonic-pi.net/t/answer-to-a-query-on-sonic-pi-github-site/4920/2 "2021-01-04T17:58:06Z")

</div>

Thanks for your answer Robin!
