lib/music-transcription/profile.rb in music-transcription-0.5.5 vs lib/music-transcription/profile.rb in music-transcription-0.5.6
- old
+ new
@@ -49,9 +49,18 @@
def shift! amt
@value_changes = Hash[@value_changes.map {|k,v| [k+amt,v]}]
return self
end
+ def stretch ratio
+ self.clone.stretch! ratio
+ end
+
+ def stretch! ratio
+ @value_changes = Hash[ @value_changes.map {|k,v| [k*ratio,v] }]
+ return self
+ end
+
def append profile, offset
self.clone.append! profile
end
def append! profile, start_offset