Re: [Cs-dev] MIDI Prog Change / Conditionals

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: [Cs-dev] MIDI Prog Change / Conditionals

Istvan Varga
David Akbari wrote:

>   #include ?clarinet?
>   #include ?flute?
>   #include ?bassoon?
>   $CLARINET(1)
>   $FLUTE(2)
>   $BASSOON(3)"
> This example would of course result in a preliminary exit from the
> csoundPerformKsmps() loop and subsequent fatal error message even though
> syntactically there is nothing wrong (assuming the current instance of
> Csound is able to locate all #include'ed files from INCDIR.)
As far as I have tested it, the example works fine (after replacing the
non-ASCII quote-like characters and removing the extra quote character
from the last line). The CsFileB sections in the attached CSD file
expand to:

---- clarinet ----
#define CLARINET(x) #
instr $x
---- flute ----
#define FLUTE(x) #
instr $x
---- bassoon ----
#define BASSOON(x) #
instr $x

; this CSD file was generated with makecsd v1.1
; (written by Istvan Varga, Mar 2003)
; set command line options here

sr =  48000
ksmps =  32
nchnls =  1
0dbfs =  1

#include "clarinet"
#include "flute"
#include "bassoon"

f 0 100

<CsFileB filename=clarinet>
<CsFileB filename=flute>
<CsFileB filename=bassoon>