eahil

First.py

Sep 2nd, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. # Sound Gen concept in python <<ehl>>
  2. # First ver: Imperative
  3. import os
  4.  
  5. x = ""
  6.  
  7. def fileOpen(fileopened):
  8.     global f
  9.     f = open(fileopened, "r")
  10.  
  11.  
  12. def soundGen(sound = ""):
  13.     global x
  14.     sound = x
  15.     if sound == "":
  16.         # Causes a rest in default soundGen()
  17.         # ex: soundGen() makes no sound
  18.         pass
  19.     else:
  20.         fileOpen(sound)
  21.         f.read()
  22. def rest()
  23.     global x
  24.     x = ""
  25.  
  26.  
  27. def aSharp()
  28.     global x
  29.     x = "A/A_sharp.mp3"
  30.  
  31. def bFlat():
  32.     global x
  33.     x = "B/B_flat.mp3"
  34.  
  35. while True:
  36.     rest()
  37.     soundGen()
  38.     aSharp()
  39.     soundGen()
  40.     rest()
  41.     soundGen()
  42.     bFlat()
  43.     soundGen()
  44.     rest()
Advertisement
Add Comment
Please, Sign In to add comment