<br><br><div class="gmail_quote">On Nov 9, 2007 11:10 AM, AlgoMantra &lt;<a href="mailto:algomantra@gmail.com">algomantra@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hm, happy diwali greetings from India chuckers!<br></blockquote><div><br>Happy Diwali greetings to you to!<br><br>I had to look it up but celebrating the victory of good over evil by lighting lamps sounded like a very good idea and I just lit a small candle, it&#39;s a vanilla scented one, I hope that&#39;s appropriate as those are the only ones I have around :¬)
<br><br>Fireworks are illegal here except with new year (Roman callendar) but who needs those when one has ChucK for the explosions?<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>So. Lets say I&#39;m shaping a curve, which is the frequency<br>graph of a sound wave, using pygame, or some kind of<br>GUI. So what I possibly have are two things: <br>
<br>1. a string of coordinates that forms the curve.<br>2. a parametric equation that represents the curve. <br><br>What is the easiest way in ChucK, by which I can play/generate<br>this sound in case 1) and 2). <br></blockquote>
<div><br>The easiest by far will be the IFFT Uana <br>&nbsp;<a href="http://chuck.cs.princeton.edu/doc/program/uana_full.html#IFFT">http://chuck.cs.princeton.edu/doc/program/uana_full.html#IFFT</a><br><br>This takes a array of complex numbers, maps those to frequencies between 0 and the Nyquist&nbsp; and synthesises the result. Basically It&#39;s exactly what you are describing you want to do in ready-made form. This does leave questions with regard to the phase of the generated sines.
<br><br>The official examples don&#39;t go into this but there is nothing that prevents you from manually filling a &quot;blob&quot; with numbers you like and synthesising that. I have one example of this at hand, I made it a while back to play Kijjaz&#39;s &quot;doing lots with little&quot; game.
<br><br>---------------------------------------<br>
IFFT i=&gt;dac;complex c[512];int A; 
<br>
while(1){#(++A%.33,A%1.65)=&gt;c[A%512]; i.transform(c);1024::samp=&gt;now;}<br>----------------------------------------------------<br><br>Warning; not necessarily a pleasant sound for most, watch your speakers, watch your pets.
<br><br>I suggest you do roughly that, except replace my silly formula with a OSC signal.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>See? It&#39;s getting less stupid everyday :) (eh, Kassen?)
<br clear="all"><br></blockquote><div><br>It never was stupid, don&#39;t put yourself down like that. If there were no questions we might was well give up. Questions are good.  <br><br><br>Yours,<br>Kas.<br></div></div>