| They are very different.
csnd.csoundCreate(args*) returns a Python wrapper for a raw CSOUND pointer. This should be usable with all csnd.csound* functions, passed in as first argument. however, this is a low level function that you probably should not use.
csnd.CppSound() returns a Python wrapper for the CppSound class. This is probably what you should use. I looked at your code, and I find that you are building scores and orchestras in your code. Your code does not work on Windows because of confusions about types of line endings. In the CppSound class there already exists code for doing this sort of thing. CppSound derives from Csound and also from CsoundFile, and CsoundFile contains facilities for managing, building, and parsing out parts from csd files.
You may want to take a look at the API documentation, which you can find in the Windows installers. Also, you can do this in Python to see classes and member functions:
import csnd
help(csnd.CsoundFile)
Hope this helps,
Mike
Regards,
Mike
-----Original Message-----
>From: Chuckk Hubbard
>Sent: Oct 26, 2008 5:57 AM
>To: csound@lists.bath.ac.uk
>Subject: [Csnd] Re: Re: Python API csoundCompile arguments
>
>Ah, I see, that's what I used the first time, I just thought maybe I'd
>find some deeper functionality; the other seemed lower-level. I'd
>like to be able, eventually, to fully integrate the API, so it's
>fairly transparent, so my app controls Csound at a very low level.
>Anyone: Is there no difference between cs = csnd.csoundCreate() and cs
>= csnd.CppSound() in this regard?
>
>-Chuckk
>
>On Sat, Oct 25, 2008 at 6:44 PM, victor wrote:
>> yes, that has changed in the meantime
>> to using the args helper class:
>>
>> def compile(csound, name,args=[]):
>> """Compiles Csound code.
>> csound: csound instance
>> name: CSD filename if given
>> args: list of arguments (as strings)
>> returns 0 if successful , non-zero if not."""
>> arglist = csnd.CsoundArgVList()
>> arglist.Append("csound")
>> arglist.Append(name)
>> for i in args:
>> arglist.Append(i)
>> res = csoundCompile(csound,
>> self.arglist.argc(),self.arglist.argv())
>> return res
>>
>> Regards
>>
>> Victor
>> ----- Original Message ----- From: "Chuckk Hubbard"
>>
>> To: "Csound List"
>> Sent: Saturday, October 25, 2008 1:23 PM
>> Subject: [Csnd] Python API csoundCompile arguments
>>
>>
>>> Hello.
>>> I'm trying an example from Victor's API guide, filename
>>> lac2006_victor_lazzarini.pdf, in Python 2.5, using Csound 5.09.
>>> When I get to:
>>> csnd.csoundCompile(cs, 2, ['csound', 'filename.csd'])
>>> I get:
>>>
>>> TypeError: in method 'csoundCompile', argument 3 of type 'char **'
>>>
>>> It doesn't matter how many brackets I put around it... Is there a way
>>> to get Python to send something that matches char **?
>>>
>>> Thanky.
>>> 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"
|