Sha256: 2d67365477ac7e8654eb2b4490be764f10ab96d559d0ef51e8c2d1cf0d5784d1

Contents?: true

Size: 803 Bytes

Versions: 15

Compression:

Stored size: 803 Bytes

Contents

module Coltrane
  module Commands
    class FindProgression < Command
      attr_reader :progression_set

      def initialize(progression_set, **options)
        @progression_set = progression_set
      end

      def representation
        progression_set
      end

      def self.mercenary_init(program)
        program.command(:'find-progression') do |c|
          c.syntax 'find-progression <list of chords>'
          c.description 'Find progressions in scales. Ex: coltrane find-progression AM-DM-F#m-EM'
          c.action do |(chord_notation)|
            chord_notation
            .split('-')
            .yield_self { |chords| Theory::Progression.find(*chords) }
            .yield_self { |progression_set| new(progression_set).render }
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
coltrane-3.4.2 lib/coltrane/commands/find_progression.rb
coltrane-3.4.1 lib/coltrane/commands/find_progression.rb
coltrane-3.4.0 lib/coltrane/commands/find_progression.rb
coltrane-3.3.3 lib/coltrane/commands/find_progression.rb
coltrane-3.3.2 lib/coltrane/commands/find_progression.rb
coltrane-3.3.1 lib/coltrane/commands/find_progression.rb
coltrane-3.3.0 lib/coltrane/commands/find_progression.rb
coltrane-3.2.0 lib/coltrane/commands/find_progression.rb
coltrane-3.1.3 lib/coltrane/commands/find_progression.rb
coltrane-3.1.2 lib/coltrane/commands/find_progression.rb
coltrane-3.1.1 lib/coltrane/commands/find_progression.rb
coltrane-3.1.0 lib/coltrane/commands/find_progression.rb
coltrane-3.0.0 lib/coltrane/commands/find_progression.rb
coltrane-3.0.0.rc1 lib/coltrane/commands/find_progression.rb
coltrane-3.0.0.pre lib/coltrane/commands/find_progression.rb