summaryrefslogtreecommitdiff
path: root/examples/lpshold.csd
diff options
context:
space:
mode:
Diffstat (limited to 'examples/lpshold.csd')
-rw-r--r--examples/lpshold.csd47
1 files changed, 25 insertions, 22 deletions
diff --git a/examples/lpshold.csd b/examples/lpshold.csd
index bfd650f..83c2fce 100644
--- a/examples/lpshold.csd
+++ b/examples/lpshold.csd
@@ -1,40 +1,43 @@
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-; Audio out Audio in No messages
--odac -iadc -d ;;;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 lpshold.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
- kfreq line 1, p3, 20
-
- klp lpshold kfreq, 0, 0, 0, p3*0.25, 20000, p3*0.75, 0
-
- a1 oscil klp, 440, 1
- out a1
+kfrq init p4 ; frequency of the loop
+ifrac = p5 ; fraction of frequency at which to force retrigger
+ipan = p6 ; pan position
+ktrig metro kfrq * ifrac ; trigger to force restart the loop
+iphs = 0 ; initial phase of the loop
+; a loop of midi note numbers: note duration etc...
+knote lpshold kfrq, ktrig, iphs, 61, 0.0625, 60, 0.9375, 61, 1, 58, 1, \
+63, 2, 65, 3
+aenv linseg 0,0.01,1,p3-0.11,1,0.1,0 ; amplitude envelope
+krnd rspline -0.05,0.05,0.5,1 ; random detune
+asig gbuzz 0.2*aenv, cpsmidinn(knote+krnd), 30, 1, 0.5, 1
+ outs asig*ipan, asig*(1-ipan)
endin
-
</CsInstruments>
<CsScore>
-
-; Table #1, a sine wave.
-f 1 0 16384 10 1
-
-; Play Instrument #1 for five seconds.
-i 1 0 5
+; cosine wave.
+f 1 0 16384 11 1
+
+; 3 layers of the loop are played, each at a different speed,
+; - with different retriggering rate, and pan location.
+i 1 0 60 0.5 [8/10] 0.5
+i 1 0 60 0.375 [8/11] 0.1
+i 1 0 60 0.25 [8/13] 0.9
e
-
-
</CsScore>
</CsoundSynthesizer>