Re: [LAU] need little help with csound

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: James Harkins <jamshark70@...>
Cc: <linux-audio-user@...>
Date: Thursday, March 28, 2013 - 4:35 pm

--f46d044788d9d0f5e404d8febd24
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Mar 28, 2013 at 8:22 PM, James Harkins wrote:

> Rustom Mody writes:

Thanks James. I got something running with chuck.
[I still have to figure out how to use data structures in chuck; so for now
the code is a bit of a mess :-) ]
Now I have a different related question
Is there any good source on harmonic spectra?

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?
Yeah I know piano is specially hard because of the transient
characteristic... Still just wondering...

Rusi
--
http://www.the-magus.in
http://blog.languager.org

--f46d044788d9d0f5e404d8febd24
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 28, 2013 at 8:22 PM, James H=
arkins <jamshark70@gmail.com> wrote:

Rustom Mody <rustompmody@...> writes:

>

sing
the
demo:http://zonalandeducation.com/mst=
m/physics/wavesstandingWaves/standingWav
es1/StandingWaves1.html
Along with that I want to demo how it would sou=
nd
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 ye=
ars).

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

g =3D Group.new;

p =3D 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 frequ=
ency
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@l=
ists.linuxaudio.org

http://lists.linuxaudio.org/listinfo/linux-audio-user
Thanks James. I got something running with chuck=
.[I still have to figure out how to use data structures in chuck; so fo=
r now the code is a bit of a mess :-) ]Now I have a different related q=
uestion

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

Rusi-- ht=
tp://www.the-magus.in
http://blog.languager.org

--f46d044788d9d0f5e404d8febd24--

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)