Sha256: cc22cc7a6b92140a47e78155957b2c7aa641c68970e021b10f54d484f392e55a

Contents?: true

Size: 430 Bytes

Versions: 2

Compression:

Stored size: 430 Bytes

Contents

module HeadMusic::Style::Annotations
end

class HeadMusic::Style::Annotations::EndOnTonic < HeadMusic::Style::Annotation
  MESSAGE = 'End on the first scale degree.'

  def marks
    if !notes.empty? && !ends_on_tonic?
      HeadMusic::Style::Mark.for(notes.last)
    end
  end

  private

  def ends_on_tonic?
    tonic_spelling == last_note_spelling
  end

  def last_note_spelling
    last_note && last_note.spelling
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
head_music-0.17.0 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.16.2 lib/head_music/style/annotations/end_on_tonic.rb