diff options
author | Nathanaël Lécaudé <natcl@hotmail.com> | 2007-08-23 14:29:45 (GMT) |
---|---|---|
committer | Nathanaël Lécaudé <natcl@hotmail.com> | 2007-08-23 14:29:45 (GMT) |
commit | 8b76bdb87e9be3479d3fc79bd660ad5385faebc7 (patch) | |
tree | 07ea20c11110eda063ca46802c1ef71705fd8c6c | |
parent | 67e0d36e419fcec2ce913208c932f441333cfca0 (diff) |
Changed some names in soundlib to be more kid like
-rw-r--r-- | data/sound/playWave | 2 | ||||
-rw-r--r-- | data/sound/sequence | 6 | ||||
-rw-r--r-- | pippysound.kpf | 7 | ||||
-rwxr-xr-x | sound/snd.py | 20 |
4 files changed, 21 insertions, 14 deletions
diff --git a/data/sound/playWave b/data/sound/playWave index 8279c22..9988ac3 100644 --- a/data/sound/playWave +++ b/data/sound/playWave @@ -1,6 +1,6 @@ import sys sys.path.append('/usr/share/activities/Pippy.activity/sound') from snd import * -playWave(name='didjeridu', loop=True, dur=5) +playWave(name='didjeridu', loop=True, duration=5) audioOut() diff --git a/data/sound/sequence b/data/sound/sequence index f870094..683ea59 100644 --- a/data/sound/sequence +++ b/data/sound/sequence @@ -4,9 +4,9 @@ sys.path.append('/usr/share/activities/Pippy.activity/sound') from snd import * for i in range(25): pitch = random.randint(500,2000) - amp = 5000 - dur = 0.1 + amplitude = 5000 + duration = 0.1 starttime = i * 0.1 - playSine(pitch, amp, dur, starttime) + playSine(pitch, amplitude, duration, starttime) audioOut() diff --git a/pippysound.kpf b/pippysound.kpf new file mode 100644 index 0000000..78a1bb9 --- /dev/null +++ b/pippysound.kpf @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Komodo Project File - DO NOT EDIT --> +<project id="4816817d-cf1c-4bef-88ca-e0fa5342913b" kpf_version="4" name="pippysound.kpf"> +<preference-set idref="4816817d-cf1c-4bef-88ca-e0fa5342913b"> + <boolean id="import_live">1</boolean> +</preference-set> +</project> diff --git a/sound/snd.py b/sound/snd.py index 70db588..c8d39ef 100755 --- a/sound/snd.py +++ b/sound/snd.py @@ -23,8 +23,8 @@ def defEnvelope(attack=0.01, decay=0.1, sustain=0.8, release=0.1): scorelines.append("f100 0 1024 7 0 %ld 1. %ld %f %ld %f %ld 0" % (att, dec, sus, bal, sus, rel)) -def playSine( pitch=1000, amp=5000, dur=1, starttime=0): - """Play a sine wave (pitch = [1000], amp = [5000], dur = [1], starttime = [0])""" +def playSine( pitch=1000, amplitude=5000, duration=1, starttime=0): + """Play a sine wave (pitch = [1000], amp = [5000], duration = [1], starttime = [0])""" if not 1 in instrlist: orchlines.append("instr 1\n") orchlines.append("asig oscil p5, p4, 1\n") @@ -32,10 +32,10 @@ def playSine( pitch=1000, amp=5000, dur=1, starttime=0): orchlines.append("endin\n\n") instrlist.append(1) - scorelines.append("i1 %s %s %s %s\n" % (str(starttime), str(dur), str(pitch), str(amp))) + scorelines.append("i1 %s %s %s %s\n" % (str(starttime), str(duration), str(pitch), str(amplitude))) -def playSquare( pitch=1000, amp=5000, dur=1, starttime=0): - """Play a square wave (pitch = [1000], amp = [5000], dur = [1], starttime = [0])""" +def playSquare( pitch=1000, amplitude=5000, duration=1, starttime=0): + """Play a square wave (pitch = [1000], amplitude = [5000], duration = [1], starttime = [0])""" if not 2 in instrlist: orchlines.append("instr 2\n") orchlines.append("asig oscil p5, p4, 2\n") @@ -43,11 +43,11 @@ def playSquare( pitch=1000, amp=5000, dur=1, starttime=0): orchlines.append("endin\n\n") instrlist.append(2) - scorelines.append("i2 %f %f %f %f\n" % (float(starttime), float(dur), float(pitch), float(amp))) + scorelines.append("i2 %f %f %f %f\n" % (float(starttime), float(duration), float(pitch), float(amplitude))) -def playWave(name='horse', pitch=1, amp=1, loop=False, dur=1, starttime=0): - """Play a wave file (name = ['horse'], pitch = [1], amp = [1], loop = [False], dur = [1], starttime = [0])""" - fullname = '/usr/share/activities/TamTam.activity/Resources/Sounds/' + str(name) +def playWave(sound='horse', pitch=1, amplitude=1, loop=False, duration=1, starttime=0): + """Play a wave file (sound = ['horse'], pitch = [1], amplitude = [1], loop = [False], duration = [1], starttime = [0])""" + fullname = '/usr/share/activities/TamTam.activity/Resources/Sounds/' + str(sound) if loop == False: lp = 0 else: @@ -58,7 +58,7 @@ def playWave(name='horse', pitch=1, amp=1, loop=False, dur=1, starttime=0): orchlines.append("out asig\n") orchlines.append("endin\n\n") - scorelines.append("i10 %s %s\n" % (float(starttime), float(dur))) + scorelines.append("i10 %s %s\n" % (float(starttime), float(duration))) def audioOut(): path = os.path.dirname(os.path.abspath(__file__)) |