Skip to content

Commit

Permalink
Fix for Seq#final_onset.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Voorhis committed Nov 3, 2008
1 parent cddae2f commit 7691150
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/music/score.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Seq < Base
def initialize(left, right)
@left, @right = left, right
@duration = @left.duration + @right.duration
@final_onset = @left.duration
@final_onset = @left.duration + @right.final_onset
end

def ==(other)
Expand Down
4 changes: 2 additions & 2 deletions spec/env_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def cresc(factor, score)
it "can be nested" do
score = cresc(1.5,
sn([c4, e4, g4], 1, :velocity => 40) &
cresc(1.5,
cresc(2,
sn([c4, e4, g4], 1, :velocity => 40)))
timeline = score.to_timeline
timeline.map(&:velocity).should == [40, 47, 53, 60, 83, 110]
timeline.map(&:velocity).should == [40, 44, 48, 52, 84, 120]
end
end

0 comments on commit 7691150

Please sign in to comment.