[Stk] RtWvIn, RAWWAVES, etc

greg kellum greg_kellum@hotmail.com
Mon, 09 Jun 2003 14:04:24 +0000


Hi Gary,

Thanks for answering those questions. I know that this is a difficult time 
of year as most people in academics are taking vacations and trying to 
unwind from the stress of spring semester...

Funnily enough I had actually tried generating stereo sound files in the way 
you described in your last email. I simply misdescribed what I had done in 
my email, because I didn't have the code in front of me at the time.  So I 
wrote a simple test program to try it out again, and your suggestion worked. 
The problem is somewhere else in my code. I was using a factory to create a 
WvOut object, and although I thought it was creating a stereo WvOut object 
for me, it was probably creating a mono WvOut object or something along 
those lines.

As for the sound card question, yes, I am having problems getting the 
default number and size of RtWvIn's audio buffers to work using Window's 
DirectSound API. The sound card is an Echo Audio Gina 20 card. When I used 
the STK's defaults (two 1024 buffers), a lot of samples seemed to go lost, 
because everything sounded rather grainy, but when I switched to the 
settings Cubase used for this card (five 5512 buffers), then everything 
sounded fine.  I'd be curious to know how Cubase is able to figure out this 
information out;
I have no idea whether the program gets this information through DirectSound 
or if it has something to do with the ASIO driver protocol. In any case I 
suppose as a work around I'll build in a command line argument for the sound 
card type and retrieve the appropriate number of buffers and buffer sizes 
from a property file.

By the way do you have any suggestions for how one might go about setting 
the directory for the raw waves needed by many of the STK's instruments? One 
can specify the value for the RAWWAVES macro in a makefile, but that means 
that anyone using a program based on the STK would have to recompile the 
program after setting this. And that can be a bit daunting for 
non-programmers. One might also set the RAWWAVES macro to retrieve an 
environment variable defining the location of the raw waves directory, and 
then someone using an STK based program would only have to set this 
variable. But that would only work if every STK class using this macro 
imported stdlib.h, and even if they did (and most do -- Modulate.cpp is the 
only exception I've found), this approach still has the drawback that if a 
user forgot to set this variable, they might get a pretty cryptic error 
message like "Bus error". Any suggestions?

Thank you for your help.
Greg Kellum

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus