CSD Files

From OLPC
Jump to: navigation, search

Unified Csound file format is the most commonly used way of organising Csound code. This is the recommended method for all Csound applications in OLPC. CSDs used markup-language (XML-like) tags to separate the different sections of Csound code. Opening and closing takes may not be in the same line (eg. should be separated at least by 1 newline character). All sections are contained within the following tags

<CsoundSynthesizer> and </CsoundSynthesizer>

There are two required sections:

1. The orchestra, contained within

<CsInstruments> and </CsInstruments>

2. The score, contained within

<CsScore> and </CsScore>

A number of optional tags can also be used:

  • Compilation options (should contain a single line only)
<CsOptions> and </CsOptions>
  • Version Blocking (with Before #VERSION# and After #VERSION#)
<CsVersion> and </CsVersion>
  • Base-64 included files

Base64 encoded files can be included using the tag <CsFileB filename=filename>, where filename is the name of the file to be included. The Base64 encoded data should be terminated with a </CsFileB> tag.

The csb64enc and makecsd utilities can be used to encode files and include them in a CSD. The file will be extracted to the current directory, and deleted at end of performance. If there is an already existing file with the same name, it is not overwritten, but an error will occur instead.