Microsoft Small Basic

Program Listing:
Embed this in your website
' Let It Be
' Music by John Lennon & Paul McCartney
' Arranged by Nonki Takahashi

GraphicsWindow.Title = "LET IT BE"
Init()
Play()

Sub CopyNote
  iTarget = param["target"]
  For i = param["from"] To param["to"]
    note[iTarget] = note[i]
    iTarget = iTarget + 1
  EndFor
EndSub

Sub Init
  chord["C"] = "E64G64>C4<"
  chord["C(2)"] = "C64E64G4"
  chord["C(3)"] = "<>E64G4"
  chord["C(4)"] = "C64E4"
  chord["C(5)"] = "E64G4"
  chord["C(6)"] = "G4"
  chord["C(7)"] = "E4"
  chord["C(8)"] = "G64>E2<"
  chord["C(9)"] = "<>E64G64>C2<"
  chord["Dm7"] = "D64F64<>"
  chord["Dm7(2)"] = "D64F4"
  chord["Dm7(3)"] = "A64>F4<"
  chord["Em"] = "E64G4"
  chord["Em(2)"] = "B64>G4<"
  chord["F"] = "C64D64A4"
  chord["F(2)"] = "F64A4"
  chord["F(3)"] = "C64F64A4"
  chord["F(4)"] = "A4"
  chord["F(5)"] = ">C64A2<"
  chord["F(6)"] = "<>F64>C4<"
  chord["F(7)"] = "<>F64A64>C2<"
  chord["G"] = "D64G64B4"
  chord["G(2)"] = "D64G4"
  chord["G(3)"] = "<>G64B64>D2<"
  chord["Am"] = "C64E64A4"
  chord["Am(2)"] = "C64E64A64<>"
  chord["Bb"] = "<>F64>D4<"
  ' ---- [1]
  note[1] = "O5"
  note[2] = chord["C"]      ' C
  note[3] = ""
  note[4] = chord["C"]
  note[5] = ""
  note[6] = chord["G"]      ' G
  note[7] = "<>"
  note[8] = chord["G"]
  note[9] = "<>"
  ' [2]
  note[10] = chord["Am"]    ' Am
  note[11] = "<>"
  note[12] = chord["Am"]
  note[13] = chord["Am(2)"]
  note[14] = chord["Am"]    ' F
  note[15] = "<>"
  note[16] = chord["F"]
  note[17] = "<>"
  ' [3]
  note[18] = chord["C(2)"]  ' C
  note[19] = ""
  note[20] = chord["C(2)"]
  note[21] = ""
  note[22] = chord["G(2)"]  ' G
  note[23] = "<>"
  note[24] = chord["G(2)"]
  note[25] = "<>"
  ' [4]
  note[26] = chord["F(2)"]  ' F
  note[27] = "<>"
  note[28] = chord["C(3)"]  ' C
  note[29] = chord["Dm7(2)"]   ' Dm7
  note[30] = chord["C(4)"]  ' C
  note[31] = ""
  note[32] = ""
  note[33] = ""
  lyric[26] = " When I"
  ' ---- [5]
  note[34] = chord["C(5)"]  ' C
  note[35] = ""
  note[36] = chord["C(5)"]
  note[37] = ""
  note[38] = chord["G(2)"]  ' G
  note[39] = "<>"
  note[40] = chord["G(2)"]
  note[41] = "<>"
  lyric[34] = "find myself in times of trouble"
  ' [6]
  note[42] = chord["Am"]    ' Am
  note[43] = "<>"
  note[44] = chord["Am"]
  note[45] = "<>"
  note[46] = chord["F(3)"]  ' F
  note[47] = "<>"
  note[48] = chord["F(3)"]
  note[49] = "<>"
  lyric[42] = "Mother Mary comes to me"
  ' [7]
  param = "from=34;to=41;target=50;"
  CopyNote()
  lyric[50] = "Speaking words of wisdom, let it"
  ' [8]
  note[58] = chord["F(4)"]  ' F
  note[59] = "<>"
  note[60] = chord["C(6)"]  ' C
  note[61] = chord["Dm7(2)"]' Dm7
  note[62] = chord["C(7)"]  ' C
  note[63] = ""
  lyric[58] = "be. And"
  ' [9]
  param = "from=34;to=41;target=64;"
  CopyNote()
  lyric[64] = "in my hour of darkness She is stand-"
  ' [10]
  param = "from=42;to=49;target=72;"
  CopyNote()
  lyric[72] = "ing right in front of me"
  ' [11]
  param = "from=50;to=57;target=80;"
  CopyNote()
  lyric[80] = "Speaking words of wisdom, let it"
  ' [12]
  param = "from=58;to=61;target=88;"
  CopyNote()
  note[92] = chord["C(5)"]
  note[93] = "<>"
  note[94] = "C64E64G4<>"
  lyric[88] = "be. Let it be,"
  ' [13]
  note[95] = chord["Am"]    ' Am
  note[96] = "<>"
  note[97] = chord["Am"]
  note[98] = "<>"
  note[99] = chord["Em"]    ' Em
  note[100] = "<>"
  note[101] = chord["Em"]
  note[102] = "<>"
  lyric[95] = " let it be, Let it be,"
  ' [14]
  note[103] = chord["F(3)"]  ' F
  note[104] = "<>"
  note[105] = chord["F(3)"]
  note[106] = "<>"
  note[107] = chord["C(5)"]  ' C
  note[108] = ""
  note[109] = chord["C(5)"]
  note[110] = ""
  lyric[103] = "let it be."
  ' [15]
  param = "from=18;to=25;target=111;"
  CopyNote()
  lyric[111] = "Wisper words of wisdom, let it"
  ' [16]
  param = "from=26;to=33;target=119;"
  CopyNote()
  lyric[119] = "be. And when"
  ' ---- [5]
  param = "from=34;to=41;target=127;"
  CopyNote()
  lyric[127] = "the broken hearted people"
  ' [6]
  param = "from=42;to=49;target=135;"
  CopyNote()
  lyric[135] = "Living in the world agree"
  ' [7]
  param = "from=34;to=41;target=143;"
  CopyNote()
  lyric[143] = "There will be an answer, let it"
  ' [8]
  param = "from=58;to=63;target=155;"
  CopyNote()
  lyric[155] = "be. And"
  ' [9]
  param = "from=34;to=41;target=163;"
  CopyNote()
  lyric[163] = "though they may be parted there is"
  ' [10]
  param = "from=42;to=49;target=171;"
  CopyNote()
  lyric[171] = "Still a chance that they will see"
  ' [11]
  param = "from=34;to=41;target=179;"
  CopyNote()
  lyric[179] = "There will be an answer, let it"
  ' [12]
  param = "from=88;to=94;target=187;"
  CopyNote()
  lyric[187] = "be. Let it be,"
  ' [13]
  param = "from=95;to=102;target=194;"
  CopyNote()
  lyric[194] = " let it be, Let it be,"
  ' [14]
  param = "from=103;to=110;target=202;"
  CopyNote()
  lyric[202] = " let it be. Yeah"
  ' [15]
  param = "from=18;to=25;target=210;"
  CopyNote()
  lyric[210] = "there will be an answer, let it"
  ' [17]
  param = "from=26;to=33;target=218;"
  CopyNote()
  lyric[218] = "be. Let it be,"
  ' [18]
  param = "from=95;to=102;target=226;"
  CopyNote()
  lyric[226] = " let it be, Let it be,
  ' [19]
  param = "from=103;to=110;target=234;"
  CopyNote()
  lyric[234] = " let it be."
  ' [20]
  param = "from=34;to=41;target=242;"
  CopyNote()
  lyric[242] = "Wisper words of wisdom, let it"
  ' [21]
  param = "from=58;to=62;target=250;"
  CopyNote()
  note[255] = ""
  lyric[250] = "be."
  ' [22]
  note[256] = chord["F(5)"]   ' F
  note[257] = chord["Em(2)"]  ' Em
  note[258] = chord["Dm7(3)"] ' Dm7
  note[259] = chord["C(8)"]   ' C
  note[260] = chord["Bb"]     ' Bb
  note[261] = chord["F(6)"]   ' F
  lyric[256] = "(Instrumental)"
  ' [23]
  note[262] = chord["G(3)"]   ' G
  note[263] = chord["F(7)"]   ' F
  note[264] = chord["C(9)"]   ' C
  note[265] = "<>"        ' C
  ' [24]
  note[266] = chord["F(5)"]   ' F
  note[267] = chord["Em(2)"]  ' Em
  note[268] = chord["Dm7(3)"] ' Dm7
  note[269] = chord["C(8)"]   ' C
  note[270] = chord["Bb"]     ' Bb
  note[271] = chord["F(6)"]   ' F
  ' [25]
  note[272] = chord["G(3)"]   ' G
  note[273] = chord["F(7)"]   ' F
  note[274] = chord["C(9)"]   ' C
  note[275] = "<>"        ' C
  ' [26]
  param = "from=34;to=41;target=276;"
  CopyNote()
  ' [27]
  param = "from=42;to=49;target=284;"
  CopyNote()
  ' [28]
  param = "from=34;to=41;target=292;"
  CopyNote()
  ' [29]
  param = "from=58;to=63;target=300;"
  CopyNote()
  ' [30]
  param = "from=34;to=41;target=306;"
  CopyNote()
  ' [31]
  param = "from=42;to=49;target=314;"
  CopyNote()
  ' [32]
  param = "from=34;to=41;target=322;"
  CopyNote()
  ' [33]
  param = "from=88;to=94;target=330;"
  CopyNote()
  lyric[330] = " Let it be,"
  ' [34]
  param = "from=95;to=102;target=337;"
  CopyNote()
  lyric[337] = " let it be, Let it be,
  ' [35]
  param = "from=103;to=110;target=345;"
  CopyNote()
  lyric[345] = " let it be."
  ' [36]
  param = "from=18;to=25;target=363;"
  CopyNote()
  lyric[363] = "Wisper words of wisdom, let it"
  ' [37]
  param = "from=26;to=33;target=371;"
  CopyNote()
  lyric[371] = "be. And when"
  ' ---- [38]
  param = "from=34;to=41;target=379;"
  CopyNote()
  lyric[379] = "the night is cloudy, There is"
  ' [39]
  param = "from=42;to=49;target=387;"
  CopyNote()
  lyric[387] = "still a light that shines on me,"
  ' [40]
  param = "from=34;to=41;target=395;"
  CopyNote()
  lyric[395] = "Shine until tomorrow, let it"
  ' [41]
  param = "from=58;to=63;target=403;"
  CopyNote()
  lyric[403] = "be. I"
  ' [42]
  param = "from=34;to=41;target=409;"
  CopyNote()
  lyric[409] = "wake up to the sound of music"
  ' [43]
  param = "from=42;to=49;target=417;"
  CopyNote()
  lyric[417] = "Mother Mary comes to me"
  ' [44]
  param = "from=34;to=41;target=425;"
  CopyNote()
  lyric[425] = "Speaking words of wisdom, let it"
  ' [45]
  param = "from=88;to=94;target=433;"
  CopyNote()
  lyric[433] = "be. Let it be,"
  ' [46]
  param = "from=95;to=102;target=440;"
  CopyNote()
  lyric[440] = " let it be, Let it be,"
  ' [47]
  param = "from=103;to=110;target=448;"
  CopyNote()
  lyric[448] = " let it be,"
  ' [48]
  param = "from=34;to=41;target=456;"
  CopyNote()
  lyric[456] = "There will be an answer, let it"
  ' [49]
  param = "from=88;to=94;target=464;"
  CopyNote()
  lyric[464] = "be. Let it be,"
  ' [46]
  param = "from=95;to=102;target=471;"
  CopyNote()
  lyric[471] = " let it be, Let it be,"
  ' [47]
  param = "from=103;to=110;target=479;"
  CopyNote()
  lyric[479] = " let it be,"
  ' [48]
  param = "from=34;to=41;target=487;"
  CopyNote()
  lyric[487] = "There will be an answer, let it"
  ' [49]
  param = "from=88;to=94;target=495;"
  CopyNote()
  lyric[495] = "be. Let it be,"
  ' [46]
  param = "from=95;to=102;target=502;"
  CopyNote()
  lyric[502] = " let it be, Let it be,"
  ' [47]
  param = "from=103;to=110;target=510;"
  CopyNote()
  lyric[510] = " let it be,"
  ' [48]
  param = "from=34;to=41;target=518;"
  CopyNote()
  lyric[518] = "Whisper words of wisdom, let it"
  ' [50]
  param = "from=250;to=255;target=526;"
  CopyNote()
  lyric[526] = "be.
  ' [51]
  param = "from=266;to=271;target=532;"
  CopyNote()
  ' [52]
  note[540] = chord["G(3)"]   ' G
  note[541] = chord["F(7)"]   ' F
  note[542] = chord["C(9)"]   ' C

  GraphicsWindow.BackgroundColor = "Black"
  GraphicsWindow.BrushColor = "White"
  GraphicsWindow.FontName = "Trebuchet MS"
  GraphicsWindow.FontSize = 24
  GraphicsWindow.DrawText(90, 10, "The Beatles")
  GraphicsWindow.FontSize = 100
  GraphicsWindow.DrawText(90, 50, "LET IT BE")
  GraphicsWindow.FontSize = 18
  GraphicsWindow.FontBold = "False"
  GraphicsWindow.DrawText(90, 180, "Music by John Lennon & Paul McCartney")
  GraphicsWindow.DrawText(90, 210, "Arranged by Nonki Takahashi")
  GraphicsWindow.FontName = "Consolas"
  GraphicsWindow.FontBold = "True"
  GraphicsWindow.FontSize = 24
  GraphicsWindow.BrushColor = "Lime"
  txt[1] = Shapes.AddText("")
  txt[2] = Shapes.AddText("")
  iTxt = 1
  Timer.Interval = 40
  Timer.Tick = OnTick
EndSub

Sub OnTick
  For it = 1 To 2
    x = Shapes.GetLeft(txt[it])
    y = Shapes.GetTop(txt[it])
    Shapes.Move(txt[it], x - 10, y)
  EndFor
EndSub

Sub Play
  n = Array.GetItemCount(note)
  index = Array.GetAllIndices(note)
  For i = 1 To n
    If lyric[index[i]] <> "" Then
      Shapes.Move(txt[iTxt], 640, 390)
      Shapes.SetText(txt[iTxt], lyric[index[i]])
      iTxt = 3 - iTxt
    EndIf
    Sound.PlayMusic(note[index[i]])
  EndFor
EndSub

Copyright (c) Microsoft Corporation. All rights reserved.