[Stk] Creating a THX-like sound

Gary P. Scavone gary@ccrma.Stanford.EDU
Wed, 10 Jan 2007 11:24:30 -0500


Hi Brent,

Thanks for the email ... the information and sound was very nice!

Here are some answers to your questions:

> Easy questions:
> * What values are valid for the various amplitude, rate, velocity,  
> etc parameters to the Bowed class?

That is not an easy question. :-)  In general, finding "proper"  
parameter values for physical models requires much experimentation.

> * Are sample values from STK instruments always within [-1, 1]?

Yes, they are expected to fall in that range but there is no internal  
clipping.  Definitely, they need to be in that range when they are  
output to a file or the RtAudio class.

> * To mix several instruments, is a simple weighted sum of the samples
> the idea? (And adjust the weights to keep the sum in [-1, 1]?)

Basically.

> * When adding to a SineWave's phase, is the value in radians or a  
> unit of time/samples?

When using the addPhase() function of the SineWave class, the "angle"  
argument is multiplied by the table size and the read pointer is  
incremented by that amount.  So, an argument value of 1.0 would  
increment the read pointer by one complete table size (or 2*pi  
radians), which would put it back where it started.  Thus, unique  
values are in the range 0.0 - 1.0 but you can provide values outside  
that range.

> * In non-RT code, is it better to call the noteOn()/noteOff()  
> methods of Bowed, or the start/stopBowing() methods?

You should look at the code but the noteOn()/noteOff() functions may  
do a few other things that do not happen in the start/stopBowing  
functions.

> Bigger questions:
> * How can I get a better sound out of the Bowed instrument? What  
> parameters produce more of a bass sound (or cello, or violin)?  
> Along those lines, would a "bow position" of 0.5 produce louder  
> fundamentals than harmonics?

The bow position argument does not correspond to a full string-length  
distance.  That is, a value of 0.5 does not correspond to bowing in  
the center of the string.  From from quick tests, it appears that the  
loudest sounds occur for values around 0.5, with more high frequency  
content using lower values.

> * I'd like to use a sampled cello sound. If I use a WaveLoop with the
> example sound sampled at 44.1khz, how much of that clip is needed?  
> What
> are the rules of thumb to using a fixed sample w.r.t to generating  
> a different
> frequency?

I'm not sure I completely understand your question but WaveLoop will  
cycle your entire sound file.  Determining the exact sounding  
frequency will depend on the frequency of the original sound.

> * Is there a STK class (or combination of classes) to generate an N- 
> harmonic
> sound wave? Instead of using a cello WaveLoop, maybe combine SineWaves
> at the desired harmonics? Maybe another, more efficient method?

No but you can use many SineWaves to do that (as Perry indicated via  
ChucK).

Regards,

--gary