Sha256: 0f54df220f676794e853c9e003f15cea58df82ad894e2574d5ab3d5f397ba416

Contents?: true

Size: 417 Bytes

Versions: 8

Compression:

Stored size: 417 Bytes

Contents

module HeadMusic::Style::Annotations
end

class HeadMusic::Style::Annotations::EndOnTonic < HeadMusic::Style::Annotation
  MESSAGE = 'End on the tonic.'

  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

8 entries across 8 versions & 1 rubygems

Version Path
head_music-0.16.0 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.14.8 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.14.7 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.14.5 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.14.4 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.14.2 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.14.1 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.13.2 lib/head_music/style/annotations/end_on_tonic.rb