February 27, 2007

CSound

I have been looking a little at CSound, because I wanted to do some musi-mathematical investigations and text formats always make for nice accessibility. A text format however is no guarantee for readability. Csounds looks like what you get if you try to construct a programming idiom without any knowledge of other programming languages. I know that sounds a bit harsh and I do think there are likeable features but there are so many strange things that are just unsoftwarelike in the language. Have a look at the sample in the Wikipedia entry for CSound, as an example. Let's begin to enumerate the strangeness:


  1. Unreadable shorthands for everything - I can understand this from a "it's better for serious users" standpoint though

  2. It's XML - but it isn't: The semantics are still in CSound's legacy ASCII format that must be parsed with a CSound parser. The grammar is simple - but it's still a grammar.

  3. In the instruments section arguments are separated by comma, in the score section just by whitespace (it's a syntax error if you mix it up)

  4. instruments, user-defined function-tables, notes in the score, built in functions: All are just recognized by numbers, not by names.

  5. The a1 in the instrument definition is a variable and it's scoped inside the instrument. The f1 and the i1 are really "f - and a first argument of 1" and "i and a first argument of 1" - it's just OK to have them as one token. These variables are global.

  6. The argument "10" in the f1 line is the name of built in generator function GEN10, a sine curve. The set of GEN functions is fixed.

  7. p4 and p5 in the instrument definition refer to argument numbers 4 and 5 in the "i1" line. You either have to go out of your way - or maybe you can't - name them

  8. The final 1 in the instrument definition refers to the f1 function. In this example. everything is in one file - but originally the score section and the instrument sections are in separate files. So the value 1 in the score file plugs into the instruments in the other file...

All of this makes sense as a kind of "minimal theory" language version of a physical device: "Plug the sine you setup with the first oscillator into the first generator" - software wiring. But without the visuals for orientation, these kinds of semi-physical coordinates are extremely confusiing.

Posted by Claus at February 27, 2007 2:45 PM
Comments
Post a comment