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/trigger.csd | |
parent | 3a91171181113761a14bcc36a086a8dda144b77b (diff) |
Imported Upstream version 6.02~dfsg
Diffstat (limited to 'examples/trigger.csd')
-rw-r--r-- | examples/trigger.csd | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/examples/trigger.csd b/examples/trigger.csd index 1c6ff00..d4f1ec9 100644 --- a/examples/trigger.csd +++ b/examples/trigger.csd @@ -1,43 +1,43 @@ <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 trigger.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> -; Initialize the global variables. sr = 44100 -kr = 4410 -ksmps = 10 -nchnls = 1 +ksmps = 32 +nchnls = 2 +0dbfs = 1 -; Instrument #1. instr 1 - ; Use a square-wave low frequency oscillator as the trigger. - klf lfo 1, 10, 3 - ktr trigger klf, 1, 2 - - ; When the value of the trigger isn't equal to 0, print it out. - if (ktr == 0) kgoto contin - ; Print the value of the trigger and the time it occurred. - ktm times - printks "time = %f seconds, trigger = %f\\n", 0, ktm, ktr - -contin: - ; Continue with processing. + +kmtr lfo 1, 1, 1 ;triangle wave +kmode = p4 +ktr trigger kmtr, .5, kmode + printk2 ktr + schedkwhen ktr, 0, 3, 2, 0, .3 + + endin +instr 2 + +aenv linseg 0,p3*.1,1,p3*.3,1,p3*.6,0 ;envelope +a1 poscil .3*aenv, 1000, 1 + outs a1, a1 +endin </CsInstruments> <CsScore> +f 1 0 16384 10 1 ;sine -; Play Instrument #1 for one second. -i 1 0 1 -e - +i 1 0 3 0 ;down-up +i 1 4 3 2 ;down-up & up=down +e </CsScore> </CsoundSynthesizer> |