| When I run the code below, I get an instrument error when SetChannel()
is called. I thought it was just because I'm calling it too soon after
I run InputMessage, but I'm not certain. The error is to do with an
invalid format for strtodk which seems to indicate that the
instruments have been instantiated before SetChannel() is called. I've
attached the instrument code and the .cpp source. If I call the
SetChannel() methods in a loop after the InputMessage() ones
everything works fine.
====================
(...)
while(csound->PerformKsmps()==0)
{
numKsamps++;
if(numKsamps==1)
for(int y=0;y<5;y++)
{
sprintf(scoreStatement, "i5867.0%d 0 3000
\"C:/Users/rory/Documents/CsoundInside/Assets/Audio/loop_%d.wav\"
\"loop%d\"\n", y, y+1, y);
csound->InputMessage(scoreStatement);
sprintf(message, "loop%d", y+1);
csound->SetChannel(message, "Volume:1");
}
}
|