aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/test.csd6
-rw-r--r--examples/test2.csd61
2 files changed, 66 insertions, 1 deletions
diff --git a/examples/test.csd b/examples/test.csd
index 3e528cf..e5e80f1 100644
--- a/examples/test.csd
+++ b/examples/test.csd
@@ -1,7 +1,6 @@
<CsoundSynthesizer>
<CsOptions>
-odac
---opcode-lib=/home/bargepole/bpcheckout/csound-dev/sdltest/sdllib.so
</CsOptions>
<CsInstruments>
sr = 44100
@@ -9,6 +8,11 @@ kr = 4410
nchnls = 2
0dbfs = 1
seed 0
+/*
+ SDL example 1
+ Oscillator triggering a rectangle, a moving line and mouse input
+*/
+
gisdl init -1
gicol init -1
diff --git a/examples/test2.csd b/examples/test2.csd
new file mode 100644
index 0000000..3e0dfa3
--- /dev/null
+++ b/examples/test2.csd
@@ -0,0 +1,61 @@
+<CsoundSynthesizer>
+<CsOptions>
+-odac
+-m0
+</CsOptions>
+<CsInstruments>
+sr = 44100
+kr = 441
+nchnls = 2
+0dbfs = 1
+seed 0
+/*
+ SDL Example 2
+ Mouse triggered clusters of rectangles
+*/
+
+gisdl init -1
+gicol init -1
+
+instr 1
+ gisdl, ktrig, kx, ky sdlinit "A SDL Window", 1000, 1000, 30
+ schedkwhen ktrig, 0.05, 0, 2, 0, 1, kx, ky
+ kc = abs(oscil(40, 0.2))
+ ibg sdlcolour kc, kc, kc, 0
+ sdlrect gisdl, ibg, 0, 0, 10, 10
+endin
+
+
+instr 2
+ ix init p4
+ iy init p5
+ inum random 5, 20
+ index = 0
+ while (index < inum) do
+ event_i "i", 3, random(0, 0.5), random(0.5, 1.5), random(ix-0.05, ix+0.05), random(iy-0.05, iy+0.05)
+ index += 1
+ od
+endin
+
+instr 3
+ kc1 line 0, p3, random(100, 255)
+ kc2 line 0, p3, random(100, 255)
+ icol sdlcolour kc1, kc2, kc2, 255
+ kx init p4
+ ky init p5
+ isize random 0.01, 0.05
+ sdlrect gisdl, icol, kx, ky, isize, isize
+
+ iamp = 0.3 + (p5*0.7)
+ kamp line iamp, p3, 0
+ ipitch = 100 + (p4*1000)
+ a1 oscil kamp, ipitch
+ outs a1*0.01, a1*0.01
+endin
+
+
+</CsInstruments>
+<CsScore>
+i1 0 6000
+</CsScore>
+</CsoundSynthesizer>