Sha256: e201b8d9f521e667b2ab1b15dcf59448f82338795818be86252d1cc56fed4587
Contents?: true
Size: 642 Bytes
Versions: 9
Compression:
Stored size: 642 Bytes
Contents
# Module for style guidelines. module HeadMusic::Style::Guidelines; end # A counterpoint guideline class HeadMusic::Style::Guidelines::NoUnisonsInMiddle < HeadMusic::Style::Annotation MESSAGE = "Unisons may only be used in the first and last note." def marks unison_pairs.map do |notes| HeadMusic::Style::Mark.for_all(notes) end.flatten end private def unison_pairs middle_unisons.map(&:notes).compact end def middle_unisons middle_intervals.select { |interval| interval.perfect_consonance? && interval.unison? } end def middle_intervals [harmonic_intervals[1..-2]].flatten.compact end end
Version data entries
9 entries across 9 versions & 1 rubygems