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
endin
#
---- flute ----
#define FLUTE(x) #
instr $x
endin
#
---- bassoon ----
#define BASSOON(x) #
instr $x
endin
#
--------


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

</CsOptions>
<CsInstruments>
sr =  48000
ksmps =  32
nchnls =  1
0dbfs =  1

#include "clarinet"
#include "flute"
#include "bassoon"
$CLARINET(1)
$FLUTE(2)
$BASSOON(3)

</CsInstruments>
<CsScore>
f 0 100
e

</CsScore>
<CsFileB filename=clarinet>
I2RlZmluZSBDTEFSSU5FVCh4KSAjCmluc3RyICR4CmVuZGluCiMK
</CsFileB>
<CsFileB filename=flute>
I2RlZmluZSBGTFVURSh4KSAjCmluc3RyICR4CmVuZGluCiMK
</CsFileB>
<CsFileB filename=bassoon>
I2RlZmluZSBCQVNTT09OKHgpICMKaW5zdHIgJHgKZW5kaW4KIwo
</CsFileB>
</CsoundSynthesizer>