Class: HeadMusic::Style::Guidelines::NoRestsAfterNote

Inherits:
HeadMusic::Style::Guideline show all
Defined in:
lib/head_music/style/guidelines/no_rests_after_note.rb

Overview

Once the first note has sounded, no rests are permitted for the remainder of the voice. Rests before the first note (a leading rest) are allowed.

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from HeadMusic::Style::Guideline

Instance Method Details

#marksObject



7
8
9
10
11
# File 'lib/head_music/style/guidelines/no_rests_after_note.rb', line 7

def marks
  return [] if rests.empty? || notes.empty?

  HeadMusic::Style::Mark.for_each(rests_after_first_note)
end

#rests_after_first_noteObject (private)



15
16
17
# File 'lib/head_music/style/guidelines/no_rests_after_note.rb', line 15

def rests_after_first_note
  rests.select { |rest| rest.position >= first_note.position }
end