diff options
author | Felipe Sateler <fsateler@debian.org> | 2014-01-24 13:54:37 -0300 |
---|---|---|
committer | Felipe Sateler <fsateler@debian.org> | 2014-01-24 13:54:37 -0300 |
commit | bcf06a42deb371baf3deb9f4addb474b08273120 (patch) | |
tree | 4a8c3fb811dd164d4486628d8eff6043ebe8a6c3 /examples/printk2.csd | |
parent | 3a91171181113761a14bcc36a086a8dda144b77b (diff) |
Imported Upstream version 6.02~dfsg
Diffstat (limited to 'examples/printk2.csd')
-rw-r--r-- | examples/printk2.csd | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/examples/printk2.csd b/examples/printk2.csd index c636230..ed32945 100644 --- a/examples/printk2.csd +++ b/examples/printk2.csd @@ -1,41 +1,39 @@ <CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform -; Audio out Audio in --odac -iadc ;;;RT audio I/O +-odac ;;;realtime audio out +;-iadc ;;;uncomment -iadc if realtime audio input is needed too ; For Non-realtime ouput leave only the line below: ; -o printk2.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> -; Initialize the global variables. sr = 44100 -kr = 44100 -ksmps = 1 -nchnls = 1 +ksmps = 32 +nchnls = 2 +0dbfs = 1 -; Instrument #1. instr 1 - ; Change a value linearly from 0 to 10, - ; over the period defined by p3. - kval1 line 0, p3, 10 - ; If kval1 is greater than or equal to 5, - ; then kval=2, else kval=1. - kval2 = (kval1 >= 5 ? 2 : 1) - - ; Print the value of kval2 when it changes. - printk2 kval2 -endin +kval randomh 0, 1.2, 20 ;choose between 0 and 1.2 +if kval >0 && kval<=.5 then ;3 possible outcomes + kval = 1 +elseif kval >.5 && kval<=1 then + kval =2 +elseif kval >1 then + kval =3 +endif +printk2 kval ;print value when it changes +asig poscil .7, 440*kval, 1 + outs asig, asig +endin </CsInstruments> <CsScore> +f1 0 16384 10 1 -; Play Instrument #1 for 5 seconds. i 1 0 5 e - - </CsScore> </CsoundSynthesizer> |