<br><br><div class="gmail_quote">On Thu, Mar 28, 2013 at 8:22 PM, James Harkins <span dir="ltr"><<a href="mailto:jamshark70@gmail.com" target="_blank">jamshark70@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">Rustom Mody <rustompmody@...> writes:<br>
<br>
><br>
> I am preparing a lecture on sound and vibrations and was thinking of using<br>
the<br>
</div>demo:<a href="http://zonalandeducation.com/mstm/physics/wavesstandingWaves/standingWav
es1/StandingWaves1.html" target="_blank">http://zonalandeducation.com/mstm/physics/wavesstandingWaves/standingWav<br>
es1/StandingWaves1.html</a> Along with that I want to demo how it would sound<br>
<div class="im">using something like csound ie for a freqs from {440 880 1320 1760...}show<br>
how the sound changes as each freq is added to the fundamental sine wave at<br>
440.<br>
<br>
</div>csound... not my cup of tea. In SuperCollider you can do it IMO more easily.<br>
Then again, I'm biased (being an avid SuperCollider user for over 10 years).<br>
<br>
SynthDef(\sine, { |freq, amp = 0.1, gate = 1|<br>
        var eg = EnvGen.kr(Env.asr(0.1, amp, 0.1), gate, doneAction: 2);<br>
        Out.ar(0, SinOsc.ar(freq, 0, eg) ! 2);<br>
}).add;<br>
<br>
g = Group.new;<br>
<br>
p = Pbind(\instrument, \sine, \type, \on, \freq, 440 * Pseries(1, 1, inf),<br>
\amp, 0.1 / Pseries(1, 1, inf), \group, g).play;<br>
<br>
// when done:<br>
p.stop; g.release;<br>
<br>
If you want different amplitudes, substitute a different pattern after \amp.<br>
This example posits an inverse relationship between the partial's frequency<br>
and its amplitude, i.e., a sawtooth.<br>
<br>
Disclaimer: I wrote this on a tablet without testing the code... and we all<br>
know how that usually turns out. There could be mistakes, but the principle<br>
is right.<br>
<br>
Again IMO (and admitting my bias), if you have to make a choice between<br>
learning csound or SuperCollider, choose SuperCollider.<br>
<br>
hjh<br>
<br>
_______________________________________________<br>
Linux-audio-user mailing list<br>
<a href="mailto:Linux-audio-user@lists.linuxaudio.org">Linux-audio-user@lists.linuxaudio.org</a><br>
<a href="http://lists.linuxaudio.org/listinfo/linux-audio-user" target="_blank">http://lists.linuxaudio.org/listinfo/linux-audio-user</a><br>
</blockquote></div><br><br>Thanks James. I got something running with chuck.<br>[I still have to figure out how to use data structures in chuck; so for now the code is a bit of a mess :-) ]<br>Now I have a different related question<br clear="all">

Is there any good source on harmonic spectra?<br><br>ie by showing the first say 8 harmonics and reconstitue according to the spectra of piano, violin, trombone etc can we being to discern the difference?<br>Yeah I know piano is specially hard because of the transient characteristic... Still just wondering...<br>

<br>Rusi<br>-- <br><a href="http://www.the-magus.in" target="_blank">http://www.the-magus.in</a><br><a href="http://blog.languager.org" target="_blank">http://blog.languager.org</a><br><br>