Class: HeadMusic::Style::Guidelines::PrepareOctaveLeaps
- Inherits:
-
Annotation
- Object
- Annotation
- HeadMusic::Style::Guidelines::PrepareOctaveLeaps
show all
- Defined in:
- lib/head_music/style/guidelines/prepare_octave_leaps.rb
Overview
Constant Summary
collapse
- MESSAGE =
"Enter and exit an octave leap from within."
Instance Method Summary
collapse
Instance Method Details
#external_entries ⇒ Object
32
33
34
35
36
37
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 32
def external_entries
melodic_note_pairs.each_cons(2).map do |pair|
first, second = *pair
pair.map(&:notes).flatten.uniq if second.octave? && !second.spans?(first.pitches.first)
end.compact
end
|
#external_entries_marks ⇒ Object
14
15
16
17
18
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 14
def external_entries_marks
external_entries.map do |trouble_spot|
HeadMusic::Style::Mark.for_all(trouble_spot)
end
end
|
#external_exits ⇒ Object
39
40
41
42
43
44
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 39
def external_exits
melodic_note_pairs.each_cons(2).map do |pair|
first, second = *pair
pair.map(&:notes).flatten.uniq if first.octave? && !first.spans?(second.pitches.last)
end.compact
end
|
#external_exits_marks ⇒ Object
20
21
22
23
24
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 20
def external_exits_marks
external_exits.map do |trouble_spot|
HeadMusic::Style::Mark.for_all(trouble_spot)
end
end
|
#marks ⇒ Object
8
9
10
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 8
def marks
external_entries_marks + external_exits_marks + octave_ending_marks
end
|
#octave_ending ⇒ Object
46
47
48
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 46
def octave_ending
octave_ending? ? melodic_note_pairs.last.notes : []
end
|
#octave_ending? ⇒ Boolean
50
51
52
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 50
def octave_ending?
melodic_note_pairs.last&.octave?
end
|
#octave_ending_marks ⇒ Object
26
27
28
29
30
|
# File 'lib/head_music/style/guidelines/prepare_octave_leaps.rb', line 26
def octave_ending_marks
return [] unless octave_ending?
[HeadMusic::Style::Mark.for_all(octave_ending)]
end
|