Cockos Incorporated Forums Stretch markers audio quality degredation.
 Register Track Bugs/Feature Requests Search Today's Posts Mark Forums Read

 11-05-2017, 01:00 PM #1 Airal Banned   Join Date: Nov 2015 Posts: 406 Stretch markers audio quality degredation. Stretch markers have a logic bug in them, IMO. They are constant on their interval but they should be linear(sort of like envelopes but here, we end up with timing issues because of the way time works). For example, suppose you play a steady beat on a snare that changes tempo linearly. Now if you use stretch markers to make the time constant then basically ever point after the stretch marker, any notes will get more and more off depending on how far they are in the bar. You are effectively quantizing the tempo but only at the points where the stretch markers exist will it be exact. Any notes in between will be off because they were actually at a different tempo. If the tempo was increasing then the notes will be delayed and if it was decreasing then it would be anticipated from where it would have actually been if played at a constant tempo. e.g., suppose we have a "note" at t = 0, at t = 0.7 and at t = 1.2. If these notes were suppose to be equally spaced we'ed expect them at t = 0, t = 0.5 and t = 1. we put a stretch marker at t = 0 and t = 1.2 and move the t = 1.2 to t = 1. This "squishes" everything between t = 0 and t = 1.2 down to t = 0 and t = 1. But the note in the middle? It should be 0.5, but is it? It's easy to calculate where it is when we use a constant change: (1.2 + 0)/2 = 0.6 and we'd expect it to be at 0.5 when squished but what we actually see is that it is at 0.7*(1 - 0)/(1.2 - 0) = 0.58. This means with the constant stretching per interval, our note that is suppose to be at 0.5 is at 0.58 and this is can be enough to make the music very off rhythmically(a weird feel). You might say that this doesn't matter because we can add a stretch marker to the notes in between and fix the middle note... but then what about the middle notes of the middle note? (the note at 0.3, say?) Basically everything ends up off and we'd have to add an infinite number of stretch markers to make everything correct... or just allow for linear transitions in stretch markers. Basically linear transitions require far fewer stretch markers to properly correct timing. Almost tempo changes are gradual and so are linearly approximated well as long as the resolution of the stretch markers are "close"(maybe over a bar), which they tend to be. You might not think that this is a big musical problem but try it and see. Find some music that has clearly defined notes in the wave form and has tempo drifts and try to correct them to exact consistency(you can use midi to know where the notes are exactly)... you'l find that notes are off and there is no easy way to fix them. If you are time correcting a long track, you'll expend an order of magnitude of time adding stretch markers than you need to if they linearly(or better yet, a higher order interpolate) transition. Maybe a better thing to do would be simply to have an envelope be able to act as time stretching. This should be easy to implement and leverages all the things reaper already has for envelopes. This then makes it easy for someone to select how they want to deal with the problem.
 11-05-2017, 02:08 PM #2 heda Human being with feelings     Join Date: Jun 2012 Location: Spain Posts: 4,798 If I understand correctly, stretch markers have a rate modifier that can be used to create those ramps you mention. Look for stretch marker rate in mouse modifiers. __________________ HeDaScripts for REAPER | VIP Donations
11-05-2017, 02:21 PM   #3
Human being with feelings

Join Date: Jul 2009
Posts: 2,192

Quote:
 Originally Posted by Airal e.g., suppose we have a "note" at t = 0, at t = 0.7 and at t = 1.2. If these notes were suppose to be equally spaced we'ed expect them at t = 0, t = 0.5 and t = 1.
I do not quite understand? t = 0.7 is not in the middle between 0 and 1.2, so I would not expect it to end up at 0.5 after stretching.