Created
August 28, 2015 13:27
-
-
Save wray/7a8c9e751ddd3fb59adf to your computer and use it in GitHub Desktop.
sound.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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