Cursing the darkness: complaints/comments/observations on the Csound examples/ folder

Before I start this rant, let me emphasize that I have nothing but gratitude and admiration for all the volunteer programmers and musicians who are responsible for Csound. And that I realize it’s a huge collection of software with pieces up to 20 years old. So even though some of my comments may seem a bit … testy … I’m intending for them to be helpful.

The first place you should go to after installing Csound is Mike Gogins’ essential and excellent tutorial PDF (in the tutorial/ subdirectory, fortunately. It has been invaluable to me.  (Note to Mac and Linux users: that the portions of the install chapter relating to those OSs are still to be written.) That said, I still reserve the right to be frustrated when, mostly on my own, I’m trying to figure out how to use Csound effectively. So of course, the first place the newbie would start researching would be amongst the example files.

So, I trawled through the examples/ subdirectory that gets installed with Csound. May I have a moment for a brief rant here? Here are thousands of lines of carefully crafted code and data files. Among all those lines are practically NO comments which would point a newbie at resources that would help him run or understand the code offered. So I present my notes on them for what they’re worth.

The comments below assume that you have at least minimally succeeded in getting some simple Csound compositions to execute (either to create an audio output file or in real time). Before trying to execute these examples, I installed the Python 2.4 package. IDLE is the “shell” which you can use to write, run and debug Python programs and scripts.

Another hint: on my PC, using csound5gui to run Csound compositions (either .csd files or .orc/.sco pairs) has the benefit that the editor will highlight the various parts of the language in different colors. CsoundVST has its own features, but it is required if you’re running a python script.

—————————

.#am.csd.1.1
.#keys.py.1.4.#Koch.py.1.18.#Koch.py.1.19.#Lindenmayer.py.1.13.#Lindenmayer.py.1.16.#Orbifold.py.1.11.#oscilloscope.py.1.1

.#shapes.csd.1.1

.#StrangeAtrractor.py.1.6

.#trapped-high-resolution.csd.1.2

.#trapped.csd.1.10

I have no idea what the hell those are or why they're there.

---------------------------

a.lindenmayer
b.lindenmayer
Lindenmayer.py

The “.lindenmayer” files consist of hundreds of lines that look like this

...
b [ Ti-1 a b ] Tt+1 Tk-3.1 a N b Tt+3 N Tt+1.3 Tk+2 b [ Ti+1 a b ] N
[
Ti-1
N Tt+1.1 Tk+1 N [ Tk+2 b ] Tk+3 N Tk-3 Tt-1 [ Tt+1 Tk-4 a ] N
b [ Ti-1 a b ] Tt+1 Tk-3.1 a N b Tt+3 N Tt+1.3 Tk+2 b [ Ti+1 a b ] N
...

Why couldn’t there be a subdirectory for all the pieces of this example?

—————————

am.csd
am.csd~
athena.py

Trying to run this one from python gives: “ImportError: No module named athenaCL” Well, THAT figures. The comments give no assistance beyond:

# Shows how to script athenaCL with Csound 5.

—————————

bilbar.csd
cb.csd
cb.py

Don’t know.

—————————

CsoundMidi.csd
CsoundVST-nomixer-flags.csd
CsoundVST-nomixer.csd
CsoundVST.csd

CsoundVST.csd is the “Silence Orchestra”. It’s a Csound orchestra with several dozen instruments already created in it that you can use sort of like a synthesizer.

—————————

csoundvst.cpr
scoregen.cpr

Not sure what these are; some kind of output from some score generator utility?

—————————

date.csd
demix.py
display.py
display.pyc
fl.csd
GeneralMidi.py
HelloWorld.py
keys.csd
keys.py
keys.py~

Some simple demo programs.

—————————

koch-vst.py
Koch.py

This run actually runs without difficulty. All you have to do is launch CsoundVST, select python mode, import Koch.py, and select “Perform.” It will then create a file called Koch.wav. (koch-vst.py is the algorithm itself in python, Koch.py wraps the csound calls around it.)

—————————

lua_example.lua

Apparently there is a language called lua that this is an example for, but it doesn’t seem to be very widely used; you’re really on your own with this one.

—————————

Orbifold.py

This was really frustrating to try to figure out. The main problem was an include of something called visual and numpy. A web search finally unearthed that there was something called “vpython” which I think this example requires. No comments or other explanation inside the file of course.

—————————

osc.csd
oscilloscope.py
osclisten.csd
pfield.csd
pvsbus.c
pvsbus.csd
python_callback.py

More demo programs of various self-explanatoriness.

—————————

shapes.csd
shapes.csd~
shapes.py

Haven’t tried to do anything with these.

—————————

StrangeAtrractor.py
StrangeAttractor.orc
StrangeAttractor.sco

This looked interesting so it took some delving to figure out. The comments only read:

# Tutorial demonstrating a MusicModel composition
# based on translating the orbit of a chaotic attractor to a score.

I.e., another IQ test for the hapless beginner. Trying to run it in IDLE or CsoundVST just gave a cryptic crash. The first thing I learned was that CsoundVST.csd had to be found by the csound.load statement in the script. Secondly, it appeared that if I commented out the perform command at the end of the script, it wrote a score file which I could play by running csound5gui or CsoundVST and manually loading in the orchestra file from CsoundVST.

—————————

test.lisp~
tpscaler.csd

lisp?! go for it champ.

—————————

trapped-high-resolution.csd
trapped-high-resolution.csd~
trapped.csd
trapped.csd~
Trapped.py
trappedrt.csd

This also worked pretty simply. I just started an IDLE session, opened Trapped.py, and executed Run. I’m assuming it would be just as easy to run one of the .csd files from csound5gui.

—————————

vstcsound.csd
vu.csd
vu.py
wxController.py
wxController.py~

Haven’t played with these. I keep seeing this reference in python files to “wx”.

—————————

xanadu-10.csd
xanadu-high-resolution.csd
xanadu-high-resolution.csd~
xanadu.csd
xanaduvst.csd

This played fine in csound5gui too. (I think xanadu-10 is a version I made.) The “high-resolution” version used ksmps set to 1 which causes the composition to take a lot more CPU and clock time to compute.

—————————

csoundapi_tildecsapi_demo.csd
csoundapi_tildecsoundapi.pd

The .pd file I presume is a PureData file. No comments or other information in either file (as usual.)

—————————

gabchanged.csd
gabexitnow.csd
gabmetro.csd
gabvrandi.csd
gabvtable.csd

Huh?

—————————

java-+rtaudio=CoreAudio
java-B128
java-odac8
javaCSDPlayer.jar
javaCSDPlayer.java
javaCSDPlayer.mf
javaCsoundEditor.jar
javaCsoundEditor.java
javaCsoundEditor.mf
javaCsoundEditor.properties
javadac
javahs_err_pid4560.log
javahs_err_pid5624.log
javaMainFrame.py
javaMakefile

Something really wrong here. A bunch of these files have names that look like Csound options. Then there’s the charming addition of two crash log files. Those are useful (“not”). Anyway, it’s all I can do to learn python, I’m certainly not going to worry about a java or lisp interface to CSound.

—————————

py.#pycall1.sco.1.1

and a couple dozen other .sco, .orc, and .py files

This is another mystery directory. It has a bunch of super-elementary python and csound files (one python file contains one line: “print ‘zum'”). But no explanation as to what their point is.

—————————

python_demo

several files

python_demoMainFrame.py
python_demoPythonDemo.py

Seems to need something called wx. Trying to run either .py file in IDLE gives the same error:

ImportError: No module named wx

—————————

tclcsound

several files and then:

tclcsoundreadme.txt

Holy cow, is that a README file in there? OK, I give this directory the prize! tclsound is a front end to Csound that requires Tk/Tcl to be installed (from M. Gogin’s tutorial).

Well, in summary, things aren’t that bad when you take them piece by piece.

The next place I investigated was the instruments/ subdirectory on CD #1 that comes with the Csound Book. That took some typo fixing and headscratching as well, maybe I’ll post about that some other time…

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: