Class: HeadMusic::Style::Guidelines::StartOnPerfectConsonance

Inherits:
Annotation
  • Object
show all
Defined in:
lib/head_music/style/guidelines/start_on_perfect_consonance.rb

Overview

marks the voice if the first note is not the first or fifth scale degree of the key.

Constant Summary collapse

MESSAGE =
"Start on the tonic or a perfect consonance above the tonic (unless bass voice)."

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from HeadMusic::Style::Annotation

Instance Method Details

#marksObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/head_music/style/guidelines/start_on_perfect_consonance.rb', line 8

def marks
  return unless first_note

  needs_marking = if bass_voice?
    !starts_on_tonic?
  else
    !starts_on_perfect_consonance?
  end

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

#starts_on_perfect_consonance?Boolean (private)

Returns:

  • (Boolean)


22
23
24
# File 'lib/head_music/style/guidelines/start_on_perfect_consonance.rb', line 22

def starts_on_perfect_consonance?
  diatonic_interval_from_tonic(first_note).perfect_consonance?(:two_part_harmony)
end