Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Public Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
- Public Declare Function MessageBeep Lib "User32" (ByVal wType As Long) As Long
- Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
- '====================================================================
- Public Sub Main()
- PlayMusic2
- End Sub
- '====================================================================
- ' http://processors.wiki.ti.com/index.php/Playing_The_Imperial_March
- '====================================================================
- Private Sub PlayMusic2()
- Const note_c = 261
- Const note_d = 294
- Const note_e = 329
- Const note_f = 349
- Const note_g = 391
- Const note_gS = 415
- Const note_a = 440
- Const note_aS = 455
- Const note_b = 466
- Const note_cH = 523
- Const note_cSH = 554
- Const note_dH = 587
- Const note_dSH = 622
- Const note_eH = 659
- Const note_fH = 698
- Const note_fSH = 740
- Const note_gH = 784
- Const note_gSH = 830
- Const note_aH = 880
- Const ADD_TIME = 1.2
- Beep note_a, 500 * ADD_TIME
- Beep note_a, 500 * ADD_TIME
- Beep note_a, 500 * ADD_TIME
- Beep note_f, 350 * ADD_TIME
- Beep note_cH, 150 * ADD_TIME
- Beep note_a, 500 * ADD_TIME
- Beep note_f, 350 * ADD_TIME
- Beep note_cH, 150 * ADD_TIME
- Beep note_a, 650 * ADD_TIME
- Sleep 150 * ADD_TIME
- ' End of first bit...
- Beep note_eH, 500 * ADD_TIME
- Beep note_eH, 500 * ADD_TIME
- Beep note_eH, 500 * ADD_TIME
- Beep note_fH, 350 * ADD_TIME
- Beep note_cH, 150 * ADD_TIME
- Beep note_gS, 500 * ADD_TIME
- Beep note_f, 350 * ADD_TIME
- Beep note_cH, 150 * ADD_TIME
- Beep note_a, 650 * ADD_TIME
- Sleep 150 * ADD_TIME
- ' End of second bit...
- Beep note_aH, 500 * ADD_TIME
- Beep note_a, 300 * ADD_TIME
- Beep note_a, 150 * ADD_TIME
- Beep note_aH, 400 * ADD_TIME
- Beep note_gSH, 200 * ADD_TIME
- Beep note_gH, 200 * ADD_TIME
- Beep note_fSH, 125 * ADD_TIME
- Beep note_fH, 125 * ADD_TIME
- Beep note_fSH, 250 * ADD_TIME
- Sleep 250 * ADD_TIME
- Beep note_aS, 250 * ADD_TIME
- Beep note_dSH, 400 * ADD_TIME
- Beep note_dH, 200 * ADD_TIME
- Beep note_cSH, 200 * ADD_TIME
- Beep note_cH, 125 * ADD_TIME
- Beep note_b, 125 * ADD_TIME
- Beep note_cH, 250 * ADD_TIME
- Sleep 250 * ADD_TIME
- Beep note_f, 125 * ADD_TIME
- Beep note_gS, 500 * ADD_TIME
- Beep note_f, 375 * ADD_TIME
- Beep note_a, 125 * ADD_TIME
- Beep note_cH, 500 * ADD_TIME
- Beep note_a, 375 * ADD_TIME
- Beep note_cH, 125 * ADD_TIME
- Beep note_eH, 650 * ADD_TIME
- ' End of third bit... Though it doesn't play well let's repeat it!
- Beep note_aH, 500 * ADD_TIME
- Beep note_a, 300 * ADD_TIME
- Beep note_a, 150 * ADD_TIME
- Beep note_aH, 400 * ADD_TIME
- Beep note_gSH, 200 * ADD_TIME
- Beep note_gH, 200 * ADD_TIME
- Beep note_fSH, 125 * ADD_TIME
- Beep note_fH, 125 * ADD_TIME
- Beep note_fSH, 250 * ADD_TIME
- Sleep 250 * ADD_TIME
- Beep note_aS, 250 * ADD_TIME
- Beep note_dSH, 400 * ADD_TIME
- Beep note_dH, 200 * ADD_TIME
- Beep note_cSH, 200 * ADD_TIME
- Beep note_cH, 125 * ADD_TIME
- Beep note_b, 125 * ADD_TIME
- Beep note_cH, 250 * ADD_TIME
- Sleep 250 * ADD_TIME
- Beep note_f, 250 * ADD_TIME
- Beep note_gS, 500 * ADD_TIME
- Beep note_f, 375 * ADD_TIME
- Beep note_cH, 125 * ADD_TIME
- Beep note_a, 500 * ADD_TIME
- Beep note_f, 375 * ADD_TIME
- Beep note_cH, 125 * ADD_TIME
- Beep note_a, 650 * ADD_TIME
- ' End of the song...
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement