the beginnings of a beautiful era for audio dsp
-
- KVRist
- 92 posts since 26 Sep, 2005 from France
Even if the waveforms produced have nothing new, it really cool to be able to go from one to another just by tweaking a parameter (and the possible modulation linked to that as well ofc), just that is enough for me to find it useful.
-
- Banned
- Topic Starter
- 12367 posts since 30 Apr, 2002 from i might peeramid
stratum - points in previous posts. for instance, if i repeat again, how is xoxos going to post something beneficial without receiving detraction and obfuscation? in this era, no new synthesis method is going to be overtly impressive, because it will sound similar to what we have heard for decades. the benefit of anything novel can be trivially concealed from most of the public by spin. who in the *industry* really wants an intelligent, analytic consumer body? it doesn't have to be as fantastic as my enthusiasm relates, there's still a depth of application, yes, we can do so much with it. i've been through a fair amount of methods in my years of development, we could have a party just because an old person has enthusiasm for something.
again, the sine to rounded square to perfect square is simply the projection of flattening a circular path. when in the past did you think of a square as being this? now add the other params, things open up.
anyway - off to work, in case i don't come back, i'll mention that a 3d rotation matrix is 9 multiplies of course instead of the 4 for a 2d rotation matrix (quaternions are preferable because of the derivation of angle, maybe other things afaik, but unnecessary for rotation of points, which is this). with no modulation, a constant angle should zip through a coordinate plane in all sorts of keen patterns so we ought to have some nifty harmonics.
edit: woke up, realised a 3d rotation would likely sound like fm given the extra dimension adds another frequency component :p prolly neat things to do with it still.
edit 2: i'd also like to discretise, what i said earlier was just trying to make the sentiment approachable for others.. if i could make a bling version, i'd be more likely to give it away for shock value than try to wring money out of people for it... not important but things one likes to make clear.
again, the sine to rounded square to perfect square is simply the projection of flattening a circular path. when in the past did you think of a square as being this? now add the other params, things open up.
anyway - off to work, in case i don't come back, i'll mention that a 3d rotation matrix is 9 multiplies of course instead of the 4 for a 2d rotation matrix (quaternions are preferable because of the derivation of angle, maybe other things afaik, but unnecessary for rotation of points, which is this). with no modulation, a constant angle should zip through a coordinate plane in all sorts of keen patterns so we ought to have some nifty harmonics.
edit: woke up, realised a 3d rotation would likely sound like fm given the extra dimension adds another frequency component :p prolly neat things to do with it still.
edit 2: i'd also like to discretise, what i said earlier was just trying to make the sentiment approachable for others.. if i could make a bling version, i'd be more likely to give it away for shock value than try to wring money out of people for it... not important but things one likes to make clear.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
-
- Banned
- Topic Starter
- 12367 posts since 30 Apr, 2002 from i might peeramid
just for fun (well, just for the erudition of those who think dsp is terribly complicated and inaccessible to the public, and beginners) here's the code for this oscillator -
angular frequency (w) is 2 * pi * freq / samplerate (see my dsp pdf or other sources for more info)
s0 and s1 are states of the quadrature oscillator. they should be initialised as s0 = 1, s1 = 0.
we begin with a 2d rotation matrix, same as you'd use for 2d computer graphics, where w0 and w1 are cosine and sine of w.
t is a temporary variable used in the 2d rotations so that the first line doesn't overwrite the value used in the second line.
for the output, we project y onto the unit circle.. same as taking the leg of a right triangle in geometry.. we could also take the arctan2 of y and x then use the sine, but the unit circle is more cost effective 
see? all very basic geometry.
a simple, flexible, meaningful and intuitive oscillator in a few lines of code. (code it like chaotikmind and you'll see how meaningful the geometry params areto timbre). we also need to antialias it, i'd recommend the polyphase filters from musicdsp for low cpu
seriously, i think most adult/teen human beings have the wherewithal to handle a 2d rotation and taking the leg of a right triangle... i am disgusted by the selfish arguments of kvr members who think creative audio dsp should be left to "professionals" because it is "so difficult" (cue your "this is inferior algorithm" arguments).

angular frequency (w) is 2 * pi * freq / samplerate (see my dsp pdf or other sources for more info)
s0 and s1 are states of the quadrature oscillator. they should be initialised as s0 = 1, s1 = 0.
we begin with a 2d rotation matrix, same as you'd use for 2d computer graphics, where w0 and w1 are cosine and sine of w.
t is a temporary variable used in the 2d rotations so that the first line doesn't overwrite the value used in the second line.
Code: Select all
double t = s0;
s0 = s0 * w0 + s1 * w1; // circular oscillator
s1 = s1 * w0 - t * w1;
x = s0 * *in2; // scale
t = s1 + *in4; // offset
y = t * m0 - x * m1; // angle
x = x * m0 + t * m1;
*out1 = y / sqrt(x * x + y * y);
see? all very basic geometry.
a simple, flexible, meaningful and intuitive oscillator in a few lines of code. (code it like chaotikmind and you'll see how meaningful the geometry params areto timbre). we also need to antialias it, i'd recommend the polyphase filters from musicdsp for low cpu
seriously, i think most adult/teen human beings have the wherewithal to handle a 2d rotation and taking the leg of a right triangle... i am disgusted by the selfish arguments of kvr members who think creative audio dsp should be left to "professionals" because it is "so difficult" (cue your "this is inferior algorithm" arguments).
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
- KVRian
- 522 posts since 12 Apr, 2010 from The Netherlands
What are m0 and m1, or do you perhaps mean w0 and w1?xoxos wrote:Code: Select all
y = t * m0 - x * m1; // angle x = x * m0 + t * m1;
- KVRist
- 347 posts since 20 Apr, 2005 from Moscow, Russian Federation
Most of "those who think dsp is terribly complicated and inaccessible to the public" I met will stop at "we begin with a 2d rotation matrix".
P.S. I mean you'd get a much more insightful feedback if the thread name is "(controlling) Waveform generation via circle geometry" or so.
P.S. I mean you'd get a much more insightful feedback if the thread name is "(controlling) Waveform generation via circle geometry" or so.
-
- Banned
- Topic Starter
- 12367 posts since 30 Apr, 2002 from i might peeramid
http://xoxos.net/temp/out01.wav
http://xoxos.net/temp/out02.wav
http://xoxos.net/temp/out03.wav
modulation with an increasing effect on higher harmonics for acoustic timbres.
http://xoxos.net/temp/out04.wav
unison-like
http://xoxos.net/temp/out02.wav
http://xoxos.net/temp/out03.wav
modulation with an increasing effect on higher harmonics for acoustic timbres.
http://xoxos.net/temp/out04.wav
unison-like
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
-
- Banned
- Topic Starter
- 12367 posts since 30 Apr, 2002 from i might peeramid
you should be able to infer the answer by considering the description of the algorithm. you'll feel silly for askingTale wrote:What are m0 and m1, or do you perhaps mean w0 and w1?xoxos wrote:Code: Select all
y = t * m0 - x * m1; // angle x = x * m0 + t * m1;
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
- KVRian
- 522 posts since 12 Apr, 2010 from The Netherlands
Well, I thought your oscilator looked interesting so I copy-pasted your code, but then it didnt work, apparently because you switched variable names midway. I have already fixed this at my end, but I thought I'd mention it, so maybe it would help others who might be interested in trying this.xoxos wrote:you should be able to infer the answer by considering the description of the algorithm. you'll feel silly for asking
But hey, if you rather call me silly than help, that's fine...
- KVRAF
- 10150 posts since 16 Dec, 2002
I've definately come across this idea before, though probably not being used to create a synthesiser oscillator.
- Beware the Quoth
- 35453 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair
you just dont understand how non-working code empowers non-coders.camsr wrote:The code example is not terribly clear, I will try to "follow along", but having undefined variables isn't helpful.
An idiot on Set Theory:
"In some cases there is an object called red that contains everything that is red. In much the same way a pot is a plate."
"In some cases there is an object called red that contains everything that is red. In much the same way a pot is a plate."
- KVRian
- 804 posts since 25 Apr, 2011
I think:
s1 and s2 are a pair of variables that give the x,y coordinates of a point moving in a circle.
w0 and w1 are a cos/sin pair derived from w, that determine the frequency of rotation of s1,s2 around the circle.
*in2 is an input parameter which scales the circle in the x-direction
*in4 is an input parameter which moves the scaled circle in the y-direction
m0 and m1 are another input, a cos/sin pair which rotates the moved and scaled circle about the origin. They could also perform some further scaling if (m0*m0+m1*m1) != 1
Then as we move around this rotated,moved,scaled circle, we back-project the current point onto the unit circle and return the y-coordinate of this point.
s1 and s2 are a pair of variables that give the x,y coordinates of a point moving in a circle.
w0 and w1 are a cos/sin pair derived from w, that determine the frequency of rotation of s1,s2 around the circle.
*in2 is an input parameter which scales the circle in the x-direction
*in4 is an input parameter which moves the scaled circle in the y-direction
m0 and m1 are another input, a cos/sin pair which rotates the moved and scaled circle about the origin. They could also perform some further scaling if (m0*m0+m1*m1) != 1
Then as we move around this rotated,moved,scaled circle, we back-project the current point onto the unit circle and return the y-coordinate of this point.
-
- Banned
- Topic Starter
- 12367 posts since 30 Apr, 2002 from i might peeramid
alright, it's time for you to feel sillyTale wrote: But hey, if you rather call me silly than help, that's fine...
i described three parameters:
scale the cartesian x
offset the cartesian y
rotate the result by a set angle
scale, offset, angle. i've repeated it since the beginning of this thread.
since the two lines before say "scale" and "offset" and the line in question says "angle" on it i thought it somewhat obvious
since earlier in the very same code, the form for 2d rotation is annotated, and we have the same form here, ..it would be redundant for me to explicitly indicate that this is a 2d rotation matrix to tilt/rotate the result by a set angle.
you may intuit that m0 and m1 are respectively cosine and sine of an arbitrary angle used for the "angle" operation. intuiting that the poster has placed two "w"s upsidedown by accident may get you more sympathy from the xoxos derision brigade, it depends what you want to do today.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
-
- KVRAF
- 2256 posts since 29 May, 2012
So basically xoxos is rotating an offsetted point and the result is bizzare and interesting. The resulting signal is either taken from x or y value, I guess. Whether this makes a difference or not is not stated, or I couldn't see it if it was stated. Anyway it's not difficult to try, if it's not x then it's y.
This appears to be the summary of this thread.
ps. I' have found it somewhere above, the output signal is from y
This appears to be the summary of this thread.
ps. I' have found it somewhere above, the output signal is from y
*out1 = y / sqrt(x * x + y * y);
~stratum~
- KVRian
- 522 posts since 12 Apr, 2010 from The Netherlands
Fair enough, and thanks for explaining.xoxos wrote:scale, offset, angle. i've repeated it since the beginning of this thread.
Still, it would be nice to post a more or less working example (although one still has to wrap it in some plug-in format, but you know what I mean), especially when you argue that this shouldn't be so hard (a non-working example will almost certainly discourage a beginner).
