#This makes the coding of the song easier
def note(n):
    if n == 1:return 880
    elif n == 2:return 987.77
    elif n == 3:return 1046.5
    elif n == 4:return 1174.66
    elif n == 5:return 1318.51
    elif n == 6:return 1396.91
    elif n == 7:return 1567.98
    elif n == 8:return 1760.00
    elif n == 9:return 932.33
    return 0

#This is the coding for the song
def Pirates( time,  octave):
    beep(time, note(1)*octave)
    beep(time, note(3)*octave)
    beep(time, note(4)*octave)
    wait(time)
    beep(time, note(4)*octave)
    wait(time)
    beep(time, note(4)*octave)
    beep(time, note(5)*octave)
    beep(time, note(6)*octave)
    wait(time)
    beep(time, note(6)*octave)
    wait(time)
    beep(time, note(6)*octave)
    beep(time, note(7)*octave)
    beep(time, note(5)*octave)
    wait(time)
    beep(time, note(5)*octave)
    wait(time)
    beep(time, note(4)*octave)
    beep(time, note(3)*octave)
    beep(time, note(3)*octave)
    beep(time*2, note(4)*octave)
    wait(time)
    beep(time, note(1)*octave)
    beep(time, note(3)*octave)
    beep(time, note(4)*octave)
    wait(time)
    beep(time, note(4)*octave)
    wait(time)
    beep(time, note(4)*octave)
    beep(time, note(5)*octave)
    beep(time, note(6)*octave)
    wait(time)
    beep(time, note(6)*octave)
    wait(time)
    beep(time, note(6)*octave)
    beep(time, note(7)*octave)
    beep(time, note(5)*octave)
    wait(time)
    beep(time, note(5)*octave)
    wait(time)
    beep(time, note(4)*octave)
    beep(time, note(3)*octave)
    beep(time*2, note(4)*octave)
    wait(time*2)
    beep(time, note(1)*octave)
    beep(time, note(3)*octave)
    beep(time, note(4)*octave)
    wait(time)
    beep(time, note(4)*octave)
    wait(time)
    beep(time, note(4)*octave)
    beep(time, note(6)*octave)
    beep(time, note(7)*octave)
    wait(time)
    beep(time, note(7)*octave)
    wait(time)
    beep(time, note(7)*octave)
    beep(time, note(1)*2*octave)
    beep(time, note(9)*2*octave)
    wait(time)
    beep(time, note(9)*2*octave)
    wait(time)
    beep(time, note(1)*2*octave)
    beep(time, note(7)*octave)
    beep(time, note(1)*2*octave)
    beep(time, note(4)*octave)
    wait(time*2)
    beep(time, note(4)*octave)
    beep(time, note(5)*octave)
    beep(time, note(6)*octave)
    wait(time)
    beep(time, note(6)*octave)
    wait(time)
    beep(time, note(7)*octave)
    wait(time)
    beep(time, note(1)*2*octave)
    beep(time, note(4)*octave)
    wait(time*2)
    beep(time, note(4)*octave)
    beep(time, note(6)*octave)
    beep(time, note(5)*octave)
    wait(time)
    beep(time, note(5)*octave)
    wait(time)
    beep(time, note(6)*octave)
    beep(time, note(4)*octave)
    beep(time*3, note(5)*octave)

from Myro import *
init("sim")
#This is the song part of the program
Pirates(.15,1) #takes in duration of each note, and the octave to use

Create pirates_of_the_caribbean.py