Class: HeadMusic::Style::Guidelines::MinimumMelodicIntervals
Overview
Flags a melody with fewer than the required number of moving melodic intervals.
Repeated-note pairs don’t count as motion, so an all-repeated-note line gates to 0.
Configure the threshold with the factory, e.g. MinimumMelodicIntervals.with(2).
Instance Method Summary
collapse
Instance Method Details
#actual_count ⇒ Object
30
31
32
|
# File 'lib/head_music/style/guidelines/minimum_melodic_intervals.rb', line 30
def actual_count
moving_intervals.length
end
|
#marks ⇒ Object
8
9
10
11
12
|
# File 'lib/head_music/style/guidelines/minimum_melodic_intervals.rb', line 8
def marks
return no_motion_mark if moving_intervals.empty?
deficiency_mark
end
|
#message ⇒ Object
14
15
16
|
# File 'lib/head_music/style/guidelines/minimum_melodic_intervals.rb', line 14
def message
"Write at least #{minimum.humanize} melodic intervals."
end
|
#moving_intervals ⇒ Object
20
21
22
|
# File 'lib/head_music/style/guidelines/minimum_melodic_intervals.rb', line 20
def moving_intervals
melodic_intervals.select(&:moving?)
end
|
#no_motion_mark ⇒ Object
24
25
26
27
28
|
# File 'lib/head_music/style/guidelines/minimum_melodic_intervals.rb', line 24
def no_motion_mark
return no_placements_mark if placements.empty?
HeadMusic::Style::Mark.for_all(placements, fitness: 0)
end
|