Splines and DSP
Posted: Fri Jan 17, 2020 8:15 am
Those of you who had a look at my spline class, will have noticed that it comes with some comfortable features. For this topic, I will concentrate on three of them:
1) I can set each section (the line between two control nodes) to be constructed from a specific amount of segments (basically short lines that create the curvature of the spline).
2) I can get normalized output and even output mapped to a certain range, both from x and y axes seperately or combined. (The result is an array)
3) The grid on which the splines are created also can be used normalized (it is then a grid ranging from -1 to +1 on both axes no matter the ratio of the drawing, meaning you can draw a spline on a rectangular grid, but its values are always perfectly square)
Now the downside for my current thinking: segments of course can't be fractions. They have to be integers (1 to +inf).
That said:
If I create a spline with 4 control points, it would mimic a standard adsr, except that they all would be in the same distance from each other. However, since it calculates the sections between the control points, I have to deal with 3 sections. To define the number of segments that each section is using, I would need to know, what the dsp section expects to get. For example, it might want to have sample-based timing, so that each value of the array corresponds to an envelope value per sample. This would rule out a lot of lengths if the sections can only be composed of integer segments and all sections have to share the same number of segments (There is no way to have the first section use 10 segments, and the second 30, both have to use either 10 or 30).
Also, the arrays would be enormous for longer envelopes, like 176,000 values for 4 seconds at 44.1kHz sample rate.
What would be needed to get an envelope that follows close to exactly the curvature of the visually created envelope, on the DSP side?
Also, how would you work with such green or RubyValue arrays on the DSP side, especially as envelopes need to affect the polystream?
Is there anyone among you that could create an envelope creator on the DSP side, that expects an array of values, but is not bound to ADSR (aka freeform envelopes, for example an envelope composed from a spline with 12 control nodes, where the basis is time, not envelope stages, yet with switchable sustain at any of the nodes if wanted)?
Since interpolation within the DSP module would counter the idea of having a freely designed spline envelope, is it even possible to work with such huge arrays? Maybe in the form of on-the-fly generated waves that are read from memory?
I would love to work on something like this, but I can only do the user interaction part, up until the array of values are ready to be delivered. So I hope to get some serious help here, even if it means that I have to make severe changes to this initial design.
Thank you!
1) I can set each section (the line between two control nodes) to be constructed from a specific amount of segments (basically short lines that create the curvature of the spline).
2) I can get normalized output and even output mapped to a certain range, both from x and y axes seperately or combined. (The result is an array)
3) The grid on which the splines are created also can be used normalized (it is then a grid ranging from -1 to +1 on both axes no matter the ratio of the drawing, meaning you can draw a spline on a rectangular grid, but its values are always perfectly square)
Now the downside for my current thinking: segments of course can't be fractions. They have to be integers (1 to +inf).
That said:
If I create a spline with 4 control points, it would mimic a standard adsr, except that they all would be in the same distance from each other. However, since it calculates the sections between the control points, I have to deal with 3 sections. To define the number of segments that each section is using, I would need to know, what the dsp section expects to get. For example, it might want to have sample-based timing, so that each value of the array corresponds to an envelope value per sample. This would rule out a lot of lengths if the sections can only be composed of integer segments and all sections have to share the same number of segments (There is no way to have the first section use 10 segments, and the second 30, both have to use either 10 or 30).
Also, the arrays would be enormous for longer envelopes, like 176,000 values for 4 seconds at 44.1kHz sample rate.
What would be needed to get an envelope that follows close to exactly the curvature of the visually created envelope, on the DSP side?
Also, how would you work with such green or RubyValue arrays on the DSP side, especially as envelopes need to affect the polystream?
Is there anyone among you that could create an envelope creator on the DSP side, that expects an array of values, but is not bound to ADSR (aka freeform envelopes, for example an envelope composed from a spline with 12 control nodes, where the basis is time, not envelope stages, yet with switchable sustain at any of the nodes if wanted)?
Since interpolation within the DSP module would counter the idea of having a freely designed spline envelope, is it even possible to work with such huge arrays? Maybe in the form of on-the-fly generated waves that are read from memory?
I would love to work on something like this, but I can only do the user interaction part, up until the array of values are ready to be delivered. So I hope to get some serious help here, even if it means that I have to make severe changes to this initial design.
Thank you!