Csbeats is an alternative score language that is aimed at specifying simple scores in standard western tunings and rhythms. Csbeats can be invoked via the CsScore component of a standard .csd score with bin="csbeats" or as stand-alone program which generates a standard numeric score.
As a stand-alone the program reads standard input and writes to standard output.
The csbeats language is very simple, having only 5 kinds of statement, and only one of them has any complexity. In general the introductory word for each statement type is case insensitive, so "QUIT", "quit", "QuIt"... are all the same. Comments can be introduced in either ANSI C89 format or C++ (that is either /* ... */ or // to the end of line) or Csound's semicolo.
Causes csbeats to exit. For flexibility the command END is also accepted for the identical action.
Sets the number of beats per minute for the following score until the end or until it is reset. The default value is 60bpm. The token BPS is also acceptable instead of BEATS.
Sets the number of beats in a bar. The default value is 4.
Start a new bar.
Start the bar whose number is given.
Specified a note event for the numbered instrument. The attributes may be any of a pitch, duration or dynamic, or a positioning of the note to a beat or measure, and can be in any order.
Pitches are specified with a conventional note name (English form) in upper case optionally followed by a #, x (for double sharp), b (for flat) or bb (for double flat). A note of Z is a rest (think zzzz). All notes except rests must be followed by an octave number, with A4 being international A (440Hz). Pitches are passed to Csound in Hertz in the parameter p4, and are twelve tone equal temprament.
Durations are coded in lower case with the initial letter of the name.
Durations can be added together by giving more that one duration. To make this more intuitive a + sign can be used instead of white space.
The dynamics are written in conventional notation, that is fff, ff, f, mf, mp, p, pp, ppp. These are passed to the instrument as p5 as 0 for fff, and one less dB for each step below. The default dynamic is fortissimo.
If any of these attributes is missing it carried forward from the previous note, with beat position being incremented to the end of the previous note.
In addition an event can be directed to a particular measure with an m attribute or a particular beat with a b.