Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Synth.activity/synth.py
diff options
context:
space:
mode:
Diffstat (limited to 'Synth.activity/synth.py')
-rwxr-xr-xSynth.activity/synth.py82
1 files changed, 46 insertions, 36 deletions
diff --git a/Synth.activity/synth.py b/Synth.activity/synth.py
index f62a8d2..8ff18bd 100755
--- a/Synth.activity/synth.py
+++ b/Synth.activity/synth.py
@@ -15,52 +15,62 @@ class Synth(activity.Activity):
fr = (0x1000, 0x0000, 0x7000)
# GUI window
- win = csndsugui.CsoundGUI(self,bg)
- if win.compile("synth.csd",["-Mhw:1,0"]):
- win.csd("synth.csd")
- txt = win.text("Synthesizer Panel",colour=fr)
- hbox = win.box(False)
+ self.win = csndsugui.CsoundGUI(self,bg)
+ if self.win.compile("synth.csd",["-Mhw:1,0"]):
+ self.win.csd("synth.csd")
+ txt = self.win.text("Synthesizer Panel",colour=fr)
+ hbox = self.win.box(False)
# oscillator frames
- box = win.box(parent=hbox)
- box1 = win.box(False, box)
- box2 = win.box(False, box)
- frame1 = win.framebox("osc 1", False, box1, fr)
- frame2 = win.framebox("osc 2", False, box2, fr)
+ box = self.win.box(parent=hbox)
+ box1 = self.win.box(False, box)
+ box2 = self.win.box(False, box)
+ frame1 = self.win.framebox("osc 1", False, box1, fr)
+ frame2 = self.win.framebox("osc 2", False, box2, fr)
# oscillator 1 controls
- box = win.box(parent=frame1)
- win.button(box,"osc1")
- box = win.box(parent=frame1)
- win.slider(1.0,0.25,4.0,90,250,box,"pitch1", linear=False)
+ box = self.win.box(parent=frame1)
+ self.win.button(box,"osc1")
+ box = self.win.box(parent=frame1)
+ self.win.slider(1.0,0.25,4.0,90,250,box,"pitch1", linear=False)
# oscillator 2 controls
- box = win.box(parent=frame2)
- win.button(box,"osc2")
- box = win.box(parent=frame2)
- win.slider(1.0,0.25,4.0,90,250,box,"pitch2", linear=False)
+ box = self.win.box(parent=frame2)
+ self.win.button(box,"osc2")
+ box = self.win.box(parent=frame2)
+ self.win.slider(1.0,0.25,4.0,90,250,box,"pitch2", linear=False)
# filter & mixer frames
- box = win.box(parent=hbox)
- box1 = win.box(False, box)
- box2 = win.box(False, box)
- frame1 = win.framebox("filter", True, box1, fr)
- frame2 = win.framebox("mixer", False, box2, fr)
+ box = self.win.box(parent=hbox)
+ box1 = self.win.box(False, box)
+ box2 = self.win.box(False, box)
+ frame1 = self.win.framebox("filter", True, box1, fr)
+ frame2 = self.win.framebox("mixer", False, box2, fr)
# filter controls
- box = win.box(False, parent=frame1)
- win.slider(1000.0,20.0,20000.0,250,40,box,"frequency", False,linear=False)
- box = win.box(False, parent=frame1)
- win.slider(0.9,0.0,1.0,250,40,box,"resonance", False)
+ box = self.win.box(False, parent=frame1)
+ self.win.slider(1000.0,20.0,20000.0,250,40,box,"frequency", False,linear=False)
+ box = self.win.box(False, parent=frame1)
+ self.win.slider(0.9,0.0,1.0,250,40,box,"resonance", False)
# mixer controls
- box = win.box(parent=frame2)
- win.slider(0.0,0.0,100.0,90,360,box,"vol1")
- box = win.box(parent=frame2)
- win.slider(0.0,0.0,100.0,90,360,box,"vol2")
- box = win.box(parent=frame2)
- win.slider(0.0,0.0,100.0,90,360,box,"noise")
- box = win.box(parent=frame2)
- win.slider(0.0,0.0,100.0,90,360,box,"mic")
+ box = self.win.box(parent=frame2)
+ self.win.slider(0.0,0.0,100.0,90,360,box,"vol1")
+ box = self.win.box(parent=frame2)
+ self.win.slider(0.0,0.0,100.0,90,360,box,"vol2")
+ box = self.win.box(parent=frame2)
+ self.win.slider(0.0,0.0,100.0,90,360,box,"noise")
+ box = self.win.box(parent=frame2)
+ self.win.slider(0.0,0.0,100.0,90,360,box,"mic")
- win.play()
+ self.win.play()
+
+ def write_file(self,filepath):
+ self.win.logger.debug("write_file\n\n")
+ self.win.set_channel_metadata()
+ f = open(filepath, 'w')
+ f.close()
+
+ def read_file(self,filepath):
+ self.win.logger.debug("read_file \n\n")
+ self.win.get_channel_metadata()