# Chord progression tool

**URL:** <https://in-thread.sonic-pi.net/t/chord-progression-tool/4947>\
**Category:** Show your work\
**Created:** [January 9, 2021, 6:03pm UTC](https://in-thread.sonic-pi.net/t/chord-progression-tool/4947 "2021-01-09T18:03:53Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Nechoj](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nechoj/32/1814_2.png) [@Nechoj](https://in-thread.sonic-pi.net/u/Nechoj)\
**Post date:** [February 12, 2021, 5:36pm UTC](https://in-thread.sonic-pi.net/t/chord-progression-tool/4947/11 "2021-02-12T17:36:45Z")

</div>

And here is the example in code. Please have a look at the scales. The first 4 scales belong to key F major, while the last 4 scales belong to key C major. If you want the last 4 scales to belong to key F, you should use:  
D aeolian (instead of D dorian)  
C mixolydian (instead of C ionian)  
G dorian (instead of G mixolydian)  
It is these choices that modulate the key from F to C.

```ruby
use_bpm 70

chords = [chord(:F2, :major7),
          chord(:G2, :minor7),
          chord(:C3, :dom7),
          chord(:F2, :major7),
          chord(:D3, :minor7),
          chord(:C3, :major7),
          chord(:G2, :dom7, inverse: 1),
          chord(:C3, :major7),
          ]

with_synth :piano do
  live_loop :piano do
    play chords.tick, hard: 0.6, sustain: 2, release: 0.5, amp: 1.5
    sleep 2
  end
end

scales = [scale(:F2, :ionian),
          scale(:G2, :dorian),
          scale(:C3, :mixolydian),
          scale(:F2, :ionian),
          scale(:D3, :dorian),
          scale(:C3, :ionian),
          scale(:G2, :mixolydian),
          scale(:C3, :ionian),
          ]

with_synth :pulse do
  live_loop :melody do
    sca = scales.tick
    num_notes = 6
    sca[0, num_notes].each do |n|
      play n, release: 2.0/num_notes, amp: 0.5
      sleep 2.0/num_notes
    end
  end
end

```

---

_[View the full topic](https://in-thread.sonic-pi.net/t/chord-progression-tool/4947)._
