Sha256: 33cd4f560191ee98803506171100b2ff4be1e8acc97ec550ce764c8f45836fd6

Contents?: true

Size: 458 Bytes

Versions: 9

Compression:

Stored size: 458 Bytes

Contents

# Module for style guidelines.
module HeadMusic::Style::Guidelines; end

# A counterpoint guideline
class HeadMusic::Style::Guidelines::EndOnTonic < HeadMusic::Style::Annotation
  MESSAGE = "End on the first scale degree."

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

  private

  def ends_on_tonic?
    tonic_spelling == last_note_spelling
  end

  def last_note_spelling
    last_note&.spelling
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
head_music-7.0.5 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-7.0.4 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-7.0.3 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-7.0.2 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-7.0.1 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-7.0.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-6.0.1 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-6.0.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-5.0.0 lib/head_music/style/guidelines/end_on_tonic.rb