Sha256: bd4feb4c9cdbab437da9bd96b23648de357ef592181789a05e853004bdaef0ea

Contents?: true

Size: 584 Bytes

Versions: 9

Compression:

Stored size: 584 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?
    diatonic_interval_from_tonic(last_note).perfect_consonance?(:two_part_harmony)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
head_music-4.0.1 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-4.0.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-3.0.1 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-3.0.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-2.0.1 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-2.0.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-1.0.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-0.29.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb
head_music-0.28.0 lib/head_music/style/guidelines/end_on_perfect_consonance.rb