Sha256: a181a9e1e1cbfd5334be6a886d1bfb7ea60f8ce9adfb2fd5f03f2400cb08b71b

Contents?: true

Size: 539 Bytes

Versions: 8

Compression:

Stored size: 539 Bytes

Contents

module HeadMusic::Style::Annotations
end

# marks the voice if the first note is not the first or fifth scale degree of the key.
class HeadMusic::Style::Annotations::EndOnPerfectConsonance < HeadMusic::Style::Annotation
  MESSAGE = 'End on the tonic or the fifth scale degree.'

  def marks
    if last_note && !ends_on_perfect_consonance?
      HeadMusic::Style::Mark.for(last_note)
    end
  end

  private

  def ends_on_perfect_consonance?
    functional_interval_from_tonic(last_note).perfect_consonance?(:two_part_harmony)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
head_music-0.16.0 lib/head_music/style/annotations/end_on_perfect_consonance.rb
head_music-0.14.8 lib/head_music/style/annotations/end_on_perfect_consonance.rb
head_music-0.14.7 lib/head_music/style/annotations/end_on_perfect_consonance.rb
head_music-0.14.5 lib/head_music/style/annotations/end_on_perfect_consonance.rb
head_music-0.14.4 lib/head_music/style/annotations/end_on_perfect_consonance.rb
head_music-0.14.2 lib/head_music/style/annotations/end_on_perfect_consonance.rb
head_music-0.14.1 lib/head_music/style/annotations/end_on_perfect_consonance.rb
head_music-0.13.2 lib/head_music/style/annotations/end_on_perfect_consonance.rb