Advertisement
Redxone

[Python][MusicStandAlone

Oct 27th, 2015
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. import winsound
  2. import time
  3.  
  4. music = []
  5.  
  6. def synpose(table):
  7.     for note in table:
  8.         music.append( (note, 200, 0) )
  9.  
  10. def compose(note):
  11.     music.append( (note, 200, 0) )
  12.  
  13. def precise(note, time):
  14.     music.append( (note, time, 0) )
  15.  
  16. def compros(note, time, delay):
  17.     music.append( (note, time, delay) )
  18.  
  19. # - Compose basic stuff
  20. synpose([
  21.     554,
  22.     1108,
  23.     830,
  24.     739,
  25.     1479,
  26.     830,
  27.     1396,
  28.     830,
  29.     554,
  30.     1108,
  31.     830,
  32.     739,
  33.     1479,
  34.     830,
  35.     1396,
  36.     830,
  37.     622,
  38.     1108,
  39.     830,
  40.     739,
  41.     1479,
  42.     830,
  43.     1396,
  44.     830,
  45.     622,
  46.     1108,
  47.     838,
  48.     739,
  49.     1479,
  50.    
  51. ])
  52.  
  53.  
  54.  
  55. for sound in music:
  56.     print ("[#-MUZ0-IC#] - Frec[" + str(float(sound[0])) + "] Duration[" + str(float(sound[1])) + "]")
  57.     time.sleep(0.01)
  58.     winsound.Beep(sound[0], sound[1])
  59.     print ("[#-MUZ0-IC#] - Waiting " + str(float(sound[2])) + "s")
  60.     time.sleep(sound[2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement