Csound Csound-dev Csound-tekno Search About

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

Date2009-04-12 01:06
Frommichael.gogins@gmail.com
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Setting options/orc/sco using csound.h
I use both C++ and Python extensively. I have so far (always, always, "so 
far," after 25 years of music programming) found it expedient to use C++ by 
default, but Python for anything where I code it once and use it once (more 
or less "once"), like musical compositions.

This may change. From time to time, I think about how unwieldy the whole 
Csound/Python system is becoming, and consider switching to composing in 
C++. Then again, I think about switching to Lua, which can be used with a 
just in time compiler that runs 1/3 to 1/10 as fast as C++ (and a lot faster 
than Python), or Haskell, or something.

If it ain't broke, don't fix it; so I'm sticking with contributing to Csound 
for stuff that will be re-used, and using Python for composing.

For now.

So far.

Regards,
Mike
----- Original Message ----- 
From: "Chuckk Hubbard" 
To: 
Sent: Saturday, April 11, 2009 6:59 PM
Subject: [Csnd] Re: Re: Re: Re: Re: Re: Setting options/orc/sco using 
csound.h


I see now that I explained none of this in my original post.  I can
see the list on Mac, but I can't redirect the output to Python,
something to do with setPythonMessageCallback().  I have yet to try
compiling anything in C++ on Mac, but I'm always optimistic, sometimes
sarcastically so.
Thanks very much for the audio devices script, my mouth is watering already.
As for using Python, I found it simpler to learn, and as of now I can
code much faster in Python (I learned to use both Python and C++ since
starting this project), and it's now a big bunch of code.  I can see
lots of flaws in it that I didn't consider before, so I might just
convert it some day and replace them with new flaws.  A self-contained
application would be very very nice too.
-Chuckk

On Sat, Apr 11, 2009 at 10:38 PM,   wrote:
> Okay, I wasn't aware that you could get your list of interfaces on Windows
> and Linux, but not on the Mac. Why is that? Sorry I'm not a Mac expert, 
> I'm
> just curious.
>
> You can use ctypes to do exactly what we did in the example program, only
> from Python. For that matter, you can use ctypes to call into whatever 
> audio
> interface libraries you have available on your system, or into PortAudio,
> for example. On Windows, you can use ctypes and Python to directly get a
> list of available audio interfaces. I enclose a script that does just 
> that;
> perhaps it can serve as an introduction to the use of ctypes.
>
> You could do the same thing on any other system where the audio interface
> descriptions are available from a shared library (this usually means the
> operating system, also).
>
> On the other hand, why use Python? Why not use C++ directly for your whole
> project, since you know it? You would have a lot more power that way, a
> self-contained application, and more efficiency.
>
> Regards,
> Mike
>
>
> ----- Original Message ----- From: "Chuckk Hubbard"
> 
> To: 
> Sent: Saturday, April 11, 2009 2:22 PM
> Subject: [Csnd] Re: Re: Re: Re: Setting options/orc/sco using csound.h
>
>
> It helps a great deal, especially the comments. I wasn't trying to
> make sound, myself, I just want to get a list of available -odac
> values, by specifying one that doesn't work. I can do this using
> Python for Windows and Linux, but not Mac. I still have to make the
> part that captures and parses the output; probably just send the whole
> output back to Python, since I already have the code to parse it.
>
> I didn't realize I had two CppSound instances, and I saw on looking
> again that I used both the C++ and Python initializing commands:
> CppSound cs;
> and later
> cs = CppSound();
> taking out the Python one fixes that traceback. I guess I was
> thinking of declaring and later initializing. I really do know better
> than that, it just slipped past me.
>
> The reason for -+rtaudio without a module is that argv[1] is going to
> be the module to check for DACs, called from Python when the user
> selects a module.
>
>> Thanks for the stimulus to produce a working example of how to use C++ in
>> a
>> very simple way with Csound.
>
> Glad I could contribute, in my own oblivious way.
>
> -Chuckk
>
> On Sat, Apr 11, 2009 at 6:58 PM,  wrote:
>>
>> I've taken the liberty of rewriting your example pretty completely. I
>> wanted
>> the example to produce a real sound, I wanted it to link with just a
>> regular
>> installation of Csound (not a build setup), and I wanted the code to be 
>> as
>> simple and clear as possible.
>>
>> I have included an SConstruct file that builds the example on my
>> MinGW/MSys
>> setup using only the headers and libraries installed by the Windows 
>> Csound
>> installer. And, I have added comments to both the SConstruct file and the
>> source code file. My build of the example compiles without errors,
>> produces
>> a real-time sound, and exits without any errors or backtraces.
>>
>> I don't know specifically why you were getting a backtrace. Possibly
>> because
>> you have two instances of CppSound in your program, when only one is
>> required. Or possibly because you specify -+rtaudio without the name of 
>> an
>> rtaudio module.
>>
>> Thanks for the stimulus to produce a working example of how to use C++ in
>> a
>> very simple way with Csound.
>>
>> Hope this helps,
>> Mike
>>
>> ----- Original Message ----- From: "Chuckk Hubbard"
>> 
>> To: 
>> Sent: Saturday, April 11, 2009 9:31 AM
>> Subject: [Csnd] Re: Re: Setting options/orc/sco using csound.h
>>
>>
>> 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
>>
>> 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
>
>
> 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


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
csound" 


Date2009-04-12 08:16
FromBrian Redfern
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Setting options/orc/sco using csound.h
I bet it wouldn't be hard to add Scala language support to Blue so
that you could choose to do lisp style programming, or jython or
javascript, all within blue. I admit to using javascript within Blue
because as a professional web developer, javascript is something I do
all day long at work, so its easier to use the same language I use all
the time to hack with Blue.

I also find it useful to embed python code into csd. But the
particular "holy grail" I'm chasing right now is to write an open
source hip hop album to prove that csound is so flexible that you can
actually use it to make "gangsta music." Not that I'm a gangster now,
but I did a couple of sessions at Death Row Records on guitar in my
whack youth.

On Sat, Apr 11, 2009 at 5:06 PM,   wrote:
> I use both C++ and Python extensively. I have so far (always, always, "so
> far," after 25 years of music programming) found it expedient to use C++ by
> default, but Python for anything where I code it once and use it once (more
> or less "once"), like musical compositions.
>
> This may change. From time to time, I think about how unwieldy the whole
> Csound/Python system is becoming, and consider switching to composing in
> C++. Then again, I think about switching to Lua, which can be used with a
> just in time compiler that runs 1/3 to 1/10 as fast as C++ (and a lot faster
> than Python), or Haskell, or something.
>
> If it ain't broke, don't fix it; so I'm sticking with contributing to Csound
> for stuff that will be re-used, and using Python for composing.
>
> For now.
>
> So far.
>
> Regards,
> Mike
> ----- Original Message ----- From: "Chuckk Hubbard"
> 
> To: 
> Sent: Saturday, April 11, 2009 6:59 PM
> Subject: [Csnd] Re: Re: Re: Re: Re: Re: Setting options/orc/sco using
> csound.h
>
>
> I see now that I explained none of this in my original post.  I can
> see the list on Mac, but I can't redirect the output to Python,
> something to do with setPythonMessageCallback().  I have yet to try
> compiling anything in C++ on Mac, but I'm always optimistic, sometimes
> sarcastically so.
> Thanks very much for the audio devices script, my mouth is watering already.
> As for using Python, I found it simpler to learn, and as of now I can
> code much faster in Python (I learned to use both Python and C++ since
> starting this project), and it's now a big bunch of code.  I can see
> lots of flaws in it that I didn't consider before, so I might just
> convert it some day and replace them with new flaws.  A self-contained
> application would be very very nice too.
> -Chuckk
>
> On Sat, Apr 11, 2009 at 10:38 PM,   wrote:
>>
>> Okay, I wasn't aware that you could get your list of interfaces on Windows
>> and Linux, but not on the Mac. Why is that? Sorry I'm not a Mac expert,
>> I'm
>> just curious.
>>
>> You can use ctypes to do exactly what we did in the example program, only
>> from Python. For that matter, you can use ctypes to call into whatever
>> audio
>> interface libraries you have available on your system, or into PortAudio,
>> for example. On Windows, you can use ctypes and Python to directly get a
>> list of available audio interfaces. I enclose a script that does just
>> that;
>> perhaps it can serve as an introduction to the use of ctypes.
>>
>> You could do the same thing on any other system where the audio interface
>> descriptions are available from a shared library (this usually means the
>> operating system, also).
>>
>> On the other hand, why use Python? Why not use C++ directly for your whole
>> project, since you know it? You would have a lot more power that way, a
>> self-contained application, and more efficiency.
>>
>> Regards,
>> Mike
>>
>>
>> ----- Original Message ----- From: "Chuckk Hubbard"
>> 
>> To: 
>> Sent: Saturday, April 11, 2009 2:22 PM
>> Subject: [Csnd] Re: Re: Re: Re: Setting options/orc/sco using csound.h
>>
>>
>> It helps a great deal, especially the comments. I wasn't trying to
>> make sound, myself, I just want to get a list of available -odac
>> values, by specifying one that doesn't work. I can do this using
>> Python for Windows and Linux, but not Mac. I still have to make the
>> part that captures and parses the output; probably just send the whole
>> output back to Python, since I already have the code to parse it.
>>
>> I didn't realize I had two CppSound instances, and I saw on looking
>> again that I used both the C++ and Python initializing commands:
>> CppSound cs;
>> and later
>> cs = CppSound();
>> taking out the Python one fixes that traceback. I guess I was
>> thinking of declaring and later initializing. I really do know better
>> than that, it just slipped past me.
>>
>> The reason for -+rtaudio without a module is that argv[1] is going to
>> be the module to check for DACs, called from Python when the user
>> selects a module.
>>
>>> Thanks for the stimulus to produce a working example of how to use C++ in
>>> a
>>> very simple way with Csound.
>>
>> Glad I could contribute, in my own oblivious way.
>>
>> -Chuckk
>>
>> On Sat, Apr 11, 2009 at 6:58 PM,  wrote:
>>>
>>> I've taken the liberty of rewriting your example pretty completely. I
>>> wanted
>>> the example to produce a real sound, I wanted it to link with just a
>>> regular
>>> installation of Csound (not a build setup), and I wanted the code to be
>>> as
>>> simple and clear as possible.
>>>
>>> I have included an SConstruct file that builds the example on my
>>> MinGW/MSys
>>> setup using only the headers and libraries installed by the Windows
>>> Csound
>>> installer. And, I have added comments to both the SConstruct file and the
>>> source code file. My build of the example compiles without errors,
>>> produces
>>> a real-time sound, and exits without any errors or backtraces.
>>>
>>> I don't know specifically why you were getting a backtrace. Possibly
>>> because
>>> you have two instances of CppSound in your program, when only one is
>>> required. Or possibly because you specify -+rtaudio without the name of
>>> an
>>> rtaudio module.
>>>
>>> Thanks for the stimulus to produce a working example of how to use C++ in
>>> a
>>> very simple way with Csound.
>>>
>>> Hope this helps,
>>> Mike
>>>
>>> ----- Original Message ----- From: "Chuckk Hubbard"
>>> 
>>> To: 
>>> Sent: Saturday, April 11, 2009 9:31 AM
>>> Subject: [Csnd] Re: Re: Setting options/orc/sco using csound.h
>>>
>>>
>>> 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
>>>
>>> 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
>>
>>
>> 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
>
>
> 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"
>


Date2009-04-14 10:15
FromChuckk Hubbard
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Setting options/orc/sco using csound.h
I'm at a pretty basic level with C++.  I have lots of standard things
to familiarize myself with before/while I undertake a project with it.
 It also looks like the demand from folks with money is for C++, so I
will probably find myself on the same path.  I still haven't started
doing any algorithmic composing, but now that programming "makes
sense" to me, that may be on the list as well.
I've been occasionally reading the existing code for Csound, too.  I
can see some of the ideas in the style and structure, but it'll take a
while.
-Chuckk

On Sun, Apr 12, 2009 at 3:06 AM,   wrote:
> I use both C++ and Python extensively. I have so far (always, always, "so
> far," after 25 years of music programming) found it expedient to use C++ by
> default, but Python for anything where I code it once and use it once (more
> or less "once"), like musical compositions.
>
> This may change. From time to time, I think about how unwieldy the whole
> Csound/Python system is becoming, and consider switching to composing in
> C++. Then again, I think about switching to Lua, which can be used with a
> just in time compiler that runs 1/3 to 1/10 as fast as C++ (and a lot faster
> than Python), or Haskell, or something.
>
> If it ain't broke, don't fix it; so I'm sticking with contributing to Csound
> for stuff that will be re-used, and using Python for composing.
>
> For now.
>
> So far.
>
> Regards,
> Mike
> ----- Original Message ----- From: "Chuckk Hubbard"
> 
> To: 
> Sent: Saturday, April 11, 2009 6:59 PM
> Subject: [Csnd] Re: Re: Re: Re: Re: Re: Setting options/orc/sco using
> csound.h
>
>
> I see now that I explained none of this in my original post.  I can
> see the list on Mac, but I can't redirect the output to Python,
> something to do with setPythonMessageCallback().  I have yet to try
> compiling anything in C++ on Mac, but I'm always optimistic, sometimes
> sarcastically so.
> Thanks very much for the audio devices script, my mouth is watering already.
> As for using Python, I found it simpler to learn, and as of now I can
> code much faster in Python (I learned to use both Python and C++ since
> starting this project), and it's now a big bunch of code.  I can see
> lots of flaws in it that I didn't consider before, so I might just
> convert it some day and replace them with new flaws.  A self-contained
> application would be very very nice too.
> -Chuckk
>
> On Sat, Apr 11, 2009 at 10:38 PM,   wrote:
>>
>> Okay, I wasn't aware that you could get your list of interfaces on Windows
>> and Linux, but not on the Mac. Why is that? Sorry I'm not a Mac expert,
>> I'm
>> just curious.
>>
>> You can use ctypes to do exactly what we did in the example program, only
>> from Python. For that matter, you can use ctypes to call into whatever
>> audio
>> interface libraries you have available on your system, or into PortAudio,
>> for example. On Windows, you can use ctypes and Python to directly get a
>> list of available audio interfaces. I enclose a script that does just
>> that;
>> perhaps it can serve as an introduction to the use of ctypes.
>>
>> You could do the same thing on any other system where the audio interface
>> descriptions are available from a shared library (this usually means the
>> operating system, also).
>>
>> On the other hand, why use Python? Why not use C++ directly for your whole
>> project, since you know it? You would have a lot more power that way, a
>> self-contained application, and more efficiency.
>>
>> Regards,
>> Mike
>>
>>
>> ----- Original Message ----- From: "Chuckk Hubbard"
>> 
>> To: 
>> Sent: Saturday, April 11, 2009 2:22 PM
>> Subject: [Csnd] Re: Re: Re: Re: Setting options/orc/sco using csound.h
>>
>>
>> It helps a great deal, especially the comments. I wasn't trying to
>> make sound, myself, I just want to get a list of available -odac
>> values, by specifying one that doesn't work. I can do this using
>> Python for Windows and Linux, but not Mac. I still have to make the
>> part that captures and parses the output; probably just send the whole
>> output back to Python, since I already have the code to parse it.
>>
>> I didn't realize I had two CppSound instances, and I saw on looking
>> again that I used both the C++ and Python initializing commands:
>> CppSound cs;
>> and later
>> cs = CppSound();
>> taking out the Python one fixes that traceback. I guess I was
>> thinking of declaring and later initializing. I really do know better
>> than that, it just slipped past me.
>>
>> The reason for -+rtaudio without a module is that argv[1] is going to
>> be the module to check for DACs, called from Python when the user
>> selects a module.
>>
>>> Thanks for the stimulus to produce a working example of how to use C++ in
>>> a
>>> very simple way with Csound.
>>
>> Glad I could contribute, in my own oblivious way.
>>
>> -Chuckk
>>
>> On Sat, Apr 11, 2009 at 6:58 PM,  wrote:
>>>
>>> I've taken the liberty of rewriting your example pretty completely. I
>>> wanted
>>> the example to produce a real sound, I wanted it to link with just a
>>> regular
>>> installation of Csound (not a build setup), and I wanted the code to be
>>> as
>>> simple and clear as possible.
>>>
>>> I have included an SConstruct file that builds the example on my
>>> MinGW/MSys
>>> setup using only the headers and libraries installed by the Windows
>>> Csound
>>> installer. And, I have added comments to both the SConstruct file and the
>>> source code file. My build of the example compiles without errors,
>>> produces
>>> a real-time sound, and exits without any errors or backtraces.
>>>
>>> I don't know specifically why you were getting a backtrace. Possibly
>>> because
>>> you have two instances of CppSound in your program, when only one is
>>> required. Or possibly because you specify -+rtaudio without the name of
>>> an
>>> rtaudio module.
>>>
>>> Thanks for the stimulus to produce a working example of how to use C++ in
>>> a
>>> very simple way with Csound.
>>>
>>> Hope this helps,
>>> Mike
>>>
>>> ----- Original Message ----- From: "Chuckk Hubbard"
>>> 
>>> To: 
>>> Sent: Saturday, April 11, 2009 9:31 AM
>>> Subject: [Csnd] Re: Re: Setting options/orc/sco using csound.h
>>>
>>>
>>> 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
>>>
>>> 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
>>
>>
>> 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
>
>
> 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