# Melody improvisation

**URL:** <https://in-thread.sonic-pi.net/t/melody-improvisation/988>\
**Category:** Creations & Ideas\
**Created:** [April 19, 2018, 5:03am UTC](https://in-thread.sonic-pi.net/t/melody-improvisation/988 "2018-04-19T05:03:07Z")\
**Posts on this page:** 1\
**Showing post:** 19

<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:** [May 1, 2018, 5:47pm UTC](https://in-thread.sonic-pi.net/t/melody-improvisation/988/19 "2018-05-01T17:47:14Z")

</div>

> [@EarthToAbigail](#):
>
> Another idea I had was to try and write something that would use middle eastern scales (using quarter notes).

> [@Temple Of The Sixth: Dark Eastern Ambient Music](http://in-thread.sonic-pi.net/t/temple-of-the-sixth-dark-eastern-ambient-music/155):
>
> A classic @NanoMan performance slight_smile Enjoy… youtu.be/Kf-M5djhuYY

SampleRadar has a whole pack of ‘Eastern’ drums and instruments, which slice nicely into your own  
home grown Eastern beats.

> **[Free music samples: download loops, hits and multis from SampleRadar](https://www.musicradar.com/news/tech/free-music-samples-royalty-free-loops-hits-and-multis-to-download)**
>
> 90,288 free music sample downloads

Or just with the built-in samples…

```ruby
## Eastern pluck
## Coded by Nanomancer
## Modifications by Eli. April 2018.

set_volume! 0.55
set_mixer_control! amp: 0.1, amp_slide: 0.1
sleep 1
set_mixer_control! amp: 5, amp_slide: 12
use_bpm 90

seeds = [1024,2048,3072,4096,5120,6144,7168,8192,9212,512].ring
use_random_seed 999
vol=0.3

live_loop :low_boom, delay: 8 do
  sample :bd_boom, rate: 0.75, amp: 1
  sleep [7,1,8].ring.tick
end

live_loop :drums do
  use_bpm 45
  this_sample = [:loop_compus, :loop_tabla, :loop_safari].ring
  start = [0.0 , 0.125 , 0.25 , 0.375 , 0.5 , 0.625 , 0.75 , 0.875].ring
  sample this_sample.look , beat_stretch: 4, start: start.look, rate: 0.5
  sleep 1
  tick
end

live_loop :eastern_twang do |idx|
  use_synth :pluck
  if rand() > 0.75 then
    seeds = [1024,2048,3072,4096,5120,6144,7168,8192,9212,512].ring
  else
    seeds =seeds.shuffle
  end
  with_random_seed seeds[idx] do
    notes = scale(:a3, :harmonic_minor, num_octaves: dice(2)).pick(4)
    multi = [0.5,1,1.5,2].choose
    cut = range(50, 130, step: 2.5).mirror.ring
    slp = [1,1.5,0.5,1].ring
    
    if multi == 0.5 || multi == 1 then
      reps = 16
    else
      reps = 8
    end
    
    with_fx :echo, mix: 0.4, phase: 2, max_phase: 4 do
      with_fx :reverb, mix: 0.65, room: 0.85 do
        reps.times do
          play notes.tick, amp: vol*rdist(0.09, 1),
            cutoff: rdist(15, 115), pitch: rdist(0.1, 0)
          sleep slp.look*multi
        end
      end
    end
    
    if one_in(3) then
      sleep 8
    end
    
    idx+=1
  end
end

```

Eli…

---

_[View the full topic](https://in-thread.sonic-pi.net/t/melody-improvisation/988)._
