csound.h and API Questions
Date | 2016-03-23 00:09 |
From | Emmett Palaima |
Subject | csound.h and API Questions |
Hi, I'm trying to do some work with the csound api, running performance threads of csound, but I'm having trouble including the csound.h file referenced in the examples.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Im following this article: http://write.flossmanuals.net/csound/a-the-csound-api/ Does anyone know where I would get that from or what directory to add it to in order to get the examples to work. Additionally, how does one control which csd file is being run in a performance thread? That is not really clear to me from the article. Here is the example I copied and was trying to run, I get the error: 'csound/csound.h file not found #include <stdio.h>
#include <csound/csound.h>
uintptr_t csThread(void *clientData);
typedef struct {
int result;
CSOUND *csound;
int PERF_STATUS;
} userData;
int main(int argc, char *argv[])
{
int finish;
void *ThreadID;
userData *ud;
ud = (userData *)malloc(sizeof(userData));
MYFLT *pvalue;
ud->csound = csoundCreate(NULL);
ud->result = csoundCompile(ud->csound, argc, argv);
if (!ud->result) {
ud->PERF_STATUS = 1;
ThreadID = csoundCreateThread(csThread, (void *)ud);
}
else {
return 1;
}
/* keep performing until user types a number and presses enter */
scanf("%d", &finish);
ud->PERF_STATUS = 0;
csoundDestroy(ud->csound);
free(ud);
return 0;
}
/* performance thread function */
uintptr_t csThread(void *data)
{
userData *udata = (userData *)data;
if (!udata->result) {
while ((csoundPerformKsmps(udata->csound) == 0) &&
(udata->PERF_STATUS == 1));
csoundDestroy(udata->csound);
}
udata->PERF_STATUS = 0;
return 1;
} |
Date | 2016-03-23 07:52 |
From | Francois PINOT |
Subject | Re: csound.h and API Questions |
Have you tried #include <csound.h>? The path to the include files might vary on different platforms. 2016-03-23 1:09 GMT+01:00 Emmett Palaima <epalaima@berklee.edu>:
|
Date | 2016-03-23 09:25 |
From | Peter Burgess |
Subject | Re: csound.h and API Questions |
aswell as which platform, it depends how you acquired csound. If you happen to be on ubuntu (and probably other linux distros too), and it's in the default system location (like it will be if you've installed it via the package manager), you should find it at /usr/local/include/csound/csound.h .Otherwise, you'll have to find where you have put the csound folder, and it'll be at ../csound/include/csound.h .in the later case, you'll have to change to: #include |