# Relief Composition : Kibō O Ushinatta Toki

**URL:** https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492
**Category:** Creations & Ideas
**Created:** [June 16, 2019, 3:52pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492 "2019-06-16T15:52:44Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [June 16, 2019, 3:52pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/1 "2019-06-16T15:52:44Z")

</div>

```ruby
# Title: 希望を失ったとき (Kibō o ushinatta toki) - When I Lost Hopes
# Artist: Mattia Giovanetti
# Date: 16/06/2019
#
# Sonic Pi v3.1

use_bpm 40
nota = [0,2,4,5,7,9,11,12]

define :voce_uno do
  use_synth :sine
  x = rand_i(8)
  y = nota[x] + 60
  play y, release: 0.75, pan: 0.333, amp: [0,0.25,0,0.5,0.75,0,1].choose
  sleep 0.25
end

define :voce_due do
  use_synth :sine
  x = rand_i(8)
  y = nota[x] + 48
  play y, release: 0.75, pan: 0, amp: [0,0.25,0,0.5,0.75,0,1].choose
  sleep 0.5
end

define :voce_tre do
  use_synth :sine
  x = rand_i(8)
  y = nota[x] + 36
  play y, release: 0.75, pan: -0.333, amp: [0,0.25,0,0.5,0.75,0,1].choose
  sleep 1
end

define :campane_casuali do
  sample :perc_bell, rpitch: [0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3].choose, amp: [0,0.25,0.5].choose
  sleep [0.125,0.25,0.333,0.5,0.666,0.75,1].choose
end

define :tempo_che_passa do
  sample :drum_snare_soft, rpitch: 27, amp: 0.75
  sleep 0.333
  sample :drum_snare_soft, rpitch: 28, amp: 0.7
  sleep 0.333
end

#forma
with_fx :level, amp: 0.25 do
  with_fx :reverb,mix: 0.5, damp: 0.5, room: 0.25 do
    with_fx :level, amp: 0, amp_slide: 75 do |lv|
      in_thread do
        186.times do
          tempo_che_passa
          control lv, amp: 1
        end
      end
    end
  end
  with_fx :reverb,mix: 0.5, damp: 0.5, room: 1 do
    in_thread do
      4.times do
        x = rand_i(8)
        3.times do
          campane_casuali
        end
        sleep 8
        x.times do
          campane_casuali
        end
        sleep 8
        x.times do
          campane_casuali
        end
        sleep 8
        3.times do
          campane_casuali
        end
      end
    end
    with_fx :echo, mix: 0.25, decay: 4 do
      in_thread do
        sleep 1
        x = 0.75
        6.times do
          sample :ambi_lunar_land, amp: x.abs
          sleep 16
          x = x - 0.25
        end
      end
      in_thread do
        sleep 2
        440.times do
          voce_uno
        end
      end
      in_thread do
        sleep 2
        220.times do
          voce_due
        end
      end
      in_thread do
        sleep 2
        110.times do
          voce_tre
        end
      end
    end
  end
end

```

---

<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: [June 16, 2019, 5:21pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/2 "2019-06-16T17:21:12Z")

</div>

Now that is just plain GORGEOUS.

Thank you.

Eli…

---

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [June 16, 2019, 6:46pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/3 "2019-06-16T18:46:10Z")

</div>

Glad you enjoy it, it means a lot to me.

---

<div class="post-metadata">

### Author: ![PiEaterAndPlayer](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@PiEaterAndPlayer](https://in-thread.sonic-pi.net/u/PiEaterAndPlayer)
#### Post date: [June 18, 2019, 8:58am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/4 "2019-06-18T08:58:30Z")

</div>

I really like your choice and usage of sounds here. It’s all very subtle but the sounds all work together so well. I really enjoyed this piece.

ちなみに、日本語が話せますか？

---

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [June 18, 2019, 11:10am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/5 "2019-06-18T11:10:32Z")

</div>

Thank you PiEaterAndPlayer, your words are really precious to me.

私はそれが欲しいのですが、私は単にグーグル翻訳者を使います

---

<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: [June 26, 2019, 9:52pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/6 "2019-06-26T21:52:24Z")

</div>

It’s nice and relaxing, thanks for sharing 🙂

---

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [June 26, 2019, 9:54pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/7 "2019-06-26T21:54:03Z")

</div>

You’re welcome @binarysweets, glad you enjoy it! 😌

---

<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: [June 27, 2019, 9:03am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/8 "2019-06-27T09:03:56Z")

</div>

I hope you don’t mind, but I was playing with your original version last night and came up with another one:

```ruby
# Title: 希望を失ったとき (Kibō o ushinatta toki) - When I Lost Hopes (Binarysweets Version)
# Artist: Mattia Giovanetti
# Date: 16/06/2019
#
# Sonic Pi v3.1

use_bpm 40
use_random_seed 2019
barLength = 16

define :bar do
  sleep barLength
end

define :voce_uno do
  use_synth :sine
  (barLength * 4).times do
    play [:C4, :D4, :E4, :F4, :G4, :A4, :B4, :C5].choose, release: 0.25, pan: 0.333, amp: [0.25,0,0.5,0.75,0,1].choose
    sleep 0.25
  end
end

define :voce_due do
  use_synth :sine
  (barLength / 2).times do
    play [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4].choose, release: 0.5, pan: 0, amp: [0.25,0,0.5,0.75,0,1].choose
    sleep 0.5
  end
end

define :voce_tre do
  use_synth :tri
  (barLength).times do
    play [:C2, :D2, :E2, :F2, :G2, :A2, :B2, :C3].choose, release: 1, pan: -0.333, amp: [0.25,0,0.5,0.75,0,1].choose
    sleep 1
  end
end

define :voce_blade do
  use_synth :blade
  (barLength / 2).times do
    play [:C4, :D4, :E4, :F4, :G4, :A5, :B5, :C5].choose, sustain: 1, release: 2, pan: 0.333, amp: [0.5,0.75,0,1].choose
    sleep 2
  end
end

define :drums do
  s = :loop_breakbeat
  pattern = (ring 1,0,0,0, 2,0,0,1, 1,0,1,0, 3,0,0,0)
  
  (barLength * 4).times do ; tick
    with_swing (line 0.01, 0.05, steps: 8).look, pulse: 4 do
      sample s, slice: 0, num_slices: 32, amp: rrand(4, 4.2) if pattern.look == 1
      sample s, slice: 8, num_slices: 32, amp: rrand(3, 3.2) if pattern.look == 2
      sample s, slice: 8, num_slices: 32, amp: rrand(3, 3.2), rate: 0.95 if pattern.look == 3
    end
    
    sleep 0.25
  end
end

#forma
with_fx :level, amp: 0.25 do
  with_fx :reverb,mix: 0.5, damp: 0.5, room: 1 do
    with_fx :echo, mix: 0.25, decay: 4 do
      in_thread do ; voce_uno ; end
      in_thread do ; voce_due ; end
      bar
      
      in_thread do ; voce_uno ; end
      in_thread do ; voce_due ; end
      in_thread do ; voce_tre ; end
      bar
      
      in_thread do ; voce_uno ; end
      in_thread do ; voce_due ; end
      in_thread do ; voce_tre ; end
      in_thread do ; voce_blade ; end
      in_thread do ; drums ; end
      bar
      
      in_thread do ; voce_uno ; end
      in_thread do ; voce_due ; end
      in_thread do ; voce_tre ; end
      in_thread do ; voce_blade ; end
      in_thread do ; drums ; end
      bar
      
      in_thread do ; voce_blade ; end
      in_thread do ; drums ; end
      bar
    end
  end
end
```

---

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [June 27, 2019, 10:15am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/9 "2019-06-27T10:15:21Z")

</div>

@binarysweets That’s great! I’m really happy and a bit proud. It’s also interesting the use of use\_random\_seed and barLenght, so thank for that, add more knowledge to all (me included!). I’m really corious to listen at your version, in this exct moment I can’t have a listen.

---

<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: [June 27, 2019, 10:36am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/10 "2019-06-27T10:36:24Z")

</div>

Oh! I spelt length wrong, I’m kicking myself…  
It appears I did not - Ignore me.

---

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [June 27, 2019, 10:40am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/11 "2019-06-27T10:40:29Z")

</div>

@binarysweets LOL 😄

---

<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: [July 26, 2019, 7:00am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/12 "2019-07-26T07:00:33Z")

</div>

```ruby
# Title: Ethereal.
# Artist: Just Eli...
# Date: Jul-2019
#
# SonicPi v3.1 (Win 10)

# Settings
use_bpm 40
use_random_seed 79
barLength = 32
scaleName = :dorian
notes = [0,2,4,5,7,9,11,12]

# Loops
define :bar do
  sleep barLength
end

define :beats do
  (barLength).times do
    sample :bd_fat, amp: rrand(0.9, 1)
    sleep 0.5
    sample :elec_hollow_kick if spread(16, 27).tick
    sleep 0.25
    sample :bd_ada, amp: rrand(0.9, 1) if one_in(4)
    sleep 0.25
  end
end

define :hats do
  at [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5] do
    with_fx :reverb, room: 0.95 do
      sample :drum_cymbal_closed, amp: rrand( 0.3, 0.7 )
      if one_in( 3 )
        sleep 0.25
        sample :drum_cymbal_closed, amp: rrand( 0.2, 0.4 )
      end
    end
  end
end

with_fx :level, amp: 0.5 do
  
  with_fx :reverb,mix: 0.5, damp: 0.5, room: 1 do
    with_fx :echo, mix: 0.25, decay: 4 do
      
      live_loop :one do
        use_synth :sine
        x = rand_i(8)
        y = notes[x] + 60
        s = play note: y, release: 0.75, pan: 0.333, amp: [0,0.25,0,0.5,0.75,0,1].choose
        sleep 0.25
        # control s, note: y+12
        sleep 0.25
      end
      
      
      
      live_loop :two do
        use_synth :sine
        x = rand_i(8)
        y = notes[x] + 48
        s = play note: y, release: 0.75, pan: 0, amp: [0,0.25,0,0.5,0.75,0,1].choose
        sleep 0.5
        control s, note: y+[0,12,24].choose
        sleep 0.5
      end
      
      
      live_loop :three do
        use_synth :sine
        x = rand_i(8)
        y = notes[x] + 36
        s = play note: y, release: 0.75, pan: -0.333, amp: [0,0.25,0,0.5,0.75,0,1].choose
        sleep 1
        use_synth :piano
        control s, note: y+24
        sleep 1
      end
      
      
      
      live_loop :four do
        sync :one
        sleep 2
        use_synth :pluck
        x = rand_i(8)
        y = notes[x] + 48
        s = play note: y, attack: 0, sustain: 1, release: 1, pan: -0.333, amp: 0.5+[0,0.25,0,0.5,0.75,0,1].choose
        sleep 0.5
        control s, note: y+[0,12,24].choose
        sleep 0.5
        control s, note: y+[0,12,-12].choose
        sleep 0.75
        control s, note: y+[0,12,24].choose
        sleep 0.25
      end
      
      live_loop :five do
        v= [:blade ,:dark_ambience, :hollow].choose
        y = [:C4, :D4, :E4, :F4, :G4, :A5, :B5, :C5].choose
        use_synth v
        (barLength / 16).times do
          s = play y, sustain: 1, release: 2, pan: 0.333, amp: [0.5,0.75,0.25,1].choose * 1
          sleep 0.5
          control s, note: y+[0,12,24].choose
          sleep 0.5
          control s, note: y+[0,12,-12].choose
          sleep 0.75
          control s, note: y+[0,12,24].choose
          sleep 0.25
        end
      end
      
      
    end
  end
end

live_loop :notes_change do
  sync :bar
  cue :change
end

live_loop :switch_notes do
  sync :change
  switch = [0,1].ring.tick
  if switch == 1 then
    notes = [0,2,4,9,7,5,12,11]
  else
    notes = [12,11,5,7,9,4,2,0]
  end
end

live_loop :do_beats do
  beats
end

live_loop :do_hats do
  hats
  sleep 8
end

```

Eli…

---

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [July 28, 2019, 7:40pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/13 "2019-07-28T19:40:12Z")

</div>

It’s a really good variation, a new piece indeed, I love it, thanks for sharing @Eli, it’s quietness reminds me a calm and sunny afternoon passing by in a quite empty flat, looking the sky line and the clouds while getting more and more yellow and red, but not fall into the night, a perpetual afternoon, a dream of calm, like these perfects moment we all experience in a date period of each our life. Thanks again.

---

<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: [August 26, 2019, 10:30am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/14 "2019-08-26T10:30:10Z")

</div>

I know this thread is kinda complete but I was going through some archived code and  
came across a composition called ‘Clouds’ that was posted some time back.

I’d previously isolated just the background, as it was so very special, and I’d like  
to thank whoever the original poster was, and share this with like-minded people…

I haven’t as yet found the original post, will keep looking.

```ruby
use_bpm 100

# CHORD CONTROL
# This part provides two rings called "chord_high" and "chord_low".
# They always contain the "permitted" notes in order that everything will be in tune.
# You can use them in other live loops to select notes.

chord_1 = chord :c5, :maj9, num_octaves: 2
chord_2 = chord :es4, :maj9, num_octaves: 2
chord_3 = chord :b5, :maj9, num_octaves: 2
chord_4 = chord :d4, :maj9, num_octaves: 2

chord_low_1 = chord :c3, :maj9
chord_low_2 = chord :es2, :maj9
chord_low_3 = chord :b2, :maj9
chord_low_4 = chord :d2, :maj9

chord_high = chord_1
chord_low = chord_low_1

live_loop :chord_selector, delay: -0.5 do
  chord_high = (knit(chord_1, 2, chord_2, 2, chord_3, 4,chord_4, 4)).tick
  chord_low = (knit(chord_low_1, 2, chord_low_2, 2, chord_low_3, 4, chord_low_4, 4)).look
  sleep 8
end

# SPHERES
define :chord_player do |the_chord|
  use_synth [:blade, :prophet].choose
  the_chord.each do |note|
    play note, attack: rand(4), release: rand(6..8), cutoff: rand(50..85), vibrato_rate: rand(0.01..2), amp: 0.55
  end
end

with_fx :reverb, room: 0.99, mix: 0.7 do
  live_loop :chord_loop do
    chord_player chord_high.pick(6)
    chord_player chord_low.take(3)
    sleep 8
  end
end

```

Eli…

---

<div class="post-metadata">

### Author: ![Mattia](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mattia/32/3131_2.png) [@Mattia](https://in-thread.sonic-pi.net/u/Mattia)
#### Post date: [August 27, 2019, 10:46pm UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/15 "2019-08-27T22:46:38Z")

</div>

Wow! This it’s impressive, I really love it, thnks for sharing it. The timbres are dreamlike, and it’s inteesting the idea to use randomly also the instruments. It’s based on live-loop, a thing that I don’t love very much, because for define a piece, according to the classical form configuration of a composition, a form it’s needed. The live-oop it’s like “making jazz”, but also this definition it’s incorrect. A neverending/undefined/unformed opera it’s hard to get (carry within) in mind. It’s for this reason that the live-loop function it’s a logic that I see more in a performance rather then in a composition.

Any way, these are only problems of mine, the patch it’s really cool.  
Nice one @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: [August 28, 2019, 12:15am UTC](https://in-thread.sonic-pi.net/t/relief-composition-kibo-o-ushinatta-toki/2492/16 "2019-08-28T00:15:09Z")

</div>

Hi Mattia,

Possibly the reason you dont like/use live\_loop is because you feel it cannot be controlled ?

With a very simple framework and a couple of defines, you can start and stop the audio output of  
any live loop, allowing you to use it anywhere within a composition.

I posted a simple framework and example a long time ago… I’ll try find the post for you.

Eli…

EDIT: I cant find the post I want but see my comments in these 2 posts, they pretty  
much explain how to use a tracking variable to turn the sound output of a live\_loop  
on and off as you require

> [@TR 808 sequencer](http://in-thread.sonic-pi.net/t/tr-808-sequencer/535):
>
> Hello World! Some simple house beats. I like using a ‘sequencer’ function to control the timing, then pass it a series of Procs which define the tracks, one for each instrument - gives you an easy way to control the timing and also the expression of each beat. Also makes mixing in new instruments a breeze. Note that the kick and snare here are samples, but the hi-hat is a noise synth; wrapping them in functions with the same interface (my\_samp, my\_hat) means you can treat them the same way whe…

> [@A Rainy Night in Bristol](http://in-thread.sonic-pi.net/t/a-rainy-night-in-bristol/659/7):
>
> I usually only post simple tracks… in actual fact you can track just about anything… tracker = [0,0,0] loop\_volume = [0,0,0] note\_duration = [0,0,0] and make defines to set volumes, etc… #Reduce any particular sound loop’s volume define :reduce do |i, n | if loop\_volume[i] - n \> 0 then loop\_volume[i] = loop\_volume[i] - n end end #Increase any particular sound loop’s volume define :increase do |i, n | if loop\_volume[i] + n \< 10 then loop\_volume[i] = loop\_volume[i] + n else end e…
