Hi from Italy [with a Charles Mingus gift]

Hi everybody,
this is Leo from Bologna, Italy. I am a music teacher, musicologist, and guitar jazz player.
I discover Sonic.pi talking with some collogue of mine and last year I attended a Sam Aaron workshop in Bologna. (it was great: thanks Sam!)
I’m a completely newbie in coding, so these are my first explorations in writing lines of code.
I would like to thank you, everyone here, for your great support: in_thread website is a great resource tool and this community is fantastic!
Even if I am not at all a skilled user, this year I started a sonic.pi class in my school (11-13 years old students). Students are very enthusiastic about this software (eve if now we are working on-line because schools are closed during lockdown).
As a starting gift, I am bringing here a little piece: a short arrangement of Charles Mingus’s Freedom. If you don’t know this recording, here is a youtube link.
My aim was to render the subtle time fluctuations of the handclaps and percussion in Mingus’s ensemble: many people reaching the beat slightly out of synchro.
I am sure that I could code it in a much more efficient way, but, at least, it sounds good enough to my ears! :wink:
Good listening!
Leo

#Coded by Leo Izzo
#An attempt to render the collective rhythmic
#effect of Charles Mingus's "Freedom"

live_loop :beat do #live_loop for rhythmic syncing
  cue :bar
  sleep 8
end

live_loop :drums do
  sample :bd_808
  sleep 1
  sample :drum_snare_soft
  sleep 1
end

# rhythmic ensemble: 7 finger-snaps and one snare hit together on the 8th beat
  # with subtile time-fluctuations
with_fx :reverb, mix: 0.7, room: 0.9, amp: 1 do
  live_loop :sn1 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap, amp: rrand(0.5, 1), rate: 0.8, pan: 0.5
  end
  
  live_loop :sn2 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap, amp: rrand(0.5, 1), rate: 1, pan: 0.2
  end
  
  live_loop :sn3 do
    sync :bar
    sleep 6
    sleep rrand(0.99, 1.1)
    sample :perc_snap, amp: rrand(0.5, 1), rate: 1.2, pan: 0
  end
  
  live_loop :sn4 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap2, amp: rrand(0.5, 1), rate: 0.8, pan: -0.5
  end
  
  live_loop :sn5 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap2, amp: rrand(0.5, 1), rate: 1, pan: -0.2
  end
  live_loop :sn6 do
    sync :bar
    sleep 6
    sleep rrand(0.99, 1.1)
    sample :perc_snap2, amp: rrand(0.5, 1), rate: 1.2, pan: 0
  end
  live_loop :snare do
    sync :bar
    sleep 6
    sleep rrand(0.99, 1.1)
    sample :drum_snare_hard, amp: rrand(0.5, 1), rate: 1.2, pan: 0
  end
end

8.times do #bass intro
  use_octave 2
  giro = [:Bb1, :Bb1, :C2, :C2, :Db2, :Db2, :C2, :C2].ring
  use_synth :hoover
  play giro.tick, amp: 0.4
  sleep 1
end

live_loop :bass do
  24.times do
    use_octave 2
    giro = [:Bb1, :Bb1, :C2, :C2, :Db2, :Db2, :C2, :C2].ring
    use_synth :hoover
    play giro.tick, amp: 0.4
    sleep 1
  end
  8.times do
    giro2 = [:Gb2, :Gb2, :F2, :F2, :Bb1, :Bb1, :Bb1, :Bb1].ring
    play giro2.tick, amp: 0.4
    sleep 1
  end
end

live_loop :melody do
  use_octave 1
  12.times do
    mel = [:Bb4, :Bb4, :Ab4, :F4, :Ab4, :Bb4].ring
    dur = [0.6, 2.4, 0.6, 0.4, 0.6, 3.4].ring
    rel = [0.5, 2.3, 0.5, 0.3, 0.5, 3.3].ring
    use_synth :dsaw
    use_octave 0
    play mel.tick, attack: 0.2, release: rel.look, amp: 0.5
    use_octave -1
    play mel.look, attack: 0.2, release: rel.look, amp: 0.3
    sleep dur.look
  end
  12.times do
    mel2 = [:Bb4, :Bb4, :Ab, :F4,
            :Ab4, :Bb4, :Bb3, :Db4,
            :E4, :Eb4, :Db4,
            :Bb3].ring
    dur2 = [0.6, 2.4, 0.6, 0.4,
            0.6, 2.4, 0.6, 0.4,
            0.6, 2.4, 1,
            4].ring
    rel2 = [0.5, 2.3, 0.5, 0.3,
            0.5, 2.3, 0.5, 0.3,
            0.6, 2.3, 1.0,
            3.0].ring
    use_synth :dsaw
    use_octave 0
    play mel2.tick, attack: 0.2, release: rel2.look, amp: 0.5
    use_octave -1
    play mel2.look, attack: 0.2, release: rel2.look, amp: 0.3
    sleep dur2.look
  end
end
7 Likes

Great stuff @Prof1220 :smiley: - I think you have done the slightly desynchronised percussion well!

(Welcome to in_thread too - great to have you around :+1: )
Ah - you’ve already been around for a while :wink: well, welcome again :grinning_face_with_smiling_eyes:

Thank you, Ethan.
Very glad you like it!
I just updated, adding some details: sliding nuances to the melody and enhanced stereo placement of percussions.

live_loop :beat do #live_loop for rhythmic syncing
  cue :bar
  sleep 8
end

live_loop :drums do
  sample :bd_808
  sleep 1
  sample :drum_snare_soft
  sleep 1
end

# rhythmic ensemble: 7 finger-snaps and one snare hit together on the 8th beat
# with subtile time-fluctuations
with_fx :reverb, mix: 0.7, room: 0.9, amp: 1 do
  live_loop :sn1 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap, amp: rrand(0.5, 1), rate: 0.8, pan: 0.9
  end
  
  live_loop :sn2 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap, amp: rrand(0.5, 1), rate: 1, pan: 0.5
  end
  
  live_loop :sn3 do
    sync :bar
    sleep 6
    sleep rrand(0.99, 1.1)
    sample :perc_snap, amp: rrand(0.5, 1), rate: 1.2, pan: 0.2
  end
  
  live_loop :sn4 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap2, amp: rrand(0.5, 1), rate: 0.8, pan: -0.9
  end
  
  live_loop :sn5 do
    sync :bar
    sleep 6
    sleep rrand(0.97, 1.2)
    sample :perc_snap2, amp: rrand(0.5, 1), rate: 1, pan: -0.5
  end
  live_loop :sn6 do
    sync :bar
    sleep 6
    sleep rrand(0.99, 1.1)
    sample :perc_snap2, amp: rrand(0.5, 1), rate: 1.2, pan: -0.2
  end
  live_loop :snare do
    sync :bar
    sleep 6
    sleep rrand(0.99, 1.1)
    sample :drum_snare_hard, amp: rrand(0.5, 1), rate: 1.2, pan: 0
  end
end

8.times do #bass intro
  giro = [:Bb1, :Bb1, :C2, :C2, :Db2, :Db2, :C2, :C2].ring
  use_synth :hoover
  play giro.tick+12, amp: 0.4
  sleep 1
end

live_loop :bass do
  24.times do
    giro = [:Bb1, :Bb1, :C2, :C2, :Db2, :Db2, :C2, :C2].ring
    use_synth :hoover
    play giro.tick+12, amp: 0.4
    play giro.look+24, amp: 0.3
    use_synth :fm
    play giro.look+31, amp: 0.05
    sleep 1
  end
  8.times do
    giro2 = [:Gb2, :Gb2, :F2, :F2, :Bb1, :Bb1, :Bb1, :Bb1].ring
    play giro2.tick, amp: 0.4
    sleep 1
  end
end

live_loop :melody do
  2.times do
    s = synth :dsaw, note: :A4, note_slide: 0.05, attack: 0.2, amp: 0.5, sustain: 8
    6.times do
      mel = [:Bb4, :Bb4, :Ab4, :F4, :Ab4, :Bb4].ring
      dur = [0.6, 2.4, 0.6, 0.4, 0.6, 3.4].ring
      rel = [0.5, 2.3, 0.5, 0.3, 0.5, 3.3].ring
      control s, note: mel.tick
      use_synth :blade
      play mel.look+12, attack: 0.1, release: rel.look, amp: 0.5
      play mel.look-24, attack: 0.05, release: rel.look, amp: 0.3
      sleep dur.look
    end
  end
  s1 = synth :dsaw, note: :A4, note_slide: 0.05, attack: 0.2, amp: 0.5, sustain: 16
  12.times do
    mel2 = [:Bb4, :Bb4, :Ab, :F4,
            :Ab4, :Bb4, :Bb3, :Db4,
            :E4, :Eb4, :Db4,
            :Bb3].ring
    dur2 = [0.6, 2.4, 0.6, 0.4,
            0.6, 2.4, 0.6, 0.4,
            0.6, 2.4, 1,
            4].ring
    rel2 = [0.5, 2.3, 0.5, 0.3,
            0.5, 2.3, 0.5, 0.3,
            0.6, 2.3, 1.0,
            3.0].ring
    control s1, note: mel2.tick
    use_synth :blade
    play mel2.look+12, attack: 0.2, release: rel2.look, amp: 0.5
    play mel2.look-24, attack: 0.2, release: rel2.look, amp: 0.3
    sleep dur2.look
  end
end
3 Likes