Re: [LAU] need little help with csound

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-user@...>
Date: Thursday, March 28, 2013 - 2:52 pm

Rustom Mody writes:

>

the
demo:http://zonalandeducation.com/mstm/physics/wavesstandingWaves/standingWav
es1/StandingWaves1.html Along with that I want to demo how it would sound
using something like csound ie for a freqs from {440 880 1320 1760...}show
how the sound changes as each freq is added to the fundamental sine wave at
440.

csound... not my cup of tea. In SuperCollider you can do it IMO more easily.
Then again, I'm biased (being an avid SuperCollider user for over 10 years).

SynthDef(\sine, { |freq, amp = 0.1, gate = 1|
var eg = EnvGen.kr(Env.asr(0.1, amp, 0.1), gate, doneAction: 2);
Out.ar(0, SinOsc.ar(freq, 0, eg) ! 2);
}).add;

g = Group.new;

p = Pbind(\instrument, \sine, \type, \on, \freq, 440 * Pseries(1, 1, inf),
\amp, 0.1 / Pseries(1, 1, inf), \group, g).play;

// when done:
p.stop; g.release;

If you want different amplitudes, substitute a different pattern after \amp.
This example posits an inverse relationship between the partial's frequency
and its amplitude, i.e., a sawtooth.

Disclaimer: I wrote this on a tablet without testing the code... and we all
know how that usually turns out. There could be mistakes, but the principle
is right.

Again IMO (and admitting my bias), if you have to make a choice between
learning csound or SuperCollider, choose SuperCollider.

hjh

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [LAU] need little help with csound, James Harkins, (Thu Mar 28, 2:52 pm)
Re: [LAU] need little help with csound, Rustom Mody, (Thu Mar 28, 4:35 pm)
Re: [LAU] need little help with csound, James Harkins, (Sat Mar 30, 1:35 am)