lib/head_music/content/position.rb in head_music-0.29.0 vs lib/head_music/content/position.rb in head_music-1.0.0

- old
+ new

@@ -1,9 +1,12 @@ # frozen_string_literal: true +# A module for musical content +module HeadMusic::Content; end + # A position is a moment in time within the rhythmic framework of a composition. -class HeadMusic::Position +class HeadMusic::Content::Position include Comparable attr_reader :composition, :bar_number, :count, :tick delegate :to_s, to: :code @@ -54,10 +57,10 @@ def weak? !strong? end def +(other) - other = HeadMusic::RhythmicValue.new(other) if [HeadMusic::RhythmicUnit, Symbol, String].include?(other.class) + other = HeadMusic::Content::RhythmicValue.new(other) if [HeadMusic::RhythmicUnit, Symbol, String].include?(other.class) self.class.new(composition, bar_number, count, tick + other.ticks) end def start_of_next_bar self.class.new(composition, bar_number + 1, 1, 0)