|
Kyma Forum
![]() Tips & Techniques
![]() converting from polar to cartesian
|
| next newest topic | next oldest topic |
| Author | Topic: converting from polar to cartesian | |
|
johannes Member |
based on ssc´s cartesian to polar patch i just try to convert from polar back to cartesian coordinates using the formulae: i also wonder how to calculate that (e.g. cos or sin of an angle) in the freq. domain. thanks, johannes [This message has been edited by johannes (edited 05 May 2014).] IP: Logged | |
|
SSC Administrator |
There are a few things to change to make this work correctly: * In the reconvert Sounds, change cos to normCos and sin to normSin * In the Angle SoundToGlobalController, get rid of "1 -" and keep just the pasted in ArcTan Sound. The ArcTan Sound outputs a "normalized" angle in the range of -1 to +1: arcTan ( right / left ) / π so, if you want to convert the "normalized" angle back to X and Y coordinates, you would need to use: cos ( π * angle ) and sin ( π * angle ) which is exactly what the Capytalk normCos and normSin do. IP: Logged | |
|
johannes Member |
thanks for the fast reply. it works perfectly. what exactly does "n" in your two equations stands for? IP: Logged | |
|
SSC Administrator |
π = pi The font makes it look like the letter "n" To take the sine and cosine at the sample rate, you can use a Waveshaper whose shapingFunction is either the Sine or the Cosine wavetable. [This message has been edited by SSC (edited 05 May 2014).] IP: Logged | |
|
johannes Member |
but it seems to that the sine calculated by the waveshaper is 180 degree out of phase to the sine calculated by capytalk, while this doesnt seem to occur for cos. to correct the phase i now multiply the sine function by -1 ... after some experimentation i also realized some range-limitation of the reconverted x and y values. when setting x and y to 1 or -1 the reconverted x and y will be 0.7 or -0.7 (instead of 1 and -1) i append two sounds for demonstration… any help is welcome. ciao, j [This message has been edited by johannes (edited 06 May 2014).] IP: Logged | |
|
johannes Member |
IP: Logged | |
|
SSC Administrator |
Just so everyone else understands it too... in the Waveshaper an index of 0 maps to the center of the shaping function. So an input of 0 was giving you the center of the Sine table, rather than the start of the table. IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() |
|
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.