Sha256: c056fae5e33eef6d59a7be6ff32c283dbacfc476e916730f4d2a329b61d6876e

Contents?: true

Size: 654 Bytes

Versions: 9

Compression:

Stored size: 654 Bytes

Contents

# 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::StartOnPerfectConsonance < HeadMusic::Style::Annotation
  MESSAGE = "Start on the tonic or a perfect consonance above the tonic (unless bass voice)."

  def marks
    return unless first_note && ((bass_voice? && !starts_on_tonic?) || !starts_on_perfect_consonance?)

    HeadMusic::Style::Mark.for(first_note)
  end

  private

  def starts_on_perfect_consonance?
    diatonic_interval_from_tonic(first_note).perfect_consonance?(: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/start_on_perfect_consonance.rb
head_music-7.0.4 lib/head_music/style/guidelines/start_on_perfect_consonance.rb
head_music-7.0.3 lib/head_music/style/guidelines/start_on_perfect_consonance.rb
head_music-7.0.2 lib/head_music/style/guidelines/start_on_perfect_consonance.rb
head_music-7.0.1 lib/head_music/style/guidelines/start_on_perfect_consonance.rb
head_music-7.0.0 lib/head_music/style/guidelines/start_on_perfect_consonance.rb
head_music-6.0.1 lib/head_music/style/guidelines/start_on_perfect_consonance.rb
head_music-6.0.0 lib/head_music/style/guidelines/start_on_perfect_consonance.rb
head_music-5.0.0 lib/head_music/style/guidelines/start_on_perfect_consonance.rb