Sha256: ee5305b40ad147ca9a0c120467ba815d2a5a68e0c2c7b6abbbfaa5e8d44f66bd

Contents?: true

Size: 495 Bytes

Versions: 9

Compression:

Stored size: 495 Bytes

Contents

# 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

9 entries across 9 versions & 1 rubygems

Version Path
head_music-7.0.5 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-7.0.4 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-7.0.3 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-7.0.2 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-7.0.1 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-7.0.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-6.0.1 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-6.0.0 lib/head_music/style/guidelines/limit_octave_leaps.rb
head_music-5.0.0 lib/head_music/style/guidelines/limit_octave_leaps.rb