Class: HeadMusic::Style::Guidelines::StepOutOfUnison
- Inherits:
-
Annotation
- Object
- Annotation
- HeadMusic::Style::Guidelines::StepOutOfUnison
show all
- Defined in:
- lib/head_music/style/guidelines/step_out_of_unison.rb
Overview
Constant Summary
collapse
- MESSAGE =
"Exit a unison by step."
Instance Method Summary
collapse
Instance Method Details
#leaps_following_unisons ⇒ Object
16
17
18
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 16
def leaps_following_unisons
melodic_note_pairs_following_unisons.select(&:leap?)
end
|
#marks ⇒ Object
8
9
10
11
12
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 8
def marks
leaps_following_unisons.map do |note_pair|
HeadMusic::Style::Mark.for_all(note_pair.notes)
end.flatten
end
|
#melodic_note_pairs_following_unisons ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 20
def melodic_note_pairs_following_unisons
@melodic_note_pairs_following_unisons ||=
perfect_unisons.map do |unison|
note1 = voice.note_at(unison.position)
note2 = voice.note_following(unison.position)
HeadMusic::Content::Voice::MelodicNotePair.new(note1, note2) if note1 && note2
end.compact
end
|
#perfect_unisons ⇒ Object
29
30
31
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 29
def perfect_unisons
@perfect_unisons ||= harmonic_intervals.select(&:perfect_consonance?).select(&:unison?)
end
|