Class: HeadMusic::Style::Guidelines::MixedRhythmicValues

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

Overview

Checks that the voice uses at least 2 different rhythmic value durations. For full fifth species counterpoint.

Constant Summary collapse

MESSAGE =
"Use a variety of rhythmic values for an expressive florid line."

Instance Method Summary collapse

Constructor Details

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

Instance Method Details

#distinct_durations_countObject (private)



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

def distinct_durations_count
  notes.map { |note| note.rhythmic_value.total_value }.uniq.length
end

#marksObject



9
10
11
12
13
14
# File 'lib/head_music/style/guidelines/mixed_rhythmic_values.rb', line 9

def marks
  return [] if notes.length < 2
  return [] if distinct_durations_count >= 2

  [HeadMusic::Style::Mark.for(notes.first)]
end