aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/fileplayer.sc18
-rw-r--r--example/help-sc.pd33
-rw-r--r--example/supertest.py47
3 files changed, 98 insertions, 0 deletions
diff --git a/example/fileplayer.sc b/example/fileplayer.sc
new file mode 100644
index 0000000..f8e880c
--- /dev/null
+++ b/example/fileplayer.sc
@@ -0,0 +1,18 @@
+
+/*
+ Short example of a supercollider3 synth.
+ -Kjetil S. Matheussen, 2004.
+
+ To load this one from inside PD, call:'
+
+ server.evalSynth("fileplayer")
+
+*/
+
+
+arg out=0,bufnum,rate=100,pan=0;
+
+Out.ar( out,
+ Pan2.ar(PlayBuf.ar(1,bufnum,rate/100,0,0,1),pan/100,0.8)
+)
+
diff --git a/example/help-sc.pd b/example/help-sc.pd
new file mode 100644
index 0000000..994e306
--- /dev/null
+++ b/example/help-sc.pd
@@ -0,0 +1,33 @@
+#N canvas 447 151 646 543 10;
+#X obj 366 242 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10
+-262144 -1 -1 -68 256;
+#X obj 455 237 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10
+-262144 -1 -1 -57.4803 256;
+#X obj 458 207 hsl 128 15 -100 100 0 0 empty empty empty -2 -6 0 8
+-262144 -1 -1 2700 1;
+#X msg 366 218 -120;
+#X obj 273 110 dac~;
+#X msg 50 274 reload;
+#X msg 109 171 start /home/kjetil/mus2840/hh1.wav;
+#X msg 288 265 stop;
+#X msg 365 267 rate \$1;
+#X msg 455 264 pan \$1;
+#X obj 260 66 k_jack~ supercollider;
+#X obj 71 325 pyext supertest supertest;
+#X text 15 15 Play a soundfile on the supercollider server.;
+#X text 333 67 <- We get the supercollider sound here.;
+#X text 432 503 -Kjetil S. Matheussen \, 2004;
+#X msg 28 487 \; pd dsp 1;
+#X obj 28 456 loadbang;
+#X connect 0 0 8 0;
+#X connect 1 0 9 0;
+#X connect 2 0 1 0;
+#X connect 3 0 0 0;
+#X connect 5 0 11 0;
+#X connect 6 0 11 1;
+#X connect 7 0 11 1;
+#X connect 8 0 11 1;
+#X connect 9 0 11 1;
+#X connect 10 0 4 0;
+#X connect 10 1 4 1;
+#X connect 16 0 15 0;
diff --git a/example/supertest.py b/example/supertest.py
new file mode 100644
index 0000000..5c1a317
--- /dev/null
+++ b/example/supertest.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+
+import pyext,os,traceback
+import supercollider
+
+sc=supercollider
+
+
+class supertest(pyext._class):
+ _inlets=1
+ _outlets=0
+
+ def start_1(self,arg):
+ try:
+ self.buffer=sc.BufferRead(arg)
+ self.bsynth=sc.Synth("fileplayer",["bufnum",self.buffer.id])
+ except:
+ traceback.print_exc()
+
+ def stop_1(self):
+ try:
+ del self.bsynth
+ except:
+ traceback.print_exc()
+
+ def pan_1(self,val):
+ try:
+ self.bsynth.set("pan",val)
+ except:
+ traceback.print_exc()
+
+ def rate_1(self,rate):
+ try:
+ self.bsynth.set("rate",rate)
+ except:
+ traceback.print_exc()
+
+ def __init__(self):
+ try:
+ server=sc.localServer
+ server.dumpOSC(3)
+ server.evalSynth("fileplayer");
+ except:
+ traceback.print_exc()
+
+