Class: HeadMusic::Style::Guidelines::NoStrongBeatUnisons

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

Overview

A counterpoint guideline

Constant Summary collapse

MESSAGE =
"Avoid unisons on strong beats except at the beginning and end."

Instance Method Summary collapse

Constructor Details

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

Instance Method Details

#interior_downbeat_intervalsObject (private)



20
21
22
23
24
# File 'lib/head_music/style/guidelines/no_strong_beat_unisons.rb', line 20

def interior_downbeat_intervals
  return [] if downbeat_harmonic_intervals.length < 3

  downbeat_harmonic_intervals[1..-2]
end

#interior_downbeat_unisonsObject (private)



16
17
18
# File 'lib/head_music/style/guidelines/no_strong_beat_unisons.rb', line 16

def interior_downbeat_unisons
  interior_downbeat_intervals.select { |interval| interval.perfect_consonance? && interval.unison? }
end

#marksObject



8
9
10
11
12
# File 'lib/head_music/style/guidelines/no_strong_beat_unisons.rb', line 8

def marks
  interior_downbeat_unisons.map do |interval|
    HeadMusic::Style::Mark.for_all(interval.notes)
  end
end