Sha256: 6cf0fcd47ae98dc7f6761271789f9bfc367cb9c7134de01a5a7afe625ac9db3b

Contents?: true

Size: 586 Bytes

Versions: 4

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

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

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

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

  private

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
head_music-0.22.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-0.20.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-0.19.2 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-0.19.1 lib/head_music/style/guidelines/end_on_perfect_consonance.rb