Sha256: 2b5bc4e55b10f8567a1adcce75fa9fc2e17ca7c9f3264de2fc27e608d98cbf7d

Contents?: true

Size: 525 Bytes

Versions: 3

Compression:

Stored size: 525 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

3 entries across 3 versions & 1 rubygems

Version Path
head_music-0.20.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.19.2 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-0.19.1 lib/head_music/style/guidelines/limit_octave_leaps.rb