I hope I'm not being a nuisance but I am currently getting an error when I call csoundScoreEvent().  The error is "invalid instrument number or name".  I am testing with a very simple instrument so I'm not entirely sure what could be wrong.
I am making several assumptions though:

1) I shouldn't need a score file since i am providing score events
2) I can put the score events wherever as long as they are before the csoundPerformKsmps() call

Am I completely screwing this up or is it more subtle?  Thanks again for all of the help.

Balan,


instr 1
a1 oscil p4,p5,p6
out a1
endin


// test app for csound api
#include "csound.hpp"

int main(int argc, char* argv[])
{
    // csound object
    CSOUND* csound = csoundCreate(0);
   
    // init
    csoundInitialize(&argc, &argv, 0);
   
    // compile csound
    int rslt = csoundCompile(csound,argc,argv);
   
    // quick hack to create ftable and p-field values
    MYFLT ftable[5] = {1, 0, 4096, 10, 1};
    MYFLT pvals[6] = {1, 1.0, 1.0, 10000, 440, 1};
   
    // ftable creation seems fine but the call
    // to send the p-fields fails...
    csoundScoreEvent(csound,'f',&ftable[0],5);   
    csoundScoreEvent(csound,'i',&pvals[0],6);
   
    // not sure how this works exactly...
    if(!rslt)
        while(csoundPerformKsmps(csound)==0);
   
    // cleanup
    csoundDestroy(csound);
    return rslt;
}