<CsoundSynthesizer>
<CsOptions>
</CsOptions>

<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2

#ifndef VOLUME
#define VOLUME #70000#
#end

#ifndef BANK
#define BANK #0#
#end

#ifndef PRESET
#define PRESET #0#
#end

#ifndef SOUNDFONT
#define SOUNDFONT #d:/devel/surmulot/soundfonts/Claudio_Piano.SF2#
#end

giengine  fluidEngine
isfnum    fluidLoad "$SOUNDFONT", giengine, 1
          fluidProgramSelect giengine, 1, isfnum, $BANK, $PRESET
instr 1

  imfloat   =  (17.31234049066757 * log(p4)) - 36.376316562296
  ikey	    =  round(imfloat)
  ipbend    =  round(8192 * (1 + ((imfloat - ikey) / 2)))
  ivel	    init      p5
if (ipbend = 8192) goto nobend
	    fluidControl giengine, 224, 1, (ipbend & 127), (ipbend >> 7)  
nobend:
	    fluidNote	giengine, 1, ikey, ivel

  imvol	    init      $VOLUME
  asigl, asigr fluidOut	  giengine
	    outs      asigl * imvol, asigr * imvol
endin
</CsInstruments>
<CsScore>
i 1 0 2 440 120
i 1 + 2 448 120
i 1 + 2 438 120
</CsScore>
</CsoundSynthesizer>
