Sha256: 459cc24f3af158199dd0a183a72eb940db0721fbfc284529e7c097c7ed88861c

Contents?: true

Size: 489 Bytes

Versions: 21

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

# 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

21 entries across 21 versions & 1 rubygems

Version Path
head_music-0.27.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.26.3 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.26.2 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.26.1 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.26.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.25.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.24.5 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.24.4 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.24.3 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.24.2 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.24.1 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.24.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.23.4 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.23.3 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.23.2 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.23.1 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.23.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.22.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.20.0 lib/head_music/style/guidelines/end_on_tonic.rb
head_music-0.19.2 lib/head_music/style/guidelines/end_on_tonic.rb