Class: HeadMusic::Style::Guidelines::WeakBeatDissonanceTreatment
- Inherits:
-
HeadMusic::Style::Guideline
- Object
- HeadMusic::Style::Guideline
- HeadMusic::Style::Guidelines::WeakBeatDissonanceTreatment
- Includes:
- DissonanceFigureDetection
- Defined in:
- lib/head_music/style/guidelines/weak_beat_dissonance_treatment.rb
Overview
A counterpoint guideline
Direct Known Subclasses
SecondSpeciesBreak, ThirdSpeciesDissonanceTreatment, TripleMeterDissonanceTreatment
Instance Method Summary collapse
-
#all_consonant_with_cantus?(*checked_notes) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#cambiata_as_note_2?(index) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#cambiata_dissonance?(note) ⇒ Boolean
included
from DissonanceFigureDetection
private
Nota cambiata: a five-note figure where note 2 is dissonant, approached by step from note 1, leaps a third in the same direction to note 3, then notes 3-4-5 proceed stepwise in the opposite direction.
-
#cambiata_shape?(n1, n2, n3, n4, n5) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#cantus_firmus_positions ⇒ Object
included
from DissonanceFigureDetection
private
-
#consonant_with_cantus?(note) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#dissonant_weak_beat_notes ⇒ Object
private
-
#dissonant_with_cantus?(note) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#double_neighbor_figure?(index, offset:) ⇒ Boolean
included
from DissonanceFigureDetection
private
Double neighbor: a four-note figure within one bar.
-
#double_neighbor_member?(note) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#double_neighbor_shape?(n1, n2, n3, n4) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#downbeat_position?(position) ⇒ Boolean
private
-
#marks ⇒ Object
-
#melodic_interval_between(note1, note2) ⇒ Object
included
from DissonanceFigureDetection
private
-
#neighbor_tone?(note) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#passing_tone?(note) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#recognized_figure?(note) ⇒ Boolean
private
-
#steps_back_from?(leap, step_back_1, step_back_2) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#stepwise_figure?(note, same_direction:) ⇒ Boolean
included
from DissonanceFigureDetection
private
-
#weak_beat_notes ⇒ Object
private
Constructor Details
This class inherits a constructor from HeadMusic::Style::Guideline
Instance Method Details
#all_consonant_with_cantus?(*checked_notes) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#cambiata_as_note_2?(index) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#cambiata_dissonance?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
Nota cambiata: a five-note figure where note 2 is dissonant, approached by step from note 1, leaps a third in the same direction to note 3, then notes 3-4-5 proceed stepwise in the opposite direction. Notes 1, 3, and 5 must be consonant with the CF.
#cambiata_shape?(n1, n2, n3, n4, n5) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#cantus_firmus_positions ⇒ Object (private) Originally defined in module DissonanceFigureDetection
#consonant_with_cantus?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#dissonant_weak_beat_notes ⇒ Object (private)
22 23 24 |
# File 'lib/head_music/style/guidelines/weak_beat_dissonance_treatment.rb', line 22 def dissonant_weak_beat_notes weak_beat_notes.select { |note| dissonant_with_cantus?(note) } end |
#dissonant_with_cantus?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#double_neighbor_figure?(index, offset:) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
Double neighbor: a four-note figure within one bar. Beats 1 and 4 are the same pitch (consonant), beats 2 and 3 are upper and lower neighbors connected by a leap of a third.
#double_neighbor_member?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#double_neighbor_shape?(n1, n2, n3, n4) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#downbeat_position?(position) ⇒ Boolean (private)
30 31 32 |
# File 'lib/head_music/style/guidelines/weak_beat_dissonance_treatment.rb', line 30 def downbeat_position?(position) cantus_firmus_positions.include?(position.to_s) end |
#marks ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/head_music/style/guidelines/weak_beat_dissonance_treatment.rb', line 8 def marks return [] unless cantus_firmus&.notes&.any? dissonant_weak_beat_notes.reject { |note| recognized_figure?(note) }.map do |note| HeadMusic::Style::Mark.for(note) end end |
#melodic_interval_between(note1, note2) ⇒ Object (private) Originally defined in module DissonanceFigureDetection
#neighbor_tone?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#passing_tone?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#recognized_figure?(note) ⇒ Boolean (private)
18 19 20 |
# File 'lib/head_music/style/guidelines/weak_beat_dissonance_treatment.rb', line 18 def recognized_figure?(note) passing_tone?(note) end |
#steps_back_from?(leap, step_back_1, step_back_2) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#stepwise_figure?(note, same_direction:) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection
#weak_beat_notes ⇒ Object (private)
26 27 28 |
# File 'lib/head_music/style/guidelines/weak_beat_dissonance_treatment.rb', line 26 def weak_beat_notes notes.reject { |note| downbeat_position?(note.position) } end |