Csound Csound-dev Csound-tekno Search About

Use of Csound instruments (includes) + Midi2Cs Part 3

Date1997-07-17 23:45
FromRĂ¼diger
SubjectUse of Csound instruments (includes) + Midi2Cs Part 3
        ;ORC
          ; edited by R. Pinkston, modified for use with MIDI2CS by R.
Borrmann
          ;

;==========================================================================;
          ;                Schottstaedt FM String Instrument from Dodge
         ;
          ;
         ;
          ;p4 = amp p5 = pch p6 = rise p7 = dec p8 = vibdel p9 = vibwth p10
= vibrte ;

;==========================================================================;
          ;        sr      =       44100
          ;        kr      =       4410
          ;        ksmps   =       10
          ;        nchnls  =       1
          ;
          ;                instr   1

          par
            p_maxamplitude 32000
            p_cps
          endpar

                  iamp    =       p4

                  irise   = .2    ;p6
                  idec    = .2    ;p7
                  ivibdel = .75   ;p8
                  ivibwth = .03   ;p9
                  ivibrte = 5.5   ;p10

                  ifc     =       p5
                  ifm1    =       ifc
                  ifm2    =       ifc*3
                  ifm3    =       ifc*4
                  indx1   =       7.5/log(ifc)    ;range from ca 2 to 1
                  indx2   =       15/sqrt(ifc)    ;range from ca 2.6 to .5
                  indx3   =       1.25/sqrt(ifc)  ;range from ca .2 to .038
                  kvib    init    0

                          timout  0,ivibdel,transient  ;delays vibrato for
p8 seconds
                  kvbctl  linen   1,.5,p3-ivibdel,.1   ;vibrato control
envelope
                  krnd    randi   .0075,15        ;random deviation in vib
width
                  kvib    oscili  kvbctl*ivibwth+krnd,ivibrte*kvbctl,1
;vibrato generator

          transient:
                  timout  .2,p3,continue          ;execute for .2 secs only
                  ktrans  linseg  1,.2,0,1,0      ;transient envelope
                  anoise  randi   ktrans,.2*ifc   ;noise...
                  attack  oscil   anoise,2000,1   ;...centered around 2kHz

          continue:
                  amod1   oscili  ifm1*(indx1+ktrans),ifm1,1
                  amod2   oscili  ifm2*(indx2+ktrans),ifm2,1
                  amod3   oscili  ifm3*(indx3+ktrans),ifm3,1
                  asig    oscili  iamp,(ifc+amod1+amod2+amod3)*(1+kvib),1
                  asig    linen   asig+attack,irise,p3,idec
          ;                out     asig
          ;
          ;                endin
                  aright  = asig
                  aleft   = asig

     You might have noticed that there's a par/endpar section in the
     instrument to specify parameters for automatic use with Midi2Cs.
     Parameters should be exactly as to be set in 'midi2cs.pro' and
     described in the manual. These settings have a higher priority
     than any midi2cs.pro file. It's not tested to death, so if there
     are any errors, please tell me, so that I am able to correct
     them. I am also interested in receiving intruments edited for the
     use with Midi2Cs. I'd like to publish Csound instruments working
     with the new GM features of Midi2Cs 0.95 them on a new web page.