Advertisement
Fraeric123

Melody

May 18th, 2025 (edited)
579
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | Gaming | 0 0
  1. local computer = require("computer")
  2.  
  3. melody = {
  4.   {660, 0.1}, {660, 0.1}, {0, 0.1}, {660, 0.1},
  5.   {0, 0.1}, {510, 0.1}, {660, 0.1}, {0, 0.1},
  6.   {770, 0.1}, {0, 0.3}, {380, 0.1}, {0, 0.3},
  7.  
  8.   {510, 0.1}, {0, 0.1}, {380, 0.1}, {0, 0.1},
  9.   {320, 0.1}, {0, 0.2}, {440, 0.1}, {0, 0.1},
  10.   {480, 0.1}, {0, 0.1}, {450, 0.1}, {0, 0.1},
  11.   {430, 0.1}, {0, 0.1}, {380, 0.1}, {660, 0.1},
  12.   {760, 0.1}, {860, 0.1}, {0, 0.1},
  13.  
  14.   {700, 0.1}, {800, 0.1}, {660, 0.1}, {0, 0.1},
  15.   {520, 0.1}, {580, 0.1}, {480, 0.1}, {0, 0.2},
  16.  
  17.   {510, 0.1}, {0, 0.1}, {380, 0.1}, {0, 0.1},
  18.   {320, 0.1}, {0, 0.2}, {440, 0.1}, {0, 0.1},
  19.   {480, 0.1}, {0, 0.1}, {450, 0.1}, {0, 0.1},
  20.   {430, 0.1}, {0, 0.1}, {380, 0.1}, {660, 0.1},
  21.   {760, 0.1}, {860, 0.1}, {0, 0.1},
  22.  
  23.   {700, 0.1}, {800, 0.1}, {660, 0.1}, {0, 0.1},
  24.   {520, 0.1}, {580, 0.1}, {480, 0.1}, {0, 0.2}
  25. }
  26.  
  27.  
  28. function music()
  29.     for _, note in ipairs(melody) do
  30.         print(note[1], note[2])
  31.         if note[1] == 0 then os.sleep(note[2]) else computer.beep(note[1], note[2]) end
  32.     end
  33.     music()
  34. end
  35.  
  36. music()
Advertisement
Comments
  • dutmdh
    5 days
    # text 0.29 KB | 0 0
    1. Leon West Accidental Goblin King Audiobooks 1-4
    2.  
    3. magnet:?xt=urn:btih:49d386821d7a4093ac6209084242fbdf979b0ac1
    4. magnet:?xt=urn:btih:9f49b631081256fdab2d7b13927ce27bd44cf683
    5. magnet:?xt=urn:btih:6ef04c5cd32428d63afbca8a5b754688082059d3
    6. magnet:?xt=urn:btih:feae4390a335f0743bc8852d70183ace64240e1a
Add Comment
Please, Sign In to add comment
Advertisement