lib/music-transcription/note.rb in music-transcription-0.6.1 vs lib/music-transcription/note.rb in music-transcription-0.6.2
- old
+ new
@@ -74,11 +74,11 @@
def transpose diff, transpose_links = true
self.clone.transpose! diff, transpose_links
end
- def transpose! diff, transpose_link_targets
+ def transpose! diff, transpose_link_targets = true
unless diff.is_a?(Pitch)
diff = Pitch.make_from_semitone(diff)
end
@pitches = @pitches.map {|pitch| pitch + diff}
@@ -89,9 +89,17 @@
end
new_links[k + diff] = v
end
@links = new_links
return self
+ end
+
+ def stretch ratio
+ self.clone.stretch! ratio
+ end
+
+ def stretch! ratio
+ @duration *= ratio
end
def to_s
output = @duration.to_s
if @pitches.any?