Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scripts/EdSy.py
diff options
context:
space:
mode:
authorOli <olivier.beloanger@umontreal.ca>2007-07-30 05:06:46 (GMT)
committer Oli <olivier.beloanger@umontreal.ca>2007-07-30 05:06:46 (GMT)
commit2cd4845fe4a057923fe9f33f7db1567d190ebca2 (patch)
tree1498aba6ebea0e91845d381c524ca88bcc76949f /scripts/EdSy.py
parent143f535abcf66b6bb16ac3ae2be33f53233411c9 (diff)
script for editing synthFile
Diffstat (limited to 'scripts/EdSy.py')
-rw-r--r--scripts/EdSy.py72
1 files changed, 72 insertions, 0 deletions
diff --git a/scripts/EdSy.py b/scripts/EdSy.py
new file mode 100644
index 0000000..f778232
--- /dev/null
+++ b/scripts/EdSy.py
@@ -0,0 +1,72 @@
+import shelve
+
+class EdSy:
+ def __init__(self):
+ self.types =[]
+ self.controls = []
+ self.sources = []
+ self.fxs = []
+ self.envelope = []
+ self.locations = []
+ self.connections = []
+ self.duration = 0.
+
+ def load(self, file):
+ self.fullPath = "/home/olpc/tamtam/Resources/SynthFiles/" + file
+ f = shelve.open( self.fullPath, 'r')
+ self.loadState(f)
+ f.close()
+
+ def process(self):
+ for i in range(len(self.locations)):
+ if i < 4:
+ if self.locations[i][1] >= 700:
+ self.locations[i] = [450,710]
+ else:
+ self.locations[i][0] -= 150
+ elif i < 8:
+ if self.locations[i][1] >= 700:
+ self.locations[i] = [225,710]
+ else:
+ self.locations[i][0] -= 150
+ elif i < 12:
+ if self.locations[i][1] >= 700:
+ self.locations[i] = [675,710]
+ else:
+ self.locations[i][0] -= 150
+ elif i == 12:
+ self.locations[i] = [450,625]
+
+ def save(self):
+ f = shelve.open(self.fullPath, 'n')
+ self.saveState(f)
+ f.close()
+
+ def saveState( self, state ):
+ state['types'] = self.types
+ state['controls'] = self.controls
+ state['sources'] = self.sources
+ state['fxs'] = self.fxs
+ state['envelope'] = self.envelope
+ state['locations'] = self.locations
+ state['connections'] = self.connections
+ state['duration'] = self.duration
+
+ def loadState( self, state ):
+ self.types = state['types']
+ self.controls = state['controls']
+ self.sources = state['sources']
+ self.fxs = state['fxs']
+ self.envelope = state['envelope']
+ self.locations = state['locations']
+ self.connections = state['connections']
+ self.duration = state['duration']
+
+ print "types: ", self.types
+ print "controls: ", self.controls
+ print "sources: ", self.sources
+ print "fxs: ", self.fxs
+ print "envelope: ", self.envelope
+ print "locations: ", self.locations
+ print "connections: ", self.connections
+ print "duration: ", self.duration