[Csnd] I know a little bit of Python
Date | 2013-05-06 21:47 |
From | Cacophony7 |
Subject | [Csnd] I know a little bit of Python |
I haven't learned it's object-oriented part yet and I was impatient enough to ask you this: What can I do with Python in terms of Csound? Can I write Python instruments? What about Python and blue? -- View this message in context: http://csound.1045644.n5.nabble.com/I-know-a-little-bit-of-Python-tp5722981.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2013-05-06 21:55 |
From | Michael Gogins |
Subject | Re: [Csnd] I know a little bit of Python |
You can't write Python instruments in Csound (yet). Python (or rather, Python running in the Java virtual machine) will run in Blue. You can write Python code that instruments can call using the Python opcodes, but it's not very efficient. You definitely can use Python to do all kinds of algorithmic composition, score generation, etc. Most of my pieces were done this way. You can also use Python to create GUIs for Csound. There are several ways to do this...
Hope this helps, Mike On Mon, May 6, 2013 at 4:47 PM, Cacophony7 <michaelsparks37@gmail.com> wrote: I haven't learned it's object-oriented part yet and I was impatient enough to Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-06 22:49 |
From | Cacophony7 |
Subject | [Csnd] Re: I know a little bit of Python |
Python (or rather, Python running in the Java virtual machine) will run in Blue. I suppose you meant Jython, right? I love blue. Is Jython hard to learn? how does Jython work? -- View this message in context: http://csound.1045644.n5.nabble.com/I-know-a-little-bit-of-Python-tp5722981p5722986.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2013-05-06 23:00 |
From | Steven Yi |
Subject | Re: [Csnd] Re: I know a little bit of Python |
Jython is the interpreter I use in Blue's PythonObject. It is written in Java. I believe it's compatible with Python 2.7 in terms of language. For all intents and purposes, you can approach the PythonObject as coding in regular python, just interpreted by what comes with Blue instead of using python installed on your system. (Also means your projects are cross-platform, and anyone who has Blue can open and run your project without having Python installed). Most of my pieces in the blue/examples/pieces/stevenYi folder use the PythonObject. You can look at those for some ideas. Some of the other pieces by Brian Wong and Dave Seidel also use the PythonObject. steven On Mon, May 6, 2013 at 10:49 PM, Cacophony7 |
Date | 2013-05-06 23:39 |
From | Cacophony7 |
Subject | [Csnd] Re: I know a little bit of Python |
Thanks Steven. I think I'll check out those pieces. -- View this message in context: http://csound.1045644.n5.nabble.com/I-know-a-little-bit-of-Python-tp5722981p5722989.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2013-05-07 05:33 |
From | Cacophony7 |
Subject | [Csnd] Re: I know a little bit of Python |
Michael Gogins-2 wrote > You can't write Python instruments in Csound (yet). Python (or rather, > Python running in the Java virtual machine) will run in Blue. You can > write > Python code that instruments can call using the Python opcodes, but it's > not very efficient. > > You definitely can use Python to do all kinds of algorithmic composition, > score generation, etc. Most of my pieces were done this way. > > You can also use Python to create GUIs for Csound. There are several ways > to do this... > > Hope this helps, > Mike Can't write Python instruments yet? In the blue manual (2.3.0) on page 113 it states that you can use Python code to generate Csound instrument text or you can create a Rhino instrument in JavaScript. -- View this message in context: http://csound.1045644.n5.nabble.com/I-know-a-little-bit-of-Python-tp5722981p5723000.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2013-05-07 09:14 |
From | Mark Brophy |
Subject | Re: [Csnd] Re: I know a little bit of Python |
You can use any language or tool to create a text file that Csound can process. The Python code will be much easier to write and read than the produced file that Csound processes. You can also call Python from Csound.
On Mon, May 6, 2013 at 11:33 PM, Cacophony7 <michaelsparks37@gmail.com> wrote: Michael Gogins-2 wrote |
Date | 2013-05-07 12:50 |
From | Dave Seidel |
Subject | Re: [Csnd] Re: I know a little bit of Python |
Blue's Python Instruments are analogous to blue's PythonObjects. In both cases, the user writes Python code that generates Csound code as text, which is then processed by Csound in the usual way. In the software world, this is called a preprocessor. In blue, you can see the end result of the preprocessing if you generate a CSD to the screen or to a file: pure Csound code. Mike is talking about something different, where one might write Python code that uses the Csound API directly, without any intermediate steps. - Dave On Tue, May 7, 2013 at 12:33 AM, Cacophony7 <michaelsparks37@gmail.com> wrote: Michael Gogins-2 wrote |