Class: HeadMusic::Style::Guidelines::FloridDissonanceTreatment

Inherits:
HeadMusic::Style::Guideline show all
Includes:
DissonanceFigureDetection
Defined in:
lib/head_music/style/guidelines/florid_dissonance_treatment.rb

Overview

Unified dissonance handling for mixed-species (florid) contexts. - Strong beat dissonances must be properly prepared suspensions from a tie. - Weak beat dissonances must be passing tones, neighbor tones, nota cambiata, or double neighbor figures. - Tied notes dissonant at the new CF note must resolve by step to a consonance.

Instance Method Summary collapse

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

Returns:

  • (Boolean)

#cambiata_as_note_2?(index) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#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.

Returns:

  • (Boolean)

#cambiata_shape?(n1, n2, n3, n4, n5) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#cantus_firmus_positionsObject (private) Originally defined in module DissonanceFigureDetection

#consonant_with_cantus?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#current_cf_note_at(position) ⇒ Object (private)



56
57
58
# File 'lib/head_music/style/guidelines/florid_dissonance_treatment.rb', line 56

def current_cf_note_at(position)
  cantus_firmus.note_at(position)
end

#dissonant_with_cantus?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#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.

Returns:

  • (Boolean)

#double_neighbor_member?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#double_neighbor_shape?(n1, n2, n3, n4) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#improperly_treated_notesObject (private)



19
20
21
# File 'lib/head_music/style/guidelines/florid_dissonance_treatment.rb', line 19

def improperly_treated_notes
  notes.select { |note| dissonant_with_cantus?(note) && !properly_treated?(note) }
end

#marksObject



11
12
13
14
15
# File 'lib/head_music/style/guidelines/florid_dissonance_treatment.rb', line 11

def marks
  return [] unless cantus_firmus&.notes&.any?

  improperly_treated_notes.map { |note| HeadMusic::Style::Mark.for(note) }
end

#melodic_interval_between(note1, note2) ⇒ Object (private) Originally defined in module DissonanceFigureDetection

#neighbor_tone?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#on_strong_beat?(note) ⇒ Boolean (private)

Returns:

  • (Boolean)


52
53
54
# File 'lib/head_music/style/guidelines/florid_dissonance_treatment.rb', line 52

def on_strong_beat?(note)
  cantus_firmus_positions.include?(note.position.to_s)
end

#passing_tone?(note) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#properly_treated?(note) ⇒ Boolean (private)

Returns:

  • (Boolean)


23
24
25
26
27
28
29
30
# File 'lib/head_music/style/guidelines/florid_dissonance_treatment.rb', line 23

def properly_treated?(note)
  if on_strong_beat?(note)
    properly_treated_suspension?(note)
  else
    passing_tone?(note) || neighbor_tone?(note) ||
      cambiata_dissonance?(note) || double_neighbor_member?(note)
  end
end

#properly_treated_suspension?(note) ⇒ Boolean (private)

A note on a strong beat that is dissonant must be a tied suspension (its position is before the CF note position, meaning it was held over).

Returns:

  • (Boolean)


34
35
36
37
38
39
40
# File 'lib/head_music/style/guidelines/florid_dissonance_treatment.rb', line 34

def properly_treated_suspension?(note)
  cf_note = current_cf_note_at(note.position)
  return false unless cf_note

  # The CP note must have started before the CF note (tied over)
  note.position < cf_note.position && resolved_by_step?(note)
end

#resolved_by_step?(note) ⇒ Boolean (private)

Returns:

  • (Boolean)


42
43
44
45
46
47
48
49
50
# File 'lib/head_music/style/guidelines/florid_dissonance_treatment.rb', line 42

def resolved_by_step?(note)
  next_cp = following_note(note)
  return false unless next_cp

  melodic = melodic_interval_between(note, next_cp)
  return false unless melodic.step?

  consonant_with_cantus?(next_cp)
end

#steps_back_from?(leap, step_back_1, step_back_2) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)

#stepwise_figure?(note, same_direction:) ⇒ Boolean (private) Originally defined in module DissonanceFigureDetection

Returns:

  • (Boolean)