Sha256: a40cdb0b6e2579e7b36ec61abe26ec1df46ab77ed4cba8f17fab748f6237e573

Contents?: true

Size: 539 Bytes

Versions: 2

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 first 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

2 entries across 2 versions & 1 rubygems

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