Class: HeadMusic::Style::Guidelines::StepOutOfUnison
Overview
Instance Method Summary
collapse
Instance Method Details
#leaps_following_unisons ⇒ Object
14
15
16
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 14
def leaps_following_unisons
melodic_note_pairs_following_unisons.select(&:leap?)
end
|
#marks ⇒ Object
6
7
8
9
10
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 6
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
18
19
20
21
22
23
24
25
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 18
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
27
28
29
|
# File 'lib/head_music/style/guidelines/step_out_of_unison.rb', line 27
def perfect_unisons
@perfect_unisons ||= harmonic_intervals.select(&:perfect_consonance?).select(&:unison?)
end
|