| #include
static std::string mycsd = ""
"line 1"
"line 2"
"last line";
backend.setCSD(mycsd)
backend.exportForPerformance()
backend.compile()
Hope this helps,
Mike
P.S. Some of the Python examples do this sort of thing, and can easily be ported to C++.
-----Original Message-----
>From: Jonathan Murphy
>Sent: Oct 25, 2007 3:47 AM
>To: csound@lists.bath.ac.uk
>Subject: Re: [Csnd] FLmenu?
>
>> You can keep all your code in just one file. You talk about embedding
>> Csound FLTK code in your Csound orchestra, you can just as easily
>> embed the Csound orchestra and score code in your Python or C++ source
>> code.
>
>You must have read my mind. I was on the point of posting regarding
>embedding a csd in C++. At the moment I'm doing something like this:
>
>Csound *backend;
>CsoundPerformanceThread *perfBackend;
>
>void compileBackend(void)
>{
> backend = new Csound();
> backend->PreCompile();
> backend->Compile("backend.csd");
> perfBackend = new CsoundPerformanceThread(backend);
> perfBackend->TogglePause();
>}
>
>I'd like to embed the csd in the source code, so that it becomes part
>of the binary (figure that in the long term this will make
>installation easier), but the Compile() methods seem to require the
>existence of an external file. How do I get around that?
>
>Thanks in advance,
>Jonathan.
>--
>Send bugs reports to this list.
>To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
|