René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

FM: single carrier with parallel modulators [CSound]

sr  = 44100
kr  = 4410

nchnls = 1


;  Single Carrier with parallelel modulators
;  -----------------------------------------
;
;
;
;     
;  imodamp1                   imodamp2
;      |                          |       
;      |   imodfrq1               |   imodfrq2
;      |      |                   |      |
;      |      |     icarfrq       |      |
;      V      V        |          V      V
;   +-----------+      |       +-----------+
;   |           |      |       |           |
;   |   OSCIL   |      |       |   OSCIL   |
;   |           |      |       |           |
;   +-----+-----+      |       +-----+-----+
;         |            V             |
;         |          +---+           |
;         |          |   |           |
;         +--------->+ + |<----------+
;                    |   |
;                    +-+-+
;             iamp     |
;               |      |
;               |      |
;               V      V        
;            +-----------+
;            |           |
;            |   OSCIL   |
;            |           |
;            +-----+-----+
;                  |
;                  |
;                  V
;                asig
;


instr 1
  ilen        = p3
  iamp        = p4

  icarfrq     = cpspch(p5)

  icarfrq1    = p6 * icarfrq
  imodratio1  = p7
  ifmindex1   = p8

  icarfrq2    = p9 * icarfrq
  imodratio2  = p10
  ifmindex2   = p11

  imodfrq1    = icarfrq1 * imodratio1
  imodamp1    = imodfrq1 * ifmindex1

  imodfrq2    = icarfrq2 * imodratio2
  imodamp2    = imodfrq2 * ifmindex2

  kfrq_mod_1  oscili imodamp1, imodfrq1, 1  
  kfrq_mod_2  oscili imodamp2, imodfrq2, 1  

  asig        oscili iamp    , icarfrq + kfrq_mod_1 + kfrq_mod_2, 1  

  kenv        linseg 1, ilen, 0
              out   asig * kenv
endin
f1  0  2048   10   1
 
 
;           p4       p5     p6    p7      p8     p9     p10    p11 
i1  0   1   10000  6.00   1.01  1.03    2.00   0.99    1.01   1.02
i1  +   1   10000  6.02   1.01  1.03    2.00   0.99    1.01   1.02
i1  +   1   10000  6.04   1.01  1.03    2.00   0.99    1.01   1.02
i1  +   1   10000  6.05   1.01  1.03    2.00   0.99    1.01   1.02

i1  +   1   10000  7.00   1.01  1.03    2.00   0.99    1.01   1.02
i1  +   1   10000  7.02   1.01  1.03    2.00   0.99    1.01   1.02
i1  +   1   10000  7.04   1.01  1.03    2.00   0.99    1.01   1.02
i1  +   1   10000  7.05   1.01  1.03    2.00   0.99    1.01   1.02

i1  +   1   10000  9.00   1.00  1.01    1.00   1.00    1.005   1.00
i1  +   1   10000  9.02   1.00  1.01    1.00   1.00    1.005   1.00
i1  +   1   10000  9.04   1.00  1.01    1.00   1.00    1.005   1.00
i1  +   1   10000  9.05   1.00  1.01    1.00   1.00    1.005   1.00
See also here.