Sha256: 437db8f645abf1d7d066ffd7b97c50f71f82a5935c6b4bed4988a0d6b3754386

Contents?: true

Size: 526 Bytes

Versions: 18

Compression:

Stored size: 526 Bytes

Contents

# frozen_string_literal: true

# Module for style guidelines.
module HeadMusic::Style::Guidelines; end

# A counterpoint guideline: Use a maximum of one octave leap.
class HeadMusic::Style::Guidelines::LimitOctaveLeaps < HeadMusic::Style::Annotation
  MESSAGE = 'Use a maximum of one octave leap.'

  def marks
    return if octave_leaps.length <= 1

    octave_leaps.map do |leap|
      HeadMusic::Style::Mark.for_all(leap.notes)
    end
  end

  private

  def octave_leaps
    melodic_intervals.select(&:octave?)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
head_music-0.27.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.26.3 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.26.2 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.26.1 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.26.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.25.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.24.5 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.24.4 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.24.3 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.24.2 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.24.1 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.24.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.23.4 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.23.3 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.23.2 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.23.1 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.23.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.22.0 lib/head_music/style/guidelines/limit_octave_leaps.rb