Class: HeadMusic::Style::Guidelines::AtLeastEightNotes
- Inherits:
-
Annotation
- Object
- Annotation
- HeadMusic::Style::Guidelines::AtLeastEightNotes
show all
- Defined in:
- lib/head_music/style/guidelines/at_least_eight_notes.rb
Overview
Constant Summary
collapse
- MINIMUM_NOTES =
8
- MESSAGE =
"Write at least eight notes."
Instance Method Summary
collapse
Instance Method Details
#deficiency_mark ⇒ Object
24
25
26
27
28
|
# File 'lib/head_music/style/guidelines/at_least_eight_notes.rb', line 24
def deficiency_mark
return unless notes.length < MINIMUM_NOTES
HeadMusic::Style::Mark.for_all(placements, fitness: notes.length.to_f / MINIMUM_NOTES)
end
|
#marks ⇒ Object
10
11
12
|
# File 'lib/head_music/style/guidelines/at_least_eight_notes.rb', line 10
def marks
placements.empty? ? no_placements_mark : deficiency_mark
end
|
#no_placements_mark ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/head_music/style/guidelines/at_least_eight_notes.rb', line 16
def no_placements_mark
HeadMusic::Style::Mark.new(
HeadMusic::Content::Position.new(composition, "1:1"),
HeadMusic::Content::Position.new(composition, "2:1"),
fitness: 0
)
end
|