Sha256: 875930e6cb119381366b284ebf370cc5d9a9d64058f04a2171660ee88afc1183

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

module HeadMusic::Style::Annotations
end

class HeadMusic::Style::Annotations::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

2 entries across 2 versions & 1 rubygems

Version Path
head_music-0.17.0 lib/head_music/style/annotations/consonant_downbeats.rb
head_music-0.16.2 lib/head_music/style/annotations/consonant_downbeats.rb