[Stk] Stk++ SineWave amplitude/volume/gain etc

Perry R Cook prc@CS.Princeton.EDU
Tue, 28 Feb 2006 13:31:42 -0500 (EST)


Hey Brian,

Thanks for the thanks, but we all gotta thank Gary
Scavone a whole bunch too.  STK would not be what
it is today without him.

Believe it or not, since all unit generators in
STK are single sample tick, the way to set gain
is to just multiply the output of the sine wave
by a gain factor;

float gain = 1.0;

dacOut.tick(gain * sinewave.tick());

or somesuch.

PRC

> is there a way to set or adjust the volume of the SineWave class
> object, i've poked through the source and include files (i run cygwin,
> btw) and I haven't found anything in there about sine-wave amplitudes
> or volume setting, i'm wondering if theres a way to do this. I
> understand most of the other instruments can do this, can SineWave?