Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/library/pippy/sound.py
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@laptop.org>2007-12-14 18:45:23 (GMT)
committer C. Scott Ananian <cscott@laptop.org>2007-12-14 18:55:26 (GMT)
commit71c9a57d4fbc4713b9f5892e1e9140d12cb256fc (patch)
treef741de17c215d25fe2ad9a29e33b9ab78f014b30 /library/pippy/sound.py
parenta9d1055a632ad960231dddf98045c060a2a660d7 (diff)
Move imports around to ensure 'import pippy' is as fast as possible.
Diffstat (limited to 'library/pippy/sound.py')
-rwxr-xr-xlibrary/pippy/sound.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/pippy/sound.py b/library/pippy/sound.py
index 570c10c..319e190 100755
--- a/library/pippy/sound.py
+++ b/library/pippy/sound.py
@@ -2,18 +2,19 @@
# added frequency modulation genertor
# audioOut write a wave file if a string is given as argument
-import os
orchlines = []
scorelines = []
instrlist = []
fnum = [100]
+"""XXX: This function seems to be broken. (CSA)
def quit(self):
perf.Stop()
perf.Join()
cs.Reset()
cs = None
+"""
def defAdsr(attack=0.01, decay=0.1, sustain=0.8, release=0.1):
"""Define an ADSR envelope. fnum = defADSR(attack = [0.01], decay = [0.1], sustain = [0.8], release = [0.1])"""
@@ -166,13 +167,16 @@ def playWave(sound='horse', pitch=1, amplitude=1, loop=False, duration=1, startt
scorelines.append('i9 %f %f "%s" %s %s %s %s %s\n' % (float(starttime), float(duration), fullname, str(pitch), str(amplitude), str(lp), str(pitenv), str(ampenv)))
def getSoundList():
+ import os
return sorted(os.listdir('/usr/share/activities/TamTamEdit.activity/common/Resources/Sounds/'))
def audioOut(file=None):
"""Compile a .csd file and start csound to run it. If a string is given as argument, it write a wave file on disk instead of sending sound to hp. (file = [None])"""
global temp_path
+ import os
if temp_path is None:
from sugar import env
+ import os.path
temp_path = env.get_profile_path() + '/pippy'
if not os.path.isdir(temp_path):
os.mkdir(temp_path)