Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Setting options/orc/sco using csound.h

Date2009-04-11 13:30
Frommichael.gogins@gmail.com
Subject[Csnd] Re: Setting options/orc/sco using csound.h
Nope.

The CsoundFile class, which is one of the classes from which CppSound 
derives, contains in memory the Csound orchestra, score, and command line 
(hence the need for the exportForPerformance() call before rendering). The 
Csound class declared in csound.hpp, on the other hand, only deals with 
Csound files on the disk.

The CsoundFile class was developed by me for use in CsoundVST. VST songs are 
required to contain all data for plugin patches in memory, hence I needed to 
store the Csound orchestra or csd file in memory, hence CsoundFile.

If, for some reason, you do not wish to, or cannot, use CppSound, then you 
can maintain your own copy of the Csound csd file or its parts in memory 
using your own code, and save them to the disk before using the Csound class 
to render them.

But why not just use CppSound? This is exactly what it is designed for, and 
as far as I can see it works just fine.

The CppSound class also derives from the Csound class, so anything you can 
do with the Csound class you can also do with CppSound.

Hope this helps,
Mike

----- Original Message ----- 
From: "Chuckk Hubbard" 
To: "Csound List" 
Sent: Saturday, April 11, 2009 6:40 AM
Subject: [Csnd] Setting options/orc/sco using csound.h


> Hello.
> I want to pass a string to a Csound instance using C++, either to
> "setCSD" or to individually set Command, Orchestra, and Score.  It
> appears the standard input arguments for the functions in csound.h and
> csound.hpp expect filenames.  csnd.h, on the other hand, has the
> CppSound class, which is derived from CsoundFile, which has the
> 'setCSD', etc. functions.  Is there a way to emulate the .setCSD()
> method with the classes in csound.h/csound.hpp?
>
> -Chuckk
>
> -- 
> http://www.badmuthahubbard.com
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound"
> 


Date2009-04-11 14:31
FromChuckk Hubbard
Subject[Csnd] Re: Re: Setting options/orc/sco using csound.h
Attachmentscmd.txt  test2.cpp  
Hi Mike.
Thanks a lot for the info (and the class).  I just signed on to report
that I had found the answer in your refman.pdf, to include CppSound.h
and link to libcsound and lib_csnd.

I'm getting a pretty big backtrace, though, and Csound is aborting
from the attached test2.cpp compiled with the attached g++ command.  I
don't think I did anything wrong with the CppSound part.  I cobbled
together the string manipulations from several folks' suggestions, but
everything runs fine if I comment out cs.compile().
The program is meant to be run simply with an argument of the name of
a real-time module, e.g. portaudio.

Can anyone spot what I'm doing wrong?  (in this program specifically,
not in my life in general)

-Chuckk

On Sat, Apr 11, 2009 at 3:30 PM,   wrote:
> Nope.
>
> The CsoundFile class, which is one of the classes from which CppSound
> derives, contains in memory the Csound orchestra, score, and command line
> (hence the need for the exportForPerformance() call before rendering). The
> Csound class declared in csound.hpp, on the other hand, only deals with
> Csound files on the disk.
>
> The CsoundFile class was developed by me for use in CsoundVST. VST songs are
> required to contain all data for plugin patches in memory, hence I needed to
> store the Csound orchestra or csd file in memory, hence CsoundFile.
>
> If, for some reason, you do not wish to, or cannot, use CppSound, then you
> can maintain your own copy of the Csound csd file or its parts in memory
> using your own code, and save them to the disk before using the Csound class
> to render them.
>
> But why not just use CppSound? This is exactly what it is designed for, and
> as far as I can see it works just fine.
>
> The CppSound class also derives from the Csound class, so anything you can
> do with the Csound class you can also do with CppSound.
>
> Hope this helps,
> Mike
>
> ----- Original Message ----- From: "Chuckk Hubbard"
> 
> To: "Csound List" 
> Sent: Saturday, April 11, 2009 6:40 AM
> Subject: [Csnd] Setting options/orc/sco using csound.h
>
>
>> Hello.
>> I want to pass a string to a Csound instance using C++, either to
>> "setCSD" or to individually set Command, Orchestra, and Score.  It
>> appears the standard input arguments for the functions in csound.h and
>> csound.hpp expect filenames.  csnd.h, on the other hand, has the
>> CppSound class, which is derived from CsoundFile, which has the
>> 'setCSD', etc. functions.  Is there a way to emulate the .setCSD()
>> method with the classes in csound.h/csound.hpp?
>>
>> -Chuckk
>>
>> --
>> http://www.badmuthahubbard.com
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>



-- 
http://www.badmuthahubbard.com