# School is over - let's play sonic pi

**URL:** <https://in-thread.sonic-pi.net/t/school-is-over-lets-play-sonic-pi/4158>\
**Category:** Creations & Ideas\
**Created:** [July 3, 2020, 10:42am UTC](https://in-thread.sonic-pi.net/t/school-is-over-lets-play-sonic-pi/4158 "2020-07-03T10:42:46Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [July 3, 2020, 10:42am UTC](https://in-thread.sonic-pi.net/t/school-is-over-lets-play-sonic-pi/4158/1 "2020-07-03T10:42:46Z")

</div>

Hi,

Just some code for young people on this day in France where the school is over !  
Just to learn the basics.

```ruby
##| nlb - 03-07-2020
##| school-is-over
## chords progression with bass and melody based on notes coming from the current chord
##

use_bpm 96

progression = ( ring
                (chord :a, 'minor'),
                (chord :f, 'major'),
                (chord :c, 'major'),
                (chord :d, 'minor'),
                )

current_chord = progression[0]

with_fx :echo, mix: 0.25 do
  live_loop :chords_player, delay: 0.5 do
    use_synth :piano
    4.times do
      play current_chord
      sleep 1
    end
  end
end

with_fx :reverb, mix: 0.7 do
  live_loop :melody do
    use_synth :pretty_bell
    use_synth_defaults attack: 0, release: 0.2
    play current_chord[0] # to get the first note of the chord
    sleep 1
    play current_chord[4] # to get the 5th note of the chord
    sleep 0.5
    play current_chord[3] # to get the 4th note of the chord
    sleep 0.5
  end
end

live_loop :bass_root do
  use_synth :fm
  use_octave -1 # to play one octave lower.
  play current_chord[0] # to get the first note of the chord
  sleep 1
end

live_loop :nextChord do
  current_chord = progression.tick
  sleep 4 - 0.01 # love love love 4-0.01 to get the live_loop works.
end

live_loop :bd do
  sample :drum_bass_hard
  sleep 1.5
  sample :drum_bass_hard
  sleep 0.5
  sample :drum_bass_hard
  sleep 2
end

live_loop :sn do
  sleep 1
  sample :drum_snare_hard, compress: 1
  sleep 1
end

live_loop :hh do
  8.times do
    sample :drum_cymbal_closed, amp: [0.5, 2, 0.5, 2].tick
    sleep 0.5
  end
end

```

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