Csound Csound-dev Csound-tekno Search About

[Csnd] macro with optional args?

Date2013-03-14 14:02
FromStefan Thomas
Subject[Csnd] macro with optional args?
Dear community,
I would like to define a macro with optional arguments.
In  my special case, I would like to  change the amplitude of some events, but only sometimes.
Is it possible to do this within csound?
Here is my simple macro:

#define pattern(BEGIN'PITCHA'PITCHB'AMP)
#
i1 $BEGIN 0.5     $PITCHA $AMP
i1 +         .    $PITCHB $AMP
i1 ^+1      .    $PITCHB $AMP
i1 +  .     $PITCHA $AMP
#