Class: HeadMusic::Style::Guidelines::AllowedRhythmicValuesForCombined234
- Inherits:
-
Annotation
- Object
- Annotation
- HeadMusic::Style::Guidelines::AllowedRhythmicValuesForCombined234
show all
- Defined in:
- lib/head_music/style/guidelines/allowed_rhythmic_values_for_combined234.rb
Overview
Validates that counterpoint notes use only half notes, quarter notes, and tied notes.
No whole notes filling an entire bar from beat 1.
Appropriate for combined second, third, and fourth species counterpoint.
Constant Summary
collapse
- MESSAGE =
"Use only half notes, quarter notes, and tied notes. Avoid whole notes on beat 1."
Instance Method Summary
collapse
Instance Method Details
#marks ⇒ Object
10
11
12
|
# File 'lib/head_music/style/guidelines/allowed_rhythmic_values_for_combined234.rb', line 10
def marks
violating_notes.map { |note| HeadMusic::Style::Mark.for(note) }
end
|
#violating_notes ⇒ Object
16
17
18
|
# File 'lib/head_music/style/guidelines/allowed_rhythmic_values_for_combined234.rb', line 16
def violating_notes
notes.select { |note| whole_note_on_downbeat?(note) }
end
|
#whole_note_on_downbeat?(note) ⇒ Boolean
20
21
22
|
# File 'lib/head_music/style/guidelines/allowed_rhythmic_values_for_combined234.rb', line 20
def whole_note_on_downbeat?(note)
note.rhythmic_value.total_value >= 1.0 && note.position.count == 1
end
|