Use Non-Frames Version Previous Page Next Page
Unified File Format

Unified File Format for Orchestras and Scores


Description

The Unified File Format, introduced in Csound version 3.50, enables the orchestra and score files, as well as command line flags, to be combined in one file. The file has the extension .csd. This format was originally introduced by Michael Gogins in AXCsound.

The file is a structured data file which uses markup language, similar to any SGML such as HTML. Start tags (<tag>) and end tags (</tag>) are used to delimit the various elements. The file is saved as a text file.

Structured Data File Format

Elements

The Csound Element is used to alert the csound compiler to the .csd format. The file must begin with the start tag <CsoundSynthesizer>. The last line of the file must be the end tag </CsoundSynthesizer>. The remaining elements are defined below.

Options

Csound command line flags are put in the Options Element. This section is delimited by the start tag <CsOptions> and the end tag </CsOptions> Lines beginning with # or ; are treated as comments.

Instruments (Orchestra)

The instrument definitions (orchestra) are put into the Instruments Element. The statements and syntax in this section are identical to the Csound orchestra file, and have the same requirements, including the header statements (sr, kr, etc.) This Instruments Element is delimited with the start tag <CsInstruments> and the end tag </CsInstruments>.

Score

Csound score statements are put in the Score Element. The statements and syntax in this section are identical to the Csound score file, and have the same requirements. The Score Element is delimited by the start tag <CsScore> and the end tag </CsScore>.

Example

Below is a sample file, test.csd, which renders a .wav file at 44.1 kHz sample rate containing one second of a 1 kHz sine wave. Displays are suppressed. test.csd was created from two files, tone.orc and tone.sco, with the addition of command line flags.

  <CsoundSynthesizer>;
    ; test.csd - a Csound structured data file
  <CsOptions>
    -W -d -o tone.wav 
  </CsOptions>
  <CsInstruments>
    ; originally tone.orc 
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 1
    instr   1 
        a1 oscil p4, p5, 1 ; simple oscillator 
           out a1
      endin
  </CsInstruments>
  <CsScore>
    ; originally tone.sco
    f1 0 8192 10 1
    i1 0 1 20000 1000 ;play one second of one kHz tone
    e
  </CsScore>
  </CsoundSynthesizer>

Command Line Parameter File

If the file .csoundrc exists, it will be used to set the command line parameters. These can be overridden. It uses the same form as a .csd file. Lines beginning with # or ; are treated as comments.


Use Non-Frames Version Previous Page Next Page
Unified File Format