class HeadMusic::Style::Guidelines::Diatonic

A counterpoint guideline

Constants

MESSAGE

Public Instance Methods

marks() click to toggle source
# File lib/head_music/style/guidelines/diatonic.rb, line 10
def marks
  HeadMusic::Style::Mark.for_each(notes_not_in_key_excluding_penultimate_leading_tone)
end

Private Instance Methods

notes_not_in_key_excluding_penultimate_leading_tone() click to toggle source
# File lib/head_music/style/guidelines/diatonic.rb, line 16
def notes_not_in_key_excluding_penultimate_leading_tone
  notes_not_in_key.reject do |note|
    penultimate_note &&
      note == penultimate_note &&
      HeadMusic::ScaleDegree.new(key_signature, note.pitch.spelling).sign == '#'
  end
end
penultimate_note() click to toggle source
# File lib/head_music/style/guidelines/diatonic.rb, line 24
def penultimate_note
  voice.note_preceding(positions.last) if positions.last
end