Class: HeadMusic::Style::Guidelines::AvoidCrossingVoices
- Inherits:
-
Annotation
- Object
- Annotation
- HeadMusic::Style::Guidelines::AvoidCrossingVoices
show all
- Defined in:
- lib/head_music/style/guidelines/avoid_crossing_voices.rb
Overview
Constant Summary
collapse
- MESSAGE =
"Avoid crossing voices. Maintain the high-low relationship between voices."
Instance Method Summary
collapse
Instance Method Details
#crossings ⇒ Object
16
17
18
19
20
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 16
def crossings
harmonic_intervals.select do |harmonic_interval|
harmonic_interval.pitch_orientation && harmonic_interval.pitch_orientation != predominant_pitch_orientation
end
end
|
#marks ⇒ Object
8
9
10
11
12
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 8
def marks
crossings.map do |crossing|
HeadMusic::Style::Mark.for_all(crossing.notes)
end
end
|
#pitch_orientations ⇒ Object
30
31
32
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 30
def pitch_orientations
harmonic_intervals.map(&:pitch_orientation).compact.uniq
end
|
#predominant_pitch_orientation ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 22
def predominant_pitch_orientation
pitch_orientations
.compact
.group_by { |orientation| orientation }
.max { |a, b| a[1].length <=> b[1].length }
.first
end
|