Skip to content

Instantly share code, notes, and snippets.

@wray
Created August 28, 2015 13:27
Show Gist options
  • Save wray/7a8c9e751ddd3fb59adf to your computer and use it in GitHub Desktop.
Save wray/7a8c9e751ddd3fb59adf to your computer and use it in GitHub Desktop.
sound.py
# Here, I am importing the sound library
import sound
# Here, I am importing the time library
#
#
import time
# This is my function
#
# -----------------------------------------
def play_note(note,delay):
sound.play_effect("Piano_" + note)
time.sleep(delay)
# -----------------------------------------
time.sleep(1)
notes = [('D3',0.1),('D3',0.1),('D3',0.1),('G3',0.6),('D4',0.6),('C4',0.1),('B3',0.1),('A3',0.1),('G4',0.6),('D4',0.6)]
for note in notes:
play_note(note[0],note[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment