Sha256: 1af5702f7c8339d2e4f27ea467bd5e6da3bb5d5308b4c32b2ba6b91d702d092c
Contents?: true
Size: 917 Bytes
Versions: 2
Compression:
Stored size: 917 Bytes
Contents
# frozen_string_literal: true # Module for Annotations. module HeadMusic::Style::Annotations; end # A counterpoint guideline class HeadMusic::Style::Annotations::StepOutOfUnison < HeadMusic::Style::Annotation MESSAGE = 'Exit a unison by step.' def marks leaps_following_unisons.map do |skip| HeadMusic::Style::Mark.for_all(skip.notes) end.flatten end private def leaps_following_unisons melodic_intervals_following_unisons.select(&:leap?) end def melodic_intervals_following_unisons @melodic_intervals_following_unisons ||= perfect_unisons.map do |unison| note1 = voice.note_at(unison.position) note2 = voice.note_following(unison.position) HeadMusic::MelodicInterval.new(note1, note2) if note1 && note2 end.compact end def perfect_unisons @unisons ||= harmonic_intervals.select(&:perfect_consonance?).select(&:unison?) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
head_music-0.19.0 | lib/head_music/style/annotations/step_out_of_unison.rb |
head_music-0.18.0 | lib/head_music/style/annotations/step_out_of_unison.rb |