[Csnd] Getting Python Score up and running on Windows
Date | 2013-03-18 19:38 |
From | Jacob Joaquin |
Subject | [Csnd] Getting Python Score up and running on Windows |
Hi everybody, So it's been like forever since I've had a chance to do anything Csound related, but I recently found some time to look into getting "Python Score", or Pysco for short, up and running on windows. Here's a quick refresher of what I'm talking about: Python Score is a Python-based Csound score bin script for score generation and processing. The focus of the design is to provide an easy-to-use interface for composers who aren't familiar with Python, but desire features not currently available in the score. Pysco does not limit Python, so as composers learn more about Python, they can incorporate new tricks into their Csounding. Here's a writeup on it: http://codehop.com/introducing-python-score-for-csound/ Now that I have a Windows machine, I was able to dive into and figure out how to make sure the right bin call would work in both Windows and Unix-like environments. And if there are still problems, well, I can trouble shoot them now. Best of all, it seems to work with CsoundQT as well, though using the "Run in Term" option instead of the normal "Run" option. Here's everything needed to get it running: 1) Install Python 2.7. If you haven't done so, this is the tutorial I followed: http://www.aaronstannard.com/post/2012/08/17/How-to-Setup-a-Proper-Python-Environment-on-Windows.aspx I only did steps 1 and 2. And here's a better explanation for changing the path in Windows 8 for step 2. http://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/ 2) Getting and Installing the Csound CSD framework. Two ways of going about this. You can download the zip: https://github.com/jacobjoaquin/csd/archive/master.zip Or if you have git, clone it in the command line (cmd.exe): git clone git@github.com:jacobjoaquin/csd.git Then using the command line, cd into csd and run: python setup.py install 3) Run an example. If you are using CsoundQT, the files are in csd\demo\pysco. Start by open test.csd and clicking the "Run in Term" button. Or if you're in the command, change to the directory about and run it with "csound test.csd". ... And that should hopefully do it. And it only took me 11 or so months to get this happening. :) If you just want to hear the samples and see the code, here's a set a Soundcloud and a link to the folder of all the CSD examples: https://soundcloud.com/jacobjoaquin/sets/csound-python-score https://github.com/jacobjoaquin/csd/tree/master/demo/pysco Best, Jake |
Date | 2013-04-17 19:38 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Forgive me if this has already been covered. I'm trying to run the test.csd in winxound and get this error: python: can't open file 'pysco.py': [Errno 2] No such file or directory
I then tried this in the terminal: 'python pysco.py' and get the same error.
What am I doing wrong? Should I include the full path to the file?
Thanks Peiman Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 18 March 2013 19:38, Jacob Joaquin <jacobjoaquin@gmail.com> wrote: Hi everybody, |
Date | 2013-04-17 19:40 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
OK, I just tried the full path and now get this: Creating /tmp/csound-nzfnKy.ext (0x7fff7c702f78)
Traceback (most recent call last): File "/Users/peimankhosravi/Downloads/csd-master/demo/pysco/pysco.py", line 169, in <module>
main() File "/Users/peimankhosravi/Downloads/csd-master/demo/pysco/pysco.py", line 165, in main with open('_pysco.sco', 'w') as f:
IOError: [Errno 13] Permission denied: '_pysco.sco' External generation failed Reading CSD failed ... stopping
------- Compiler Ended ------- On 17 April 2013 19:38, peiman khosravi <peimankhosravi@gmail.com> wrote:
|
Date | 2013-04-17 20:04 |
From | Jacob Joaquin |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Can you try running this file to see if it works? Depending on when you downloaded the CSD module, you may need to grab a newer copy and reinstall:
There have been major changes to the way PythonScore works. It is now a proper sub-module of CSD rather than a script. The examples in /csd/demo/pysco uses the old pysco script. While these should technically still work, consider these deprecated. I'm in the process of converting these examples into the new PythonScore format. Everything in the subfolder of /csd/examples/ is current and should run, though there isn't much in there yet. I'll try and get more files in there soon. One quick note about trying to run these in CsoundQT. In my experience, they won't play if you use the "Run" button, but will play using the "Run in Term" button.
On Wed, Apr 17, 2013 at 11:40 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
codehop.com | #code #art #music |
Date | 2013-04-17 20:14 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Thanks Jacob, With the latest version I just downloaded it's working! Also in winXound. Amazing. This is a revelation, really. Thanks for the help. Peiman Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 20:04, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
|
Date | 2013-04-17 20:16 |
From | Jacob Joaquin |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
And thank you for testing it out. It's a major help. If you have any questions or issues, please ask away. On Wed, Apr 17, 2013 at 12:14 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
codehop.com | #code #art #music |
Date | 2013-04-17 20:19 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Trust me, I will. I'm going to have much fun with it this week. I have always really wanted to be able to use python to generate score directly in my Csound editor. Now it's possible. I'm going to read the manual tonight but I suppose it is possible to use this in conjunction with pmask or any other library right? Thanks P Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 20:16, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
|
Date | 2013-04-17 20:21 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Next, it's be amazing if Stefano supported the syntax so that after <CsScore bin="python"> the editor is in the python syntax highlighting mode. Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 20:19, peiman khosravi <peimankhosravi@gmail.com> wrote:
|
Date | 2013-04-17 20:22 |
From | Jacob Joaquin |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
In theory, it should work with pmask. I'll look into it later today. I can confirm that I've gotten it to work with csbeats. On Wed, Apr 17, 2013 at 12:19 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
codehop.com | #code #art #music |
Date | 2013-04-17 20:29 |
From | Jacob Joaquin |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Where can I find the most recent version of pmask? My google-fu isn't so hot today. On Wed, Apr 17, 2013 at 12:22 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
codehop.com | #code #art #music |
Date | 2013-04-17 20:33 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Maybe here? There is a link at the bottom of the page. http://www.csounds.com/ezine/winter2001/pmask/ Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 20:29, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
|
Date | 2013-04-17 20:51 |
From | Steven Yi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Just to note, besides the packages at http://sourceforge.net/projects/pythonsound/, there is a modified version of pmask that comes with Blue (I added some Generators to do functional processing of results of other Generators). Maurizio had changed pmask to omde, and a version of that comes with athenaCL. On Wed, Apr 17, 2013 at 8:33 PM, peiman khosravi |
Date | 2013-04-17 21:59 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Is this tutorial still relevant? Thanks
Peiman Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 20:51, Steven Yi <stevenyi@gmail.com> wrote: Just to note, besides the packages at |
Date | 2013-04-17 22:01 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
I
|
Date | 2013-04-17 22:02 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
I think a basic tutorial for the new release would be really great.
Cheers, P |
Date | 2013-04-17 22:05 |
From | Jacob Joaquin |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
The concepts are still very much valid, but the code is out of date. The only tutorial that exists that is current is this: Amen Break PythonScore Tutorial codehop.com | #code #art #music |
Date | 2013-04-17 22:07 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Great thanks. I just figure out the cue object would now work like this: <CsScore bin="python"> from csd.pysco import PythonScore from random import choice score = PythonScore() cue = score.cue with cue(10): score.i(1, 0, 3) #offset the note onset by 10 seconds score.end(); Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 22:05, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
|
Date | 2013-04-17 22:12 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
Nice! Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 22:07, peiman khosravi <peimankhosravi@gmail.com> wrote:
|
Date | 2013-04-17 22:12 |
From | Jacob Joaquin |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
That's it. Here are the other differences in that old tutorial: score('i 1 0 4 0.707 8.00') becomes score.write('i 1 0 4 0.707 8.00') p_callback('i', 1, 5, lambda x: x * 2) becomes score.p_callback('i', 1, 5, lambda x: x * 2) pmap('i', 1, 4, lambda x: x * 2)
becomes score.pmap('i', 1, 4, lambda x: x * 2) On Wed, Apr 17, 2013 at 2:07 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
codehop.com | #code #art #music |
Date | 2013-04-17 22:14 |
From | peiman khosravi |
Subject | Re: [Csnd] Getting Python Score up and running on Windows |
lovely, thanks very much! Find me here: www.peimankhosravi.co.uk To subscribe to news about my upcoming concerts please follow this link: http://spectralkimia.wordpress.com/ (It only requires ONE step and there will be no annoying posts or unrelated musings.) On 17 April 2013 22:12, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
|