Chord progression tool

This is impressive. Great work!

Hi @amiika, just discovered that your patch file appends the scales on every run of the piece. Therefore I added some if statements to avoid populating the scales and chords again and again

(EDIT: Code deleted as it was merged with original post above)

Good catch. Btw, would you happen to know how to construct a 6#5 chord? I interpreted it to be raised 5th on a 6th chord … something like [0, 4, 8, 9] … but thats probably wrong.

No that’s ok. Because in the inverted augmented scale you don’t have the maj7 (=11) note and you take the 6 instead in order to get the chord with 4 notes. But then this collides with the #5. I tried to play some versions on the guitar and it sounds best if you take the 6 into the bass, like C6#5 = a-e-#g-c. In other words, use an inverted version. As numbers this looks like [-3, 4, 8, 12]. But you can keep the [0, 4, 8, 9] version if you want maximum dissonance.
EDIT: the [-3, 4, 8, 12]. is basically the same as a minormajor7 chord. So C6#5 inverted = Am major7
EDITEDIT: should read -3 instead of -2

Yes. Thanks. It sounded too dissonant for my taste so I just thought it had to be wrong :sweat_smile:

Hi @amiika a comma is missing in line 60, '6+5'=> [0, 4, 8, 9],

1 Like

Thanks! Added some of that to the craziness to the walking bass also.

1 Like

Just stumbled upon this thread. This is such a great idea musically, and at the same time an elegant implementation programmatically (of course depending on the level of continuous compatibility of Sonic Pi with Ruby :grinning:). Thank you for sharing!

1 Like

Thanks. That was a fun experiment. Also did a monkeypatch for custom scales that is also fun to play with. Hoping something like that gets implemented as a standard feature.

1 Like

I agree, the chords and scales from the scale_patch.rb should be part of the SPi Chord and Scale classes.

1 Like

Taking this patch for custom scales, here is the custom chord version for those who want it:

class SonicPi::Chord
  def initialize(tonic, name, num_octaves=1)
    num_octaves = 1 unless num_octaves
    
    if name.is_a?(Array)
      intervals = name
      name = :custom
    else
      name = name.to_sym
      intervals = CHORD_LOOKUP[name]
    end
    
    raise "Unknown chord name: #{name.inspect}" unless intervals
    
    tonic = Note.resolve_midi_note_without_octave(tonic)
    res = []
    
    num_octaves.times do |o|
      intervals.each do |i|
        res << tonic + i + (o * 12)
      end
    end
    
    @name = name
    @tonic = tonic
    @notes = res
    @num_octaves = num_octaves
    super(res)
  end
end
1 Like