Lexical Elements of an Antescofo Score

Elements of the language can be categorised into six groups, corresponding to various constructions permitted in the language:

User defined score elements like macros, processes, objects, tracks and functions can only be used after their definition in the score. We suggest putting them at the beginning of the file or to put them in a separate file using the @insert command. They will be discussed in later chapters.

Case-Sensitive and case-Unsensitive Identifiers

Identifiers are sometimes case-sensitive and sometimes case unsensitive. The rule is simple: reserved keyword or predefined identifiers are case unsensitive. User introduced identifiers and predefined function names are case sensitive.


Block comments are in the C-style and cannot be nested:

          /*  comment split
              on several lines

Line-comments are in the C-style and also in the Lisp style:

          // comment until the end of the line 
          ; comment until the end of the line      

In this document, we use railroad diagrams to give a more precise description of the syntax. The railroad diagram specifying comment's syntax is:

Comments are ignored by the interpreter but not suppressed in normal processing. That is, they act usually as separators, i.e.


is read as two consecutive tokens $xand y. However, during macro-expansion comments are suppressed (not ignored) in the textual expansion: in a macro-expansion, the previous fragment is read as only one token $xy by the interpreter (see chapter Macros).


Tabulations are handled like white spaces. Columns are not meaningful so you can indent program as you wish. However, some constructs must end on the same line as their “head identifier”: event specification, internal commands and external actions (like Max message or OSC commands).

For example, the following fragment raises a parse error:

          C4 0.5
          1.0s print
               "message to print"

(because the pitch and the duration of the note does not appear on the same line as the keyword NOTE and because the argument of print is not on the same line). But this one is correct:

          Note C4 0.5 myLab
          Note C4 0.5 "some label with white space used to document the score"
          print "this is a Max message (to the print object)" 
          print "printed 1 seconds after the event Note C4..."

Note that the first 'print' message is indented after the specification of its delay 1.0s but ends on the same line as its “head identifier”, achieving one of the customary indentations used for cue lists.

Splitting a line

A backslash before an end-of-line can be used to specify that the next line must be considered as the continuation of the current line. It allows for instance to split the list of the arguments of a message on several physical rows:

          print "this two" "messages" "are equivalent"
          print "this two" \
                "messages" \
                "are equivalent"

Reserved Keywords

Reserved keywords can be divided in two groups:

The current list of reserved keywords is :

abort   action   and   at  
before   bind   bpm  
case   chord   closefile   curve  
do   during  
else   event   expr  
false   forall  
gfwd   group  
if   imap   in  
let   lfwd   loop  
map   ms   multi  
napro_trace   note  
of   off   on   openoutfile  
oscoff   oscon   oscrecv  
parfor   patch   port  
s   start   state   stop  
switch   symb  
tab   tempo   transpose   trill   true  
value   variance  
whenever   where   while   with  

Notice that event keywords always occur at the top-level of the text score. Reserved keywords are case unsensitive, that is,

note    NOTE    Note    NoTe    notE

refers to the same identifier. However simple identifiers which are not reserved keywords are case sensitive.

Simple Identifiers : Antescofo keywords and references to the host environment

Simple identifiers are sequence of characters accepted by one of the three following regular expressions and that are not reserved keywords:




[:alpha:] represents an alphabetic character, [:alnum:] represents an alphanumeric character, i.e. [0-9a-zA-Z] and the hexadecimal range \xc3\xe2\x80-\xbf represents a raisonable subset of UTF-8 accentuated characters and printable symbols.

These identifiers are much more general than the identifiers [:alpha:][:alnum:]* usually recognized in programming language. For example they can start by a number or include a relational operator like <, in order to represent the various Max or PD receivers found in current patches (identifier starting with a number are common when working with Max poly). It is however possible to encounter Max receivers that are not caught by the above regular expressions. In this case, just use a string instead of a simple identifier, for the receiver. For instance

    "max receiver with white spaces" 1 2 3

refers to a receiver whose name includes white spaces.

$-identifiers : Variables

$-identifiers like $id, $id_1 are simple identifiers prefixed with a dollar sign. Only ! ? . and _ are allowed as non-alphanumeric characters. $-identifiers are used to give a name to variables and for function, process and macro definition arguments. They are case-sensitive.

You can learn more on expressions and variables in chapter Expressions.

::-identifiers : Processes

::-identifiers like ::P or ::q1 are simple identifiers prefixed with two semicolons. ::-identifiers are used to give a name to processus (see chapter Processes).

Other ::-identifiers have a prefix before the :: and are used to give a name to various entities:

@-identifiers : Functions, Macros, and Attributes

A word preceded immediately with a ‘@’ character is called a @-identifier. Only ! ? . and _ are allowed as non alphanumeric characters after the @.

They have four purposes in Antecofo language. Note that in the first three cases, @-identifiers are case unsensitive, that is @tight, @TiGhT and @TIGHT are the same keyword.

Parsing directives

Some commands affect directly the parsing of a file:


The following @-identifiers are used to introduce new definitions:

Events Attributes and Actions Attributes

Here is a list of the reserved @-identifiers used to specify an attribute of an action or an event. These @-identifers are case unsensitive.

        @abort @action @ante

        @back @back_in @back_in_out @back_out @bounce
        @bounce_in @bounce_in_out @bounce_out

        @circ @circ_in @circ_in_out @circ_out @coef @command
        @conservative @cubic @cubic_in @cubic_in_out @cubic_out

        @date @dsp_channel @dsp_cvar @dsp_inlet @dsp_link
        @dsp_outlet @dump

        @elastic @elastic_in @elastic_in_out @elastic_out
        @eval_when_load @exclusive @exp @exp_in @exp_in_out @exp_out


        @global @grain @guard

        @hook @immediate

        @inlet @is_undef



        @label @latency @linear_in @linear_in_out @linear_out
        @local @loose


        @name @norec

        @pizz @plot @post @progressive

        @quad @quad_in @quad_in_out @quad_out @quart @quart_in
        @quart_in_out @quart_out @quint @quint_in @quint_in_out

        @rdate @refractory @rplot

        @sine @sine_in @sine_in_out @sine_out
        @staccato @staticscope @sync

        @target @tempo @tempovar @tight
        @transpose @type

Naming Functions and Macros

@-identifiers are used to give a name to predefined functions, user-defined functions or user-defined macros. These predefined or user-introduced @-identifiers are case sensitive.