diff options
Diffstat (limited to 'examples/random.csd')
-rw-r--r-- | examples/random.csd | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/examples/random.csd b/examples/random.csd new file mode 100644 index 0000000..5ac86ad --- /dev/null +++ b/examples/random.csd @@ -0,0 +1,37 @@ +<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 random.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 220 and 440. + kmin init 220 + kmax init 440 + k1 random kmin, kmax + + printks "k1 = %f\\n", 0.1, k1 +endin + + +</CsInstruments> +<CsScore> + +; Play Instrument #1 for one second. +i 1 0 1 +e + + +</CsScore> +</CsoundSynthesizer> |