summaryrefslogtreecommitdiff
path: root/examples/linrand.csd
diff options
context:
space:
mode:
Diffstat (limited to 'examples/linrand.csd')
-rw-r--r--examples/linrand.csd91
1 files changed, 42 insertions, 49 deletions
diff --git a/examples/linrand.csd b/examples/linrand.csd
index f50dc2e..6fb0a05 100644
--- a/examples/linrand.csd
+++ b/examples/linrand.csd
@@ -1,49 +1,42 @@
-<CsoundSynthesizer>
-<CsOptions>
-; Select audio/midi flags here according to platform
-; Audio out Audio in
--odac -iadc ;;;RT audio I/O
-; For Non-realtime ouput leave only the line below:
-; -o linrand.wav -W ;;; for file output any platform
-</CsOptions>
-<CsInstruments>
-
-; Initialize the global variables.
-sr = 44100
-kr = 4410
-ksmps = 10
-nchnls = 1
-
-; Instrument #1.
-instr 1
- ; Generate a random number between 0 and 1.
- ; krange = 1
-
- i1 linrand 1
-
- print i1
-endin
-
-; Instrument #2.
-instr 2
- ; Generate a random number between 0 and 1.
- ; krange = 1
-
- seed 0
-
- i1 linrand 1
-
- print i1
-endin
-
-</CsInstruments>
-<CsScore>
-; Play Instrument #1 for one second.
-i 1 0 1
-; Play Instrument #2 for one second.
-i 2 1 1
-e
-
-
-</CsScore>
-</CsoundSynthesizer>
+<CsoundSynthesizer>
+<CsOptions>
+; Select audio/midi flags here according to platform
+-odac ;;;realtime audio out
+;-iadc ;;;uncomment -iadc if RT audio input is needed too
+; For Non-realtime ouput leave only the line below:
+; -o linrand.wav -W ;;; for file output any platform
+</CsOptions>
+<CsInstruments>
+
+sr = 44100
+ksmps = 32
+nchnls = 2
+0dbfs = 1
+
+instr 1 ; every run time same values
+
+klin linrand 100
+ printk .2, klin ; look
+aout oscili 0.8, 440+klin, 1 ; & listen
+ outs aout, aout
+endin
+
+instr 2 ; every run time different values
+
+ seed 0
+klin linrand 100
+ printk .2, klin ; look
+aout oscili 0.8, 440+klin, 1 ; & listen
+ outs aout, aout
+endin
+
+</CsInstruments>
+<CsScore>
+; sine wave
+f 1 0 16384 10 1
+
+i 1 0 2
+i 2 3 2
+e
+</CsScore>
+</CsoundSynthesizer>