# Binary Sweets, Jazz

**URL:** <https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786>\
**Category:** Creations & Ideas\
**Created:** [December 13, 2020, 11:28am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786 "2020-12-13T11:28:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![soxsa](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/soxsa/32/1669_2.png) [@soxsa](https://in-thread.sonic-pi.net/u/soxsa)\
**Post date:** [December 13, 2020, 11:28am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/1 "2020-12-13T11:28:21Z")

</div>

@binarysweets this is great. Would you mind saying a bit about how you did it?

https://w.soundcloud.com/player/?visual=false&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F945567769&show_artwork=true&maxheight=166

---

<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:** [December 13, 2020, 1:45pm UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/2 "2020-12-13T13:45:46Z")

</div>

I’d be interested too!

The best I’ve managed is more like ‘Cool Jazz’…

https://w.soundcloud.com/player/?visual=false&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F698878096&show_artwork=true&maxheight=166

Eli…

---

<div class="post-metadata">

**Author:** ![Bohrbug](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/bohrbug/32/73_2.png) [@Bohrbug](https://in-thread.sonic-pi.net/u/Bohrbug)\
**Post date:** [December 14, 2020, 9:29am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/3 "2020-12-14T09:29:03Z")

</div>

I made this when the with\_swing function was still working :

https://bandcamp.com/EmbeddedPlayer/v=2/track=2546834864/size=large/tracklist=false/artwork=small/

It’s broken now, I believe. Still have to file an issue on Github

---

<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:** [December 14, 2020, 9:29am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/4 "2020-12-14T09:29:17Z")

</div>

Well, the code is not much different from my [Desktop Raver](https://in-thread.sonic-pi.net/t/new-winter-themed-rave-track/4694) track really. I like to use standard template with structured tunes.

Basically, I started with some jazz loops from a sample pack. Bass, piano, sax. Then used a combination of rings, sample slice & rpitch, bools and echo fx to chop, pitch and arrange them. Echo was to ‘fake’ a sustain on the sample when it gets chopped abruptly.

Then it was a case of structuring and layering the samples, percussion, amen break etc 😃

Glad you like it 👍

---

<div class="post-metadata">

**Author:** ![soxsa](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/soxsa/32/1669_2.png) [@soxsa](https://in-thread.sonic-pi.net/u/soxsa)\
**Post date:** [December 15, 2020, 10:58am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/5 "2020-12-15T10:58:17Z")

</div>

> [@Bohrbug](#):
>
> the with\_swing function

Very nice, I esp like it when the clave (click? whatever) comes in towards the end. I’ve not tried the with\_swing function, I’ve been coding swing ‘manually’. It’s broken?

---

<div class="post-metadata">

**Author:** ![soxsa](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/soxsa/32/1669_2.png) [@soxsa](https://in-thread.sonic-pi.net/u/soxsa)\
**Post date:** [December 15, 2020, 11:04am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/6 "2020-12-15T11:04:29Z")

</div>

Thanks. Sample packs - must try that. Very different feel to the Desktop Raver, so that’s a good paradigm.

And the Amen break really? Get’s everywhere - actually I didn’t know it was in all these tune, clearly many more.

“Amen Break musician finally gets paid” [https://www.bbc.co.uk/news/entertainment-arts-34785551](https://www.bbc.co.uk/news/entertainment-arts-34785551)

---

<div class="post-metadata">

**Author:** ![soxsa](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/soxsa/32/1669_2.png) [@soxsa](https://in-thread.sonic-pi.net/u/soxsa)\
**Post date:** [December 15, 2020, 11:05am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/7 "2020-12-15T11:05:29Z")

</div>

> [@Eli](#):
>
> ‘Cool Jazz’…

Also nice - more Pure Sonic Pi than using samples. No room for the Amen break, shame

---

<div class="post-metadata">

**Author:** ![Bohrbug](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/bohrbug/32/73_2.png) [@Bohrbug](https://in-thread.sonic-pi.net/u/Bohrbug)\
**Post date:** [December 15, 2020, 12:47pm UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/8 "2020-12-15T12:47:17Z")

</div>

Yes, it’s broken at the moment. I filed an issue yesterday on Github, so it might be fixed soon.

---

<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:** [December 16, 2020, 3:12am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/9 "2020-12-16T03:12:19Z")

</div>

Just for you, Soxsa… 🙂

Eli…

```ruby
# Jazz Hands
# Eli...

use_bpm 90

key = note(:C4)
mode = :major

clarinet_notes = (ring :d3, :e3, :d3,:a3, :d3, :g3, :a3, :e4)
clarinet_rhythm = (ring 0.25, 0.75, 1, 0.75, 0.25, 0.5, 0.5).shuffle

fade_in1 = (line 0, 2, inclusive: true, steps: 20)
fade_out1 = (line 2, 0, inclusive: true, steps: 20)
fade_through1 = fade_in1 + fade_out1

clarinet_notes = (ring :d3, :e4, :d4,:g4, :f4, :g3, :a3, :e4)

chord_progression = [:ii, :v, :i] # Jazz - ii-V-I
tune = [:d, :r, :r, :a,:g5, :r, :a, :r, :d, :r, :r, :b, :g5, :r, :b, :r]

live_loop :fred do
  sample :loop_amen, start: 0, finish: 0.5, beat_stretch: 2, rate: 0.5
  sleep sample_duration(:loop_amen, start: 0, finish: 0.5, beat_stretch: 2, rate: 0.5)
end

live_loop :theme do
  with_fx(:reverb, room: 0.1, damp: 0.1) do |reverb1|
    use_synth_defaults release: [0.3,0.6].choose, amp: 0.6*fade_through1.tick
    with_synth :piano do
      if rand() > 0.75
        use_transpose +12
        play_pattern_timed tune, [0.25,0.5], amp: 0.6
      else
        tune=tune.shuffle
        play_pattern_timed tune, [0.5], amp: 0.6
        
      end
    end
  end
end

live_loop :clarinet do
  use_synth :fm
  if one_in(4)
    sleep 2
    next
  end
  
  if rand() > 0.75 then
    clarinet_notes = (ring :d3, :e4, :d4,:g4, :f4, :g3, :a3, :e4)
  else
    clarinet_notes = clarinet_notes.shuffle
  end
  deep = rrand(2,6)
  use_synth_defaults divisor: 0.5, depth: deep, attack: 0.05, sustain: 0.2, release: 0.2, amp: 0.2#*fade_through1.tick
  with_fx :reverb, room: 0.75, damp: 0.25 do
    play clarinet_notes.tick # look makes notes play in a row
    play clarinet_notes.look # look makes notes play in a row
    play clarinet_notes.look # look makes notes play in a row
  end
  sleep clarinet_rhythm.look
end

live_loop :prog do
  2.times do
    use_synth_defaults release: [1,1.5].choose, amp: 0.6
    use_synth :piano
    play (ring, chord(:c3, :M7), chord(:a2, :m7), chord(:d3, :m7), chord(:g2, :dom7)).tick, sustain: 1.25
    play (ring, chord(:c3, :M7), chord(:a2, :m7), chord(:d3, :m7), chord(:g2, :dom7)).look, sustain: 1.25
    sleep 2
  end
end

```

---

<div class="post-metadata">

**Author:** ![robbilee](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@robbilee](https://in-thread.sonic-pi.net/u/robbilee)\
**Post date:** [December 17, 2020, 5:39am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/10 "2020-12-17T05:39:07Z")

</div>

Here is a first attempt at jazz +walking bass  
https://w.soundcloud.com/player/?visual=false&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F949197442&show_artwork=true&maxheight=166

---

<div class="post-metadata">

**Author:** ![minced\_mind](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@minced\_mind](https://in-thread.sonic-pi.net/u/minced_mind)\
**Post date:** [December 19, 2020, 10:26pm UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/11 "2020-12-19T22:26:37Z")

</div>

Hi Eli,

your clarinet synth is pretty nice 👍

Cu.

---

<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:** [December 20, 2020, 5:03am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/12 "2020-12-20T05:03:17Z")

</div>

Thanks man,

I’ve got several variants I use.

One day perhaps I’ll rewrite it to include  
slides… not sure if that would make it  
sound better though.

Eli…

---

<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:** [December 23, 2020, 9:46pm UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/13 "2020-12-23T21:46:18Z")

</div>

Hi Robbi,

Really like that walking bass… could I persuade you to post  
the code for it, please?

Many thanks,

Eli…

---

<div class="post-metadata">

**Author:** ![robbilee](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@robbilee](https://in-thread.sonic-pi.net/u/robbilee)\
**Post date:** [January 11, 2021, 11:55pm UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/14 "2021-01-11T23:55:14Z")

</div>

> [@Eli](#):
>
> ss… could I persuade you to post  
> the code for it, please?
> 
> Many thanks,
> 
> Eli…

Yeah no prob, sorry the code is super messy:

```ruby
use_bpm 220
chords= ring(1,4,1,1,4,4,1,1,5,4,1,1)
live_loop :walkin2 do
  tick
  use_synth :subpulse
  
  x=(chord_degree chords.look, :c2, :major)[0]
  play x, amp: 0.5
  sleep 1
  y=(chord_degree chords.look, :c2, :major)[0]+ ring(+2, -2).choose
  play y, amp: 0.5
  sleep 1
  if x<y
    play (chord_degree chords.look, :c2, :major)[1], amp: 0.5
    sleep 1
  else
    play (chord_degree chords.look, :c2, :major)[0]-3, amp: 0.5
    
    sleep 1
    
  end
  play (chord_degree chords[look + 1], :c2, :major)[0] +(ring 1,-1).choose, amp: 0.7
  sleep 1
end

live_loop :chords do
  
  chordProg= [:c4, :f4, :c4, :c4, :f4, :f4, :c4, :c4, :g4, :f4, :c4, :c4].ring.tick(:chordProg)
  chordext= [:mixolydian, :mixolydian, :mixolydian, :mixolydian].ring.tick(:chordext)
  
  use_synth :fm
  i= range(-1, 1).choose
  deg = [:i, :iii].ring.choose
  play chord_degree(deg, chordProg, chordext, 4, invert: i), amp: rrand(0.5,1), cutoff: rrand(80,120) if one_in(1.3)
  
  beat =(ring 0.66,1.66,3,3.66).choose
  sleep beat
  play chord_degree(deg, chordProg, chordext, 4, invert: i), amp: rrand(0.5,1), cutoff: rrand(80,120)
  print beat
  n = 4 - beat
  print n
  sleep n
  
end

define :hihat do
  use_synth :pnoise
  with_fx :hpf, cutoff: 120 do
    play release: 0.01, amp: 1
  end
end

live_loop :hihat_loop do
  hihat
  sleep 1
end

live_loop :hihat_loop2 do
  sleep 2
  
  if one_in 10
    sleep 0.66
    hihat
    sleep 0.33
  end
  sleep 1
end

# SNARE

live_loop :snare_loop do
  sleep 3
  with_fx :lpf, cutoff: 100 do
    
    sample :sn_dub, sustain: 0, release: 0.05, amp: 1 if one_in(2)
  end
  sleep 1
  
end

# BASSDRUM
define :bassdrum do
  use_synth :sine
  with_fx :hpf, cutoff: 100 do
    play amp: 1, release: 0.01
    
  end
  
end

live_loop :bassdrum_loop do
  bassdrum
  sleep 3.66
  bassdrum
  sleep 0.33
end

```

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [January 12, 2021, 1:06am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/15 "2021-01-12T01:06:49Z")

</div>

Hey hey @robbilee - thanks for the code, interesting!

It’d be super helpful if you could add code formatting to your example - do you know how to do that?  
(You can add an extra line before and after the code, and on these lines, place three back-ticks each: ` )

---

<div class="post-metadata">

**Author:** ![robbilee](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@robbilee](https://in-thread.sonic-pi.net/u/robbilee)\
**Post date:** [January 12, 2021, 1:40am UTC](https://in-thread.sonic-pi.net/t/binary-sweets-jazz/4786/16 "2021-01-12T01:40:43Z")

</div>

Awesome, thanks for the tip
