Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stretch v2 #229
Stretch v2 #229
Changes from 20 commits
a4f8ef0
dc71674
4dc19dc
25ce361
578b3f4
7e7d633
bfc4679
ff0bfe1
4af677b
a6708e6
70c8e17
94d0ab6
17ff71d
7dd3f07
6593248
8938e12
455b958
e84cdae
7784fb8
d5f813b
c78d427
26dba05
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (~timescale.notNil) { sustain = sustain * ~timescale };
above, you are using the full sustain, while in the synthdef you are clipping it, while the sustain is still the same length.Are you sure this is correct? Note that there is no operator precedence in supercollider. I'm unsure right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windowSize
andtimescale
can be varied completely independently and the algorithm still works, but may sound odd for certain combinations. I'm really clipping on windowSize values, but a "good" windowSize tends to scale somewhat with the length of the effect. I'm not sure what you mean about the sustain.The
windowIndex
calculation is correct, but unnecessarily obscure. I added a variable to clarify it a bit (and it might save a repeated computation).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say e.g. you are setting
# timescale 0.09
for a sample that is 1 second long. Then your playback synth will have a total duration (=sustain) of 0.09 seconds. But your window will be(0.1 * 0.05)
. Or, when you set# timescale 3
, your synth will be 3 seconds, but the window will be(2 * 0.05)
. But also, in line 124 (timescaleStep = windowSize / timescale;
e.g. for a very large timescale, the timescalestep will be very small, but the window won't get smaller because of the clipping.I am not sure if all that is a problem, it just looks like a source of hard to trace errors. It might be easier to reason about when you limit the stretching before everything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to have left this dangling. I meant that because
timescaleStep
is clipped, the overlaps will become larger whentimescale < 0.1
. Could you check if that is really correct? If that is what you want, it might be good to make a comment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look! I have since noticed that a combo of frequency shift (
fshift
) and speed modification works pretty well for smaller amounts of stretching.