[Csnd] Csound API - Passing a CSD as string?
Date | 2010-07-23 22:32 |
From | Jacob Joaquin |
Subject | [Csnd] Csound API - Passing a CSD as string? |
I'm using the Csound API with Java / Processing. Is there anyway to pass a CSD as a string to either an instance of Csound or CppSound and use it in a performance thread without ever having to reference an external Csd file? Best, Jake |
Date | 2010-07-24 00:58 |
From | Michael Gogins |
Subject | [Csnd] Re: Csound API - Passing a CSD as string? |
Yes, but. CppSound.setCSD() will do, but you must call exportForPerformance() before compile() and perform(). There are examples. MKG from cell phone On Jul 23, 2010 5:33 PM, "Jacob Joaquin" <jacobjoaquin@gmail.com> wrote: |
Date | 2010-07-24 01:21 |
From | Jacob Joaquin |
Subject | [Csnd] Re: Re: Csound API - Passing a CSD as string? |
On Fri, Jul 23, 2010 at 4:58 PM, Michael Gogins |
Date | 2010-07-24 01:21 |
From | Steven Yi |
Subject | [Csnd] Re: Csound API - Passing a CSD as string? |
In blue I create a temp file (the file api in Java can create one for you that will clean itself up when the program quits), write the csd out to it, then run csound. Is there an issue with doing this in your project or is it more of an api design question? On 7/23/10, Jacob Joaquin |
Date | 2010-07-24 01:49 |
From | Michael Gogins |
Subject | [Csnd] Re: Re: Re: Csound API - Passing a CSD as string? |
Your CSD needs to have one line containing a complete Csound command with filenames and all. Regards, Mike3 On Fri, Jul 23, 2010 at 8:21 PM, Jacob Joaquin |
Date | 2010-07-24 01:52 |
From | Jacob Joaquin |
Subject | [Csnd] Re: Re: Re: Re: Csound API - Passing a CSD as string? |
On Fri, Jul 23, 2010 at 5:49 PM, Michael Gogins |
Date | 2010-07-24 02:00 |
From | Michael Gogins |
Subject | [Csnd] Re: Re: Re: Re: Re: Csound API - Passing a CSD as string? |
The whole Csound API arose out of my efforts to create a more efficient composing environment for myself. I wanted .orc and .sco files to be left after each rendering so that I could construct pieces even if I lost the score generating code. This actually happened several times (I make lots of pieces and sometimes go back to ones I did years and years ago). If you do not care for this behavior, you can build the CSD file programmatically, then just save the CSD to a temporary file and render that, and Csound will run normally and the temporary files will be deleted. You can then make your program delete the temporary .csd file. Regards, Mike On Fri, Jul 23, 2010 at 8:52 PM, Jacob Joaquin |
Date | 2010-07-24 02:01 |
From | Jacob Joaquin |
Subject | [Csnd] Re: Re: Csound API - Passing a CSD as string? |
> Is there an issue with doing this in your > project or is it more of an api design question? A combination of both. To make a long story short, I'm looking into the practicality of using Processing as a platform for developing little synth/music-machine front-ends for Csound. My problem is with relative and absolute paths with Processing. There might be a way around it, but I'm trying to side step the issue first by doing away with having to specify a file. So now it's a bit of a mental exercise. (What's the point of having the function CppSound.setCsd() if I still have to specify a file anyways?) I'll go into more detail later when I have time. I'm out the door. Best, Jake |
Date | 2010-07-24 02:08 |
From | Michael Gogins |
Subject | [Csnd] Re: Re: Re: Csound API - Passing a CSD as string? |
I agree with you actually. I couldn't find a way around it that satisfied me. Let me know if you figure it out, or have a suggestion. The whole problem would be solved if Csound could render from a CSD file in memory -- a big string. I'm sure this is possible, I just never took the trouble to figure it out since the current behavior is not a big problem for me, more of an esthetic annoyance. Regards, Mike On Fri, Jul 23, 2010 at 9:01 PM, Jacob Joaquin |