Sha256: c06a15d9350f83651477fd3e90567b68ba5331d44af32174199a633a00247868

Contents?: true

Size: 471 Bytes

Versions: 9

Compression:

Stored size: 471 Bytes

Contents

module HeadMusic::Style::Annotations
end

class HeadMusic::Style::Annotations::EndOnTonic < HeadMusic::Style::Annotation
  def message
    'End on the tonic.'
  end

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

  private

  def ends_on_tonic?
    notes &&
    notes.last &&
    composition &&
    composition.key_signature &&
    composition.key_signature.tonic_spelling == notes.last.spelling
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
head_music-0.11.9 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.8 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.7 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.6 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.5 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.4 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.3 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.2 lib/head_music/style/annotations/end_on_tonic.rb
head_music-0.11.1 lib/head_music/style/annotations/end_on_tonic.rb