#ifdef

#ifdef — Conditional reading of code.

Description

If a macro is defined then #ifdef can incorporate text into an orchestra upto the next #end. This is similar to, but independent of, the macro system in the score language.

Syntax

#ifdef NAME
....
          
            #end
          
        

Performance

Note that the #ifdef construct cannot be nested, unlike the C preprocessor language.

Examples

Here is a simple example of the conditional.

Example 5. Simple example of the ifdef form.

#define debug
     instr 1
#ifdef debug
     print "calling oscil"
#end
     a1   oscil 32000,440,1
     out  a1
     endin
        

See Also

$NAME, #define

Credits

Author: John ffitch
University of Bath/Codemist Ltd.
Bath, UK
April 2005

New in Csound5 (and 4.23f13)