Class: HeadMusic::Style::Guidelines::NoParallelPerfectWithSyncopation
- Inherits:
-
Annotation
- Object
- Annotation
- HeadMusic::Style::Guidelines::NoParallelPerfectWithSyncopation
show all
- Defined in:
- lib/head_music/style/guidelines/no_parallel_perfect_with_syncopation.rb
Overview
Constant Summary
collapse
- MESSAGE =
"Avoid parallel perfect consonances between syncopated notes."
Instance Method Summary
collapse
Instance Method Details
#marks ⇒ Object
8
9
10
11
12
|
# File 'lib/head_music/style/guidelines/no_parallel_perfect_with_syncopation.rb', line 8
def marks
parallel_perfect_syncopation_pairs.map do |pair|
HeadMusic::Style::Mark.for_all(pair.flat_map(&:notes))
end
end
|
#parallel_perfect_syncopation_pairs ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/head_music/style/guidelines/no_parallel_perfect_with_syncopation.rb', line 16
def parallel_perfect_syncopation_pairs
harmonic_intervals.each_cons(2).select do |first, second|
first.perfect_consonance?(:two_part_harmony) &&
second.perfect_consonance?(:two_part_harmony) &&
same_simple_type?(first, second)
end
end
|
#same_simple_type?(first, second) ⇒ Boolean
24
25
26
|
# File 'lib/head_music/style/guidelines/no_parallel_perfect_with_syncopation.rb', line 24
def same_simple_type?(first, second)
first.simple_number == second.simple_number
end
|