Sha256: 448f65af8261cb8faf016ec4d4201a24a19f149a29c319fa6a8d11c49caf85f4

Contents?: true

Size: 600 Bytes

Versions: 9

Compression:

Stored size: 600 Bytes

Contents

# 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-7.0.5 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-7.0.4 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-7.0.3 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-7.0.2 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-7.0.1 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-7.0.0 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-6.0.1 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-6.0.0 lib/head_music/style/guidelines/consonant_downbeats.rb
head_music-5.0.0 lib/head_music/style/guidelines/consonant_downbeats.rb