Sha256: 9cb90ed6aa4f80d042e9873bb9b1f84983306622c97b83fd84fed9c412389cd9

Contents?: true

Size: 685 Bytes

Versions: 17

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

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

# marks the voice if the first note is not the first or fifth scale degree of the key.
class HeadMusic::Style::Guidelines::StartOnPerfectConsonance < HeadMusic::Style::Annotation
  MESSAGE = 'Start on the tonic or a perfect consonance above the tonic (unless bass voice).'

  def marks
    return unless first_note && ((bass_voice? && !starts_on_tonic?) || !starts_on_perfect_consonance?)

    HeadMusic::Style::Mark.for(first_note)
  end

  private

  def starts_on_perfect_consonance?
    diatonic_interval_from_tonic(first_note).perfect_consonance?(:two_part_harmony)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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