diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2008-02-08 13:52:00 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2008-02-08 13:52:00 +0000 |
commit | d510556ed2617b112c58738248b59d122c5173d5 (patch) | |
tree | fc9c4240fab7150d13114041b0529c26090d4105 /example/supertest.py |
moved supercollider to externals/HEADsvn2git-rootsvn2git-headexternals/supercollider
svn path=/trunk/externals/supercollider/; revision=9414
Diffstat (limited to 'example/supertest.py')
-rw-r--r-- | example/supertest.py | 47 |
1 files changed, 47 insertions, 0 deletions
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() + + |