Csound Csound-dev Csound-tekno Search About

[Csnd] a working example of generating CSDs with Python

Date2011-08-02 01:58
FromAdam Puckett
Subject[Csnd] a working example of generating CSDs with Python
Attachmentschords.py  chord_demo.csd  
Hi all,

Here's my first Csound piece generated using Python. It uses a
function called chord, which makes a chord of notes with pitches
stored in cpspch format in a list, and divides the amplitude by the
length of the list of pitches.
There's also a helper function called rest which just adds a specified
duration to the global start variable.

One thing to note about this particular script is that I use a
technique I probably will never use again: the chord function never
actually returns the string to add to the score, as you'll see in the
code, so you can't write:

csd.write(chord(...))

as you would be able to in the opcode helper functions I posted
recently. Also, I know the instrument "needs work"; this is only a
demo, and in a "production" composition I probably wouldn't make such
simple instruments.

Enjoy!

-Adam

Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"