Class: HeadMusic::Style::Guidelines::AvoidCrossingVoices
Overview
Instance Method Summary
collapse
Instance Method Details
#crossings ⇒ Object
14
15
16
17
18
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 14
def crossings
harmonic_intervals.select do |harmonic_interval|
harmonic_interval.pitch_orientation && harmonic_interval.pitch_orientation != predominant_pitch_orientation
end
end
|
#marks ⇒ Object
6
7
8
9
10
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 6
def marks
crossings.map do |crossing|
HeadMusic::Style::Mark.for_all(crossing.notes)
end
end
|
#pitch_orientations ⇒ Object
28
29
30
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 28
def pitch_orientations
harmonic_intervals.map(&:pitch_orientation).compact.uniq
end
|
#predominant_pitch_orientation ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/head_music/style/guidelines/avoid_crossing_voices.rb', line 20
def predominant_pitch_orientation
pitch_orientations
.compact
.group_by { |orientation| orientation }
.max { |a, b| a[1].length <=> b[1].length }
.first
end
|