Class: HeadMusic::Style::Guidelines::StepToFinalNote

Inherits:
Annotation
  • Object
show all
Defined in:
lib/head_music/style/guidelines/step_to_final_note.rb

Overview

A counterpoint guideline

Constant Summary collapse

MESSAGE =
"Step to the final note."

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from HeadMusic::Style::Annotation

Instance Method Details

#last_melodic_intervalObject (private)



18
19
20
# File 'lib/head_music/style/guidelines/step_to_final_note.rb', line 18

def last_melodic_interval
  @last_melodic_interval ||= melodic_intervals.last
end

#marksObject



8
9
10
# File 'lib/head_music/style/guidelines/step_to_final_note.rb', line 8

def marks
  HeadMusic::Style::Mark.for_all(notes[-2..]) unless step_to_final_note?
end

#step_to_final_note?Boolean (private)

Returns:

  • (Boolean)


14
15
16
# File 'lib/head_music/style/guidelines/step_to_final_note.rb', line 14

def step_to_final_note?
  last_melodic_interval&.step?
end