aboutsummaryrefslogtreecommitdiff
path: root/supercollider/example
diff options
context:
space:
mode:
authorKjetil S. Matheussen <ksvalast@users.sourceforge.net>2004-01-20 16:56:23 +0000
committerKjetil S. Matheussen <ksvalast@users.sourceforge.net>2004-01-20 16:56:23 +0000
commit5a2a3440f0c4558258c19a694e1c5d550db06a37 (patch)
tree82a99cbb9710cdd8cde3bad0307573fc03e7c4aa /supercollider/example
parent84afa8ecc7a7cd68f3477d2ea348c7ff4748a6aa (diff)
Various tools to make supercollider more convenient to use within PD
svn path=/trunk/; revision=1271
Diffstat (limited to 'supercollider/example')
-rw-r--r--supercollider/example/fileplayer.sc18
-rw-r--r--supercollider/example/help-sc.pd33
-rw-r--r--supercollider/example/supertest.py45
3 files changed, 96 insertions, 0 deletions
diff --git a/supercollider/example/fileplayer.sc b/supercollider/example/fileplayer.sc
new file mode 100644
index 00000000..f8e880c4
--- /dev/null
+++ b/supercollider/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/supercollider/example/help-sc.pd b/supercollider/example/help-sc.pd
new file mode 100644
index 00000000..41492c59
--- /dev/null
+++ b/supercollider/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 from_sc~;
+#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/supercollider/example/supertest.py b/supercollider/example/supertest.py
new file mode 100644
index 00000000..d48b7164
--- /dev/null
+++ b/supercollider/example/supertest.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+
+import pyext,os,traceback
+from supercollider import *
+
+
+class supertest(pyext._class):
+ _inlets=1
+ _outlets=0
+
+ def start_1(self,arg):
+ try:
+ self.buffer=BufferRead(self.server,arg)
+ self.bsynth=Synth(self.server,"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:
+ self.server=localServer;
+ self.server.dumpOSC(3)
+ self.server.evalSynth("fileplayer");
+ except:
+ traceback.print_exc()
+
+