Csound Csound-dev Csound-tekno Search About

[Cs-dev] CppSound and CsoundPerformanceThread..

Date2008-01-31 15:31
FromRory Walsh
Subject[Cs-dev] CppSound and CsoundPerformanceThread..
CppSound and CsoundPerformanceThread work fine for me until I try the 
setCSD() and exportForPerformance() methods. What am I missing from the 
code below?

Rory.



int main()
{
std::string csdText = " \
 \
-odevaudio -b10 -idevaudio \
 \
 \
sr = 44100 \
kr = 44100 \
ksmps = 1 \
nchnls = 1 \
instr 1 \
a1 oscil 10000, 440, 1 \
out a1 \
endin  \
  \
 \
f1 0 1024 10 1 \
i1 0 100   \
 \
";

CppSound csound;
csound.PreCompile();
csound.setCSD(csdText);
csound.exportForPerformance();

/*works with the standard compile method
csound.Compile("basic1.csd");*/

CsoundPerformanceThread thread(csound.getCsound());
thread.Play();
while(!thread.GetStatus());
}

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:00
FromJonatan Liljedahl
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
Perhaps this is not at all the problem, but isn't the string constant
below missing newlines? Try with "\n\" instead of "\"?

Rory Walsh wrote:
> CppSound and CsoundPerformanceThread work fine for me until I try the 
> setCSD() and exportForPerformance() methods. What am I missing from the 
> code below?
> 
> Rory.
> 
> 
> 
> int main()
> {
> std::string csdText = " \
>  \
> -odevaudio -b10 -idevaudio \
>  \
>  \
> sr = 44100 \
> kr = 44100 \
> ksmps = 1 \
> nchnls = 1 \
> instr 1 \
> a1 oscil 10000, 440, 1 \
> out a1 \
> endin  \
>   \
>  \
> f1 0 1024 10 1 \
> i1 0 100   \
>  \
> ";
> 
> CppSound csound;
> csound.PreCompile();
> csound.setCSD(csdText);
> csound.exportForPerformance();
> 
> /*works with the standard compile method
> csound.Compile("basic1.csd");*/
> 
> CsoundPerformanceThread thread(csound.getCsound());
> thread.Play();
> while(!thread.GetStatus());
> }


-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:03
FromRory Walsh
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
Your right, I should be using adding new lines, but that still doesn't 
solve the problem. Mike should be able to tell me what teh problem is. 
Cheers,

Rory.


Jonatan Liljedahl wrote:
> Perhaps this is not at all the problem, but isn't the string constant
> below missing newlines? Try with "\n\" instead of "\"?
> 
> Rory Walsh wrote:
>> CppSound and CsoundPerformanceThread work fine for me until I try the 
>> setCSD() and exportForPerformance() methods. What am I missing from the 
>> code below?
>>
>> Rory.
>>
>>
>>
>> int main()
>> {
>> std::string csdText = " \
>>  \
>> -odevaudio -b10 -idevaudio \
>>  \
>>  \
>> sr = 44100 \
>> kr = 44100 \
>> ksmps = 1 \
>> nchnls = 1 \
>> instr 1 \
>> a1 oscil 10000, 440, 1 \
>> out a1 \
>> endin  \
>>   \
>>  \
>> f1 0 1024 10 1 \
>> i1 0 100   \
>>  \
>> ";
>>
>> CppSound csound;
>> csound.PreCompile();
>> csound.setCSD(csdText);
>> csound.exportForPerformance();
>>
>> /*works with the standard compile method
>> csound.Compile("basic1.csd");*/
>>
>> CsoundPerformanceThread thread(csound.getCsound());
>> thread.Play();
>> while(!thread.GetStatus());
>> }
> 
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:07
FromCesare Marilungo
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
Hi Rory,

So far I have used the api only from python. So, I don't know if I can 
help you.

Anyway, I would have done:

CppSound csound;
csound.setCSD(csdText);
csound.exportForPerformance();
csound.compile();
...


Best,

-c.

Rory Walsh wrote:
> CppSound and CsoundPerformanceThread work fine for me until I try the 
> setCSD() and exportForPerformance() methods. What am I missing from the 
> code below?
>
> Rory.
>
>
>
> int main()
> {
> std::string csdText = " \
>  \
> -odevaudio -b10 -idevaudio \
>  \
>  \
> sr = 44100 \
> kr = 44100 \
> ksmps = 1 \
> nchnls = 1 \
> instr 1 \
> a1 oscil 10000, 440, 1 \
> out a1 \
> endin  \
>   \
>  \
> f1 0 1024 10 1 \
> i1 0 100   \
>  \
> ";
>
> CppSound csound;
> csound.PreCompile();
> csound.setCSD(csdText);
> csound.exportForPerformance();
>
> /*works with the standard compile method
> csound.Compile("basic1.csd");*/
>
> CsoundPerformanceThread thread(csound.getCsound());
> thread.Play();
> while(!thread.GetStatus());
> }
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>   


-- 
www.cesaremarilungo.com 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:15
FromRory Walsh
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
Thanks Cesare. I forgot about compiling. Anyhow that still doesn't work, 
instead csound gives me a message saying "Csound Command ERROR:   no 
orchestra name". I'd assumed that using setCSD() and 
exportForPerformance() would mean that I don't need to pass a name.

Rory.



Cesare Marilungo wrote:
> Hi Rory,
> 
> So far I have used the api only from python. So, I don't know if I can 
> help you.
> 
> Anyway, I would have done:
> 
> CppSound csound;
> csound.setCSD(csdText);
> csound.exportForPerformance();
> csound.compile();
> ...
> 
> 
> Best,
> 
> -c.
> 
> Rory Walsh wrote:
>> CppSound and CsoundPerformanceThread work fine for me until I try the 
>> setCSD() and exportForPerformance() methods. What am I missing from the 
>> code below?
>>
>> Rory.
>>
>>
>>
>> int main()
>> {
>> std::string csdText = " \
>>  \
>> -odevaudio -b10 -idevaudio \
>>  \
>>  \
>> sr = 44100 \
>> kr = 44100 \
>> ksmps = 1 \
>> nchnls = 1 \
>> instr 1 \
>> a1 oscil 10000, 440, 1 \
>> out a1 \
>> endin  \
>>   \
>>  \
>> f1 0 1024 10 1 \
>> i1 0 100   \
>>  \
>> ";
>>
>> CppSound csound;
>> csound.PreCompile();
>> csound.setCSD(csdText);
>> csound.exportForPerformance();
>>
>> /*works with the standard compile method
>> csound.Compile("basic1.csd");*/
>>
>> CsoundPerformanceThread thread(csound.getCsound());
>> thread.Play();
>> while(!thread.GetStatus());
>> }
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>   
> 
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:18
FromCesare Marilungo
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
No, I think you should pass two names for the temp .orc and .sco files 
it will create. You should add them in the  tag of your csd 
string.

-c.

Rory Walsh wrote:
> Thanks Cesare. I forgot about compiling. Anyhow that still doesn't work, 
> instead csound gives me a message saying "Csound Command ERROR:   no 
> orchestra name". I'd assumed that using setCSD() and 
> exportForPerformance() would mean that I don't need to pass a name.
>
> Rory.
>
>
>
> Cesare Marilungo wrote:
>   
>> Hi Rory,
>>
>> So far I have used the api only from python. So, I don't know if I can 
>> help you.
>>
>> Anyway, I would have done:
>>
>> CppSound csound;
>> csound.setCSD(csdText);
>> csound.exportForPerformance();
>> csound.compile();
>> ...
>>
>>
>> Best,
>>
>> -c.
>>
>> Rory Walsh wrote:
>>     
>>> CppSound and CsoundPerformanceThread work fine for me until I try the 
>>> setCSD() and exportForPerformance() methods. What am I missing from the 
>>> code below?
>>>
>>> Rory.
>>>
>>>
>>>
>>> int main()
>>> {
>>> std::string csdText = " \
>>>  \
>>> -odevaudio -b10 -idevaudio \
>>>  \
>>>  \
>>> sr = 44100 \
>>> kr = 44100 \
>>> ksmps = 1 \
>>> nchnls = 1 \
>>> instr 1 \
>>> a1 oscil 10000, 440, 1 \
>>> out a1 \
>>> endin  \
>>>   \
>>>  \
>>> f1 0 1024 10 1 \
>>> i1 0 100   \
>>>  \
>>> ";
>>>
>>> CppSound csound;
>>> csound.PreCompile();
>>> csound.setCSD(csdText);
>>> csound.exportForPerformance();
>>>
>>> /*works with the standard compile method
>>> csound.Compile("basic1.csd");*/
>>>
>>> CsoundPerformanceThread thread(csound.getCsound());
>>> thread.Play();
>>> while(!thread.GetStatus());
>>> }
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>>   
>>>       
>>     
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>   


-- 
www.cesaremarilungo.com 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:28
FromRory Walsh
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
That results in an error saying cannot open orch file temp.orc...


Cesare Marilungo wrote:
> No, I think you should pass two names for the temp .orc and .sco files 
> it will create. You should add them in the  tag of your csd 
> string.
> 
> -c.
> 
> Rory Walsh wrote:
>> Thanks Cesare. I forgot about compiling. Anyhow that still doesn't work, 
>> instead csound gives me a message saying "Csound Command ERROR:   no 
>> orchestra name". I'd assumed that using setCSD() and 
>> exportForPerformance() would mean that I don't need to pass a name.
>>
>> Rory.
>>
>>
>>
>> Cesare Marilungo wrote:
>>   
>>> Hi Rory,
>>>
>>> So far I have used the api only from python. So, I don't know if I can 
>>> help you.
>>>
>>> Anyway, I would have done:
>>>
>>> CppSound csound;
>>> csound.setCSD(csdText);
>>> csound.exportForPerformance();
>>> csound.compile();
>>> ...
>>>
>>>
>>> Best,
>>>
>>> -c.
>>>
>>> Rory Walsh wrote:
>>>     
>>>> CppSound and CsoundPerformanceThread work fine for me until I try the 
>>>> setCSD() and exportForPerformance() methods. What am I missing from the 
>>>> code below?
>>>>
>>>> Rory.
>>>>
>>>>
>>>>
>>>> int main()
>>>> {
>>>> std::string csdText = " \
>>>>  \
>>>> -odevaudio -b10 -idevaudio \
>>>>  \
>>>>  \
>>>> sr = 44100 \
>>>> kr = 44100 \
>>>> ksmps = 1 \
>>>> nchnls = 1 \
>>>> instr 1 \
>>>> a1 oscil 10000, 440, 1 \
>>>> out a1 \
>>>> endin  \
>>>>   \
>>>>  \
>>>> f1 0 1024 10 1 \
>>>> i1 0 100   \
>>>>  \
>>>> ";
>>>>
>>>> CppSound csound;
>>>> csound.PreCompile();
>>>> csound.setCSD(csdText);
>>>> csound.exportForPerformance();
>>>>
>>>> /*works with the standard compile method
>>>> csound.Compile("basic1.csd");*/
>>>>
>>>> CsoundPerformanceThread thread(csound.getCsound());
>>>> thread.Play();
>>>> while(!thread.GetStatus());
>>>> }
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>>   
>>>>       
>>>     
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>   
> 
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:46
FromCesare Marilungo
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
Sounds like you're not calling ExportForPerformance().

Please, try using this exact order:

CppSound csound;
csound.setCSD(csdText);
csound.exportForPerformance();
csound.compile();
CsoundPerformanceThread thread(csound.getCsound());
thread.Play();
while(!thread.GetStatus());

-c.

Rory Walsh wrote:
> That results in an error saying cannot open orch file temp.orc...
>
>
> Cesare Marilungo wrote:
>   
>> No, I think you should pass two names for the temp .orc and .sco files 
>> it will create. You should add them in the  tag of your csd 
>> string.
>>
>> -c.
>>
>> Rory Walsh wrote:
>>     
>>> Thanks Cesare. I forgot about compiling. Anyhow that still doesn't work, 
>>> instead csound gives me a message saying "Csound Command ERROR:   no 
>>> orchestra name". I'd assumed that using setCSD() and 
>>> exportForPerformance() would mean that I don't need to pass a name.
>>>
>>> Rory.
>>>
>>>
>>>
>>> Cesare Marilungo wrote:
>>>   
>>>       
>>>> Hi Rory,
>>>>
>>>> So far I have used the api only from python. So, I don't know if I can 
>>>> help you.
>>>>
>>>> Anyway, I would have done:
>>>>
>>>> CppSound csound;
>>>> csound.setCSD(csdText);
>>>> csound.exportForPerformance();
>>>> csound.compile();
>>>> ...
>>>>
>>>>
>>>> Best,
>>>>
>>>> -c.
>>>>
>>>> Rory Walsh wrote:
>>>>     
>>>>         
>>>>> CppSound and CsoundPerformanceThread work fine for me until I try the 
>>>>> setCSD() and exportForPerformance() methods. What am I missing from the 
>>>>> code below?
>>>>>
>>>>> Rory.
>>>>>
>>>>>
>>>>>
>>>>> int main()
>>>>> {
>>>>> std::string csdText = " \
>>>>>  \
>>>>> -odevaudio -b10 -idevaudio \
>>>>>  \
>>>>>  \
>>>>> sr = 44100 \
>>>>> kr = 44100 \
>>>>> ksmps = 1 \
>>>>> nchnls = 1 \
>>>>> instr 1 \
>>>>> a1 oscil 10000, 440, 1 \
>>>>> out a1 \
>>>>> endin  \
>>>>>   \
>>>>>  \
>>>>> f1 0 1024 10 1 \
>>>>> i1 0 100   \
>>>>>  \
>>>>> ";
>>>>>
>>>>> CppSound csound;
>>>>> csound.PreCompile();
>>>>> csound.setCSD(csdText);
>>>>> csound.exportForPerformance();
>>>>>
>>>>> /*works with the standard compile method
>>>>> csound.Compile("basic1.csd");*/
>>>>>
>>>>> CsoundPerformanceThread thread(csound.getCsound());
>>>>> thread.Play();
>>>>> while(!thread.GetStatus());
>>>>> }
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> This SF.net email is sponsored by: Microsoft
>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>>   
>>>       
>>     
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>   


-- 
www.cesaremarilungo.com 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 16:54
FromRory Walsh
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
That is the order I'm doing it in, the only other thing I'm doing is 
calling PreCompile(), here is my exact code:

CppSound csound;
csound.PreCompile();
csound.setCSD(csdText);
csound.exportForPerformance();
csound.compile();
CsoundPerformanceThread thread(csound.getCsound());
thread.Play();
while(!thread.GetStatus());

The CsOptions section of my csd string looks like this:

temp.orc temp.sco -odevaudio -b10 -idevaudio \n\

Rory.

p.s. I get the same resuls when I leave out the call to precompile()


Cesare Marilungo wrote:
> Sounds like you're not calling ExportForPerformance().
> 
> Please, try using this exact order:
> 
> CppSound csound;
> csound.setCSD(csdText);
> csound.exportForPerformance();
> csound.compile();
> CsoundPerformanceThread thread(csound.getCsound());
> thread.Play();
> while(!thread.GetStatus());
> 
> -c.
> 
> Rory Walsh wrote:
>> That results in an error saying cannot open orch file temp.orc...
>>
>>
>> Cesare Marilungo wrote:
>>   
>>> No, I think you should pass two names for the temp .orc and .sco files 
>>> it will create. You should add them in the  tag of your csd 
>>> string.
>>>
>>> -c.
>>>
>>> Rory Walsh wrote:
>>>     
>>>> Thanks Cesare. I forgot about compiling. Anyhow that still doesn't work, 
>>>> instead csound gives me a message saying "Csound Command ERROR:   no 
>>>> orchestra name". I'd assumed that using setCSD() and 
>>>> exportForPerformance() would mean that I don't need to pass a name.
>>>>
>>>> Rory.
>>>>
>>>>
>>>>
>>>> Cesare Marilungo wrote:
>>>>   
>>>>       
>>>>> Hi Rory,
>>>>>
>>>>> So far I have used the api only from python. So, I don't know if I can 
>>>>> help you.
>>>>>
>>>>> Anyway, I would have done:
>>>>>
>>>>> CppSound csound;
>>>>> csound.setCSD(csdText);
>>>>> csound.exportForPerformance();
>>>>> csound.compile();
>>>>> ...
>>>>>
>>>>>
>>>>> Best,
>>>>>
>>>>> -c.
>>>>>
>>>>> Rory Walsh wrote:
>>>>>     
>>>>>         
>>>>>> CppSound and CsoundPerformanceThread work fine for me until I try the 
>>>>>> setCSD() and exportForPerformance() methods. What am I missing from the 
>>>>>> code below?
>>>>>>
>>>>>> Rory.
>>>>>>
>>>>>>
>>>>>>
>>>>>> int main()
>>>>>> {
>>>>>> std::string csdText = " \
>>>>>>  \
>>>>>> -odevaudio -b10 -idevaudio \
>>>>>>  \
>>>>>>  \
>>>>>> sr = 44100 \
>>>>>> kr = 44100 \
>>>>>> ksmps = 1 \
>>>>>> nchnls = 1 \
>>>>>> instr 1 \
>>>>>> a1 oscil 10000, 440, 1 \
>>>>>> out a1 \
>>>>>> endin  \
>>>>>>   \
>>>>>>  \
>>>>>> f1 0 1024 10 1 \
>>>>>> i1 0 100   \
>>>>>>  \
>>>>>> ";
>>>>>>
>>>>>> CppSound csound;
>>>>>> csound.PreCompile();
>>>>>> csound.setCSD(csdText);
>>>>>> csound.exportForPerformance();
>>>>>>
>>>>>> /*works with the standard compile method
>>>>>> csound.Compile("basic1.csd");*/
>>>>>>
>>>>>> CsoundPerformanceThread thread(csound.getCsound());
>>>>>> thread.Play();
>>>>>> while(!thread.GetStatus());
>>>>>> }
>>>>>>
>>>>>> -------------------------------------------------------------------------
>>>>>> This SF.net email is sponsored by: Microsoft
>>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>     
>>>>>         
>>>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>>   
>>>>       
>>>     
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>   
> 
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-31 17:01
FromCesare Marilungo
SubjectRe: [Cs-dev] CppSound and CsoundPerformanceThread..
Rory Walsh wrote:
> That is the order I'm doing it in, the only other thing I'm doing is 
> calling PreCompile(), here is my exact code:
>
> CppSound csound;
> csound.PreCompile();
> csound.setCSD(csdText);
> csound.exportForPerformance();
> csound.compile();
> CsoundPerformanceThread thread(csound.getCsound());
> thread.Play();
> while(!thread.GetStatus());
>
> The CsOptions section of my csd string looks like this:
>
> temp.orc temp.sco -odevaudio -b10 -idevaudio \n\
>   
I think you should put them after the options:

-odevaudio -b10 -idevaudio temp.orc temp.sco \n\


-c.
> Rory.
>
> p.s. I get the same resuls when I leave out the call to precompile()
>
>
> Cesare Marilungo wrote:
>   
>> Sounds like you're not calling ExportForPerformance().
>>
>> Please, try using this exact order:
>>
>> CppSound csound;
>> csound.setCSD(csdText);
>> csound.exportForPerformance();
>> csound.compile();
>> CsoundPerformanceThread thread(csound.getCsound());
>> thread.Play();
>> while(!thread.GetStatus());
>>
>> -c.
>>
>> Rory Walsh wrote:
>>     
>>> That results in an error saying cannot open orch file temp.orc...
>>>
>>>
>>> Cesare Marilungo wrote:
>>>   
>>>       
>>>> No, I think you should pass two names for the temp .orc and .sco files 
>>>> it will create. You should add them in the  tag of your csd 
>>>> string.
>>>>
>>>> -c.
>>>>
>>>> Rory Walsh wrote:
>>>>     
>>>>         
>>>>> Thanks Cesare. I forgot about compiling. Anyhow that still doesn't work, 
>>>>> instead csound gives me a message saying "Csound Command ERROR:   no 
>>>>> orchestra name". I'd assumed that using setCSD() and 
>>>>> exportForPerformance() would mean that I don't need to pass a name.
>>>>>
>>>>> Rory.
>>>>>
>>>>>
>>>>>
>>>>> Cesare Marilungo wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> Hi Rory,
>>>>>>
>>>>>> So far I have used the api only from python. So, I don't know if I can 
>>>>>> help you.
>>>>>>
>>>>>> Anyway, I would have done:
>>>>>>
>>>>>> CppSound csound;
>>>>>> csound.setCSD(csdText);
>>>>>> csound.exportForPerformance();
>>>>>> csound.compile();
>>>>>> ...
>>>>>>
>>>>>>
>>>>>> Best,
>>>>>>
>>>>>> -c.
>>>>>>
>>>>>> Rory Walsh wrote:
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>>> CppSound and CsoundPerformanceThread work fine for me until I try the 
>>>>>>> setCSD() and exportForPerformance() methods. What am I missing from the 
>>>>>>> code below?
>>>>>>>
>>>>>>> Rory.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> int main()
>>>>>>> {
>>>>>>> std::string csdText = " \
>>>>>>>  \
>>>>>>> -odevaudio -b10 -idevaudio \
>>>>>>>  \
>>>>>>>  \
>>>>>>> sr = 44100 \
>>>>>>> kr = 44100 \
>>>>>>> ksmps = 1 \
>>>>>>> nchnls = 1 \
>>>>>>> instr 1 \
>>>>>>> a1 oscil 10000, 440, 1 \
>>>>>>> out a1 \
>>>>>>> endin  \
>>>>>>>   \
>>>>>>>  \
>>>>>>> f1 0 1024 10 1 \
>>>>>>> i1 0 100   \
>>>>>>>  \
>>>>>>> ";
>>>>>>>
>>>>>>> CppSound csound;
>>>>>>> csound.PreCompile();
>>>>>>> csound.setCSD(csdText);
>>>>>>> csound.exportForPerformance();
>>>>>>>
>>>>>>> /*works with the standard compile method
>>>>>>> csound.Compile("basic1.csd");*/
>>>>>>>
>>>>>>> CsoundPerformanceThread thread(csound.getCsound());
>>>>>>> thread.Play();
>>>>>>> while(!thread.GetStatus());
>>>>>>> }
>>>>>>>
>>>>>>> -------------------------------------------------------------------------
>>>>>>> This SF.net email is sponsored by: Microsoft
>>>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>     
>>>>>>         
>>>>>>             
>>>>> -------------------------------------------------------------------------
>>>>> This SF.net email is sponsored by: Microsoft
>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>>   
>>>       
>>     
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>   


-- 
www.cesaremarilungo.com 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net