Sha256: e80c3c41a6421f4e0455044168b495be97ea0526fcfd96015c8dd2ebe9acb4c3

Contents?: true

Size: 631 Bytes

Versions: 9

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

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

# A counterpoint guideline
class HeadMusic::Style::Guidelines::ConsonantDownbeats < HeadMusic::Style::Annotation
  MESSAGE = "Use consonant harmonic intervals on every downbeat."

  def marks
    dissonant_pairs.map do |dissonant_pair|
      HeadMusic::Style::Mark.for_all(dissonant_pair)
    end.flatten
  end

  private

  def dissonant_pairs
    dissonant_intervals.map(&:notes).compact
  end

  def dissonant_intervals
    downbeat_harmonic_intervals.select { |interval| interval.dissonance?(:two_part_harmony) }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
head_music-4.0.1 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-4.0.0 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-3.0.1 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-3.0.0 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-2.0.1 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-2.0.0 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-1.0.0 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-0.29.0 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-0.28.0 lib/head_music/style/guidelines/consonant_downbeats.rb