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

robot (CSound instrument)

Robot #1

sr        =  44100
kr        =  4410
nchnls    =   2


instr 1
  ilen      =         p3
  iseed     =         p4
  krndfrq   =         p5

  krndval   randh     1000,krndfrq,iseed 
  kenv      linseg    0, ilen/4, 1000, ilen/2, 1000, ilen/4, 0
  a2        oscil     kenv, krndval,1              ; SINE OSC CONTROLLED BY S&H;;;amp=600
  kpan      oscil     1, 0.4, 1
  
  asig1     =         a2*kpan
  asig2     =         a2*(1-kpan)

          outs      asig1,asig2
endin

:f1 0 512   7 0 50 1 50 .5 300 .5 112 0                ;ADSR
f1 0 2048 10 1                                        ;SINE WAVE hi-res
;f3 0 512   7 1 17  1 0   0 495                        ;pulse for S&H clk osc
;f4 0 1024  7 .5 256 1 256 .5 256 0 256 .5             ;triangle with offset


i1    0   3    0.1   5.0
i1    4   2    0.2   5.5
i1    7   5    0.3   6.0
i1   13   2    0.4   6.5
i1   16   5    0.5   7.0
i1   22   6    0.6   7.5
i1   29  10    0.7   8.0


Robot #2

sr        =         44100
kr        =         4410
ksmps     =         10
nchnls    =          2

instr 1
                                             
  ilen      =         p3
  irnd_seed =         p4                      
  irnd_frq  =         p5                     
  
  krnd_val  randh     8000, irnd_frq, irnd_seed 

  asin600   oscil     1.2, 600, 11
  a4        reson     asin600, krnd_val+1000, 50 
  kenv     linen      10, ilen/2, ilen, ilen/2
  kpan      oscil     1,.14,17
  
  asig1     =         a4*kenv*kpan
  asig2     =         a4*kenv*(1-kpan)
  
            outs      asig1,asig2
endin
;f1  0 512   9 1 1 0                                    ;sine lo-res
;f2  0 512   5 4096 512 1                               ;exp env
;f3  0 512   9 10 1 0 16 1.5 0 22 2 0 23 1.5 0          ;inharm wave
;f4  0 512   9 1 1 0                                    ;sine
;f8  0 512   5 256 512 1                                ;exp env
;f9  0 512   5 1   512 1                                ;constant value of 1
;f10 0 512   7 0 50 1 50 .5 300 .5 112 0                ;ADSR
f11 0 2048 10 1                                        ;SINE WAVE hi-res
;f13 0 1024  7 0 256 1 256 0 256 -1 256 0               ;triangle
;f14 0 512   7 1 17  1 0   0 495                        ;pulse for S&H clk osc
;f15 0 512   7 0 512 1 0                                ;ramp up;;;left=>right
;f16 0 512   7 1 512 0 0                                ;ramp down;;;right=>left
f17 0 1024  7 .5 256 1 256 .5 256 0 256 .5             ;triangle with offset
;f18 0 512   5 1 512 256                                ;reverse exp env
;f20 0 1024 10 1 0 0 0 .7 .7 .7 .7 .7 .7                ;approaching square
;------------------------------------------------------------------------

i1   0  40   .3   60