Reading last messages about this topic I hve got a little bit confuse.
I'm beginner and I don't known allmost nothing about Csound... I am just reading books and taking the first exercises but my goal is to learn enogh to be able to play with it also using python.
Could someone explain with easy words how many way are there available to use Csound from a python script and which is the best, more complete I mean, no restriction or features lost?
There are several ways of combining Csound with Python. As far as I know, none of them limit the functionality of Csound or of Python in any way.
There is another method, which embeds a Python script inside a Csound .csd file. This method does not require ctcsound or any external libraries, just Csound and Python. The way it works is that a “bin” attribute of the .csd tag is specified, which can be e.g. “python3.” When Csound detects this attribute during performance, it creates two temporary filenames and then runs the contents of the tag as a Python script, passing the two filenames to Python. That script can read data from sys.argv[0], and should write generated Csound score events to sys.argv[1]. Csound will then read the file named in sys.argv[1] and perform it as a regular Csound score. I have attached a complete working example, with explanatory comments, to this email.
Wow guys, too much ways, it is confusing. I know that sometime more is better than less but here I don't know what I need yet, what is the best to work on.
I'd like to concentrate on a single solution that offers me to manage Csound from a python script like to define an instrument and pass it something to play.
And I would like something that pyinstaller will be able to compile so the users that run my script don't need to have Csound installed. Just that.