Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local data = {
- [1]={ -- Melody
- {3, "Forms FORM-29827281-12\n", 8},
- {3, "Test Assessment Report\n\n\n\n", 12},
- {3, "This was a triumph.\n", 0},
- {1, 1, 1, 10}, --This was a triumph
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 1, 7},
- {1, 1, 1, 9},
- {0, 1, 11, 0},
- {3, "I'm making a note here:\n", 0},
- {1, 1, 1, 0}, -- I'm making a note here:
- {1, 1, 1, 10},
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 1, 7},
- {1, 1, 3, 9},
- {3, "HUGE SUCCESS.\n", 0},
- {1, 1, 2, 5}, -- HUGE SUCCESS
- {1, 1, 1, 7},
- {1, 1, 1, 0},
- {0, 1, 7, 0},
- {3, "It's hard to overstate\n", 0},
- {1, 1, 1, 0}, -- It's hard to overstate my satisfaction
- {1, 1, 2, 7},
- {1, 1, 1, 9},
- {1, 1, 3, 10},
- {1, 1, 1, 7},
- {1, 1, 2, 4},
- {3, "my satisfaction\n", 0},
- {1, 1, 3, 5},
- {1, 1, 2, 7},
- {1, 1, 1, 0},
- {1, 1, 2, 0},
- {1, 1, 1, 9},
- {0, 1, 10, 0},
- {3, "Aperture Science\n", 0},
- {1, 1, 1, 10}, -- Aperture Science
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 1, 7},
- {1, 1, 1, 9},
- {0, 1, 10, 0},
- {3, "We do what we must\n", 0},
- {1, 1, 1, 0}, -- We do what we must
- {1, 1, 1, 10},
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 3, 7},
- {3, "Because ", 0},
- {1, 1, 1, 9}, -- Because
- {1, 1, 2, 5},
- {3, "we can.\n", 0},
- {1, 1, 1, 7}, -- We can
- {1, 1, 2, 0},
- {0, 1, 7, 0},
- {3, "For the good of all of us\n", 0},
- {1, 1, 2, 7}, -- For the good of all of us
- {1, 1, 1, 9},
- {1, 1, 2, 10},
- {1, 1, 1, 7},
- {1, 1, 2, 4},
- {1, 1, 3, 5},
- {1, 1, 2, 7},
- {3, "Except the ones who are dead\n\n\n", 0},
- {1, 1, 1, 0}, -- Except the ones who are dead
- {1, 1, 1, 5},
- {1, 1, 1, 7},
- {1, 1, 1, 8},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {0, 1, 2, 0},
- {3, "But there's no sense crying\n", 0},
- {1, 1, 1, 0}, -- But there's no sense cying over every mistake
- {1, 1, 1, 1},
- {1, 1, 2, 3},
- {1, 1, 2, 8},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {3, "over every mistake.\n", 0},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {1, 1, 2, 3},
- {1, 1, 1, 3},
- {0, 1, 1, 0},
- {3, "You just keep on trying\n", 0},
- {1, 1, 1, 0}, -- You just keep on trying till you run out of cake
- {1, 1, 1, 1},
- {1, 1, 2, 3},
- {1, 1, 2, 8},
- {1, 1, 1, 10},
- {1, 1, 1, 8},
- {3, "till you run out of cake\n", 0},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {1, 1, 1, 5},
- {1, 1, 1, 7},
- {1, 1, 2, 8},
- {1, 1, 1, 8},
- {0, 1, 1, 0},
- {3, "And the science gets done\n", 0},
- {1, 1, 1, 10}, -- And the science gets done
- {1, 1, 1, 12},
- {1, 1, 1, 13},
- {1, 1, 1, 13},
- {1, 1, 2, 12},
- {1, 1, 2, 10},
- {3, "And you make a neat gun\n", 0},
- {1, 1, 1, 8}, -- And you make a neat gun
- {1, 1, 1, 10},
- {1, 1, 1, 12},
- {1, 1, 1, 12},
- {1, 1, 2, 10},
- {1, 1, 2, 8},
- {3, "For the people who are\n", 0},
- {1, 1, 1, 5}, -- For the people who are
- {1, 1, 1, 3},
- {1, 1, 1, 5},
- {1, 1, 1, 8},
- {1, 1, 1, 8},
- {1, 1, 2, 7},
- {3, "still alive\n", 0},
- {1, 1, 1, 7}, -- Still alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 4, 0}, -- TOTAL TIME: 25
- {4, "", 0},
- {3, "Forms FORM-55551-5\n", 4},
- {3, "Personnel File Addendum\n\n\n", 6},
- {3, "Dear <<Subject Name Here>>\n\n\n", 11},
- {3, "I'm not even angry.\n", 0},
- {1, 1, 1, 10}, -- I'm not even angry
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 1, 7},
- {1, 1, 3, 9},
- {0, 1, 5, 0},
- {3, "I'm being so sincere right now\n", 0},
- {1, 1, 1, 0}, -- I'm being so sincere right now
- {1, 1, 1, 10},
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 2, 7},
- {1, 1, 3, 9},
- {1, 1, 2, 5},
- {1, 1, 1, 7},
- {1, 1, 2, 0},
- {0, 1, 6, 0},
- {3, "Even though you broke my heart\n", 0},
- {1, 1, 1, 0}, -- Even though you broke my heart and killed me
- {1, 1, 2, 7},
- {1, 1, 1, 9},
- {1, 1, 2, 10},
- {1, 1, 1, 7},
- {1, 1, 2, 4},
- {1, 1, 3, 5},
- {3, "And killed me.\n", 0},
- {1, 1, 2, 7},
- {1, 1, 1, 0},
- {1, 1, 2, 0},
- {1, 1, 2, 9},
- {0, 1, 5, 0},
- {3, "And tore me to pieces.\n", 0},
- {1, 1, 1, 10}, -- And tore me to pieces
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 1, 7},
- {1, 1, 3, 9},
- {0, 1, 5, 0},
- {3, "And threw every piece ", 0},
- {1, 1, 1, 0}, -- and threw every peice
- {1, 1, 1, 10},
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 3, 7},
- {3, "into ", 0},
- {1, 1, 1, 9}, -- Into
- {1, 1, 2, 5},
- {3, "a fire\n", 0},
- {1, 1, 1, 7}, -- A fire
- {1, 1, 2, 0},
- {0, 1, 7, 0},
- {3, "As they burned ", 0},
- {1, 1, 2, 7}, -- As they burned it hurt because
- {1, 1, 1, 9},
- {1, 1, 2, 10},
- {3, "it hurt because\n", 0},
- {1, 1, 1, 7},
- {1, 1, 2, 4},
- {1, 1, 3, 5},
- {1, 1, 2, 7},
- {3, "I was so happy for you!\n", 0},
- {1, 1, 1, 0}, -- I was so happy for you!
- {1, 1, 1, 5},
- {1, 1, 1, 7},
- {1, 1, 1, 8},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {0, 1, 2, 0},
- {3, "Now these points of data\n", 0},
- {1, 1, 1, 0}, -- Now these points of data make a beautiful line
- {1, 1, 1, 1},
- {1, 1, 2, 3},
- {1, 1, 2, 8},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {3, "make a beautiful line\n", 0},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {1, 1, 2, 3},
- {1, 1, 1, 3},
- {0, 1, 1, 0},
- {3, "And we're out of beta.\n", 0},
- {1, 1, 1, 0}, -- And we're out of beta we're releasing on time
- {1, 1, 1, 1},
- {1, 1, 2, 3},
- {1, 1, 2, 8},
- {1, 1, 1, 10},
- {1, 1, 1, 8},
- {3, "We're releasing on time\n", 0},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {1, 1, 1, 5},
- {1, 1, 1, 7},
- {1, 1, 2, 8},
- {1, 1, 1, 8},
- {0, 1, 1, 0},
- {3, "So I'm GLaD I got burned\n", 0},
- {1, 1, 1, 10}, -- So I'm GLaD I got burned
- {1, 1, 1, 12},
- {1, 1, 1, 13},
- {1, 1, 1, 13},
- {1, 1, 2, 12},
- {1, 1, 2, 10},
- {3, "Think of all the things we learned\n", 0},
- {1, 1, 1, 8}, -- Think of all the things we learned
- {1, 1, 1, 10},
- {1, 1, 1, 12},
- {1, 1, 1, 12},
- {1, 1, 2, 10},
- {1, 1, 2, 8},
- {3, "for the people who are\n", 0},
- {1, 1, 1, 5}, -- For the people who are
- {1, 1, 1, 3},
- {1, 1, 1, 5},
- {1, 1, 1, 8},
- {1, 1, 1, 8},
- {1, 1, 2, 7},
- {3, "still alive\n", 0},
- {1, 1, 1, 7}, -- Still alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 4, 0}, -- TOTAL TIME: 25
- {4, "", 0},
- {3, "Forms FORM-55551-6\n", 4},
- {3, "Personnel File Addendum Addendum\n\n\n", 7},
- {3, "One last thing:\n\n\n", 10},
- {3, "Go ahead and leave me.\n", 0},
- {1, 1, 1, 10}, -- Go ahead and leave me
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 1, 7},
- {1, 1, 3, 9},
- {0, 1, 5, 0},
- {3, "I think I prefer to stay inside\n", 0},
- {1, 1, 1, 0}, -- I think I'd prefer to stay inside
- {1, 1, 1, 10},
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 2, 7},
- {1, 1, 3, 9},
- {1, 1, 2, 5},
- {1, 1, 1, 7},
- {1, 1, 2, 0},
- {0, 1, 6, 0},
- {3, "Maybe you'll find someone else\n", 0},
- {1, 1, 1, 0}, -- Maybe you'll find someone else to help you
- {1, 1, 2, 7},
- {1, 1, 1, 9},
- {1, 1, 2, 10},
- {1, 1, 1, 7},
- {1, 1, 2, 4},
- {1, 1, 3, 5},
- {3, "to help you\n", 0},
- {1, 1, 2, 7},
- {1, 1, 1, 0},
- {1, 1, 2, 0},
- {1, 1, 2, 9},
- {0, 1, 5, 0},
- {3, "Maybe Black Mesa. . .\n", 0},
- {1, 1, 1, 10}, -- Maybe Black Mesa...
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 1, 7},
- {1, 1, 3, 9},
- {0, 1, 5, 0},
- {3, "THAT WAS A JOKE. ", 0},
- {1, 1, 1, 0}, -- THAT WAS A JOKE
- {1, 1, 1, 10},
- {1, 1, 1, 9},
- {1, 1, 1, 7},
- {1, 1, 3, 7},
- {1, 1, 1, 9}, -- HAHA
- {1, 1, 2, 5},
- {3, "FAT CHANCE.\n", 0},
- {1, 1, 1, 7}, -- FAT CHANCE
- {1, 1, 2, 0},
- {0, 1, 7, 0},
- {3, "Anyway, this cake is great.\n", 0},
- {1, 1, 2, 7}, -- Anyway this cake is great
- {1, 1, 1, 9},
- {1, 1, 2, 10},
- {1, 1, 1, 7},
- {1, 1, 2, 4},
- {1, 1, 3, 5},
- {1, 1, 2, 7},
- {3, "It's so delicious and moist\n", 0},
- {1, 1, 1, 0}, -- It's so delicious and moist
- {1, 1, 1, 5},
- {1, 1, 1, 7},
- {1, 1, 1, 8},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {0, 1, 2, 0},
- {3, "Look at me still talking\n", 0},
- {1, 1, 1, 0}, -- Look at me still talking when there's science to do
- {1, 1, 1, 1},
- {1, 1, 2, 3},
- {1, 1, 2, 8},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {3, "when there's Science to do.\n", 0},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {1, 1, 1, 5},
- {1, 1, 1, 3},
- {1, 1, 2, 3},
- {1, 1, 1, 3},
- {0, 1, 1, 0},
- {3, "When I look out there\n", 0},
- {1, 1, 1, 0}, -- When I look out there it makes me GLaD I'm not you
- {1, 1, 1, 1},
- {1, 1, 2, 3},
- {1, 1, 2, 8},
- {1, 1, 1, 10},
- {3, "it makes me GLaD I'm not you\n", 0},
- {1, 1, 1, 8},
- {1, 1, 1, 7},
- {1, 1, 1, 5},
- {1, 1, 1, 5},
- {1, 1, 1, 7},
- {1, 1, 2, 8},
- {1, 1, 1, 8},
- {0, 1, 1, 0},
- {3, "I've experiments to run\n", 0},
- {1, 1, 1, 10}, -- I've experiments to run
- {1, 1, 1, 12},
- {1, 1, 1, 13},
- {1, 1, 1, 13},
- {1, 1, 2, 12},
- {1, 1, 2, 10},
- {3, "There is research to be done\n", 0},
- {1, 1, 1, 8}, -- There is research to be done
- {1, 1, 1, 10},
- {1, 1, 1, 12},
- {1, 1, 1, 12},
- {1, 1, 2, 10},
- {1, 1, 2, 8},
- {3, "On the people who are\n", 0},
- {1, 1, 1, 5}, -- On the people who are
- {1, 1, 1, 3},
- {1, 1, 1, 5},
- {1, 1, 1, 8},
- {1, 1, 1, 8},
- {1, 1, 2, 7},
- {3, "still alive\n", 0},
- {1, 1, 1, 7}, -- Still alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 2, 0},
- {4, "", 2},
- {3, "PS: And believe me I am\nstill alive\n", 0},
- {1, 1, 1, 12}, -- And believe me I am
- {1, 1, 1, 12},
- {1, 1, 1, 14},
- {1, 1, 1, 12},
- {1, 1, 1, 9},
- {1, 1, 2, 5},
- {1, 1, 1, 7}, -- Still Alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 3, 0},
- {3, "PPS: I'm doing science and I'm\nstill alive\n", 0},
- {1, 1, 1, 12}, -- I'm doing science and I'm
- {1, 1, 1, 12},
- {1, 1, 1, 12},
- {1, 1, 1, 14},
- {1, 1, 1, 12},
- {1, 1, 1, 9},
- {1, 1, 2, 5},
- {1, 1, 1, 7}, -- Still Alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 3, 0},
- {3, "PPPS: I feel FANTASTIC and I'm\nstill alive\n\n", 0},
- {1, 1, 1, 12}, -- I feel FANTASTIC and I'm
- {1, 1, 1, 12},
- {1, 1, 1, 12},
- {1, 1, 1, 14},
- {1, 1, 1, 12},
- {1, 1, 1, 9},
- {1, 1, 2, 5},
- {1, 1, 1, 7}, -- Still Alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 0, 0},
- {3, "FINAL THOUGHT:\n", 4},
- {3, "While you're dying I'll be\nstill alive\n\n", 0},
- {1, 1, 1, 12}, -- While you're dying I'll be
- {1, 1, 1, 12},
- {1, 1, 1, 14},
- {1, 1, 1, 12},
- {1, 1, 1, 9},
- {1, 1, 2, 5},
- {1, 1, 1, 7}, -- Still Alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 0, 0},
- {3, "FINAL THOUGHT PS:\n", 4},
- {3, "And when you're dead I will be\nstill alive\n\n", 0},
- {1, 1, 1, 12}, -- And when you're dead I will be
- {1, 1, 1, 12},
- {1, 1, 1, 12},
- {1, 1, 1, 14},
- {1, 1, 1, 12},
- {1, 1, 1, 9},
- {1, 1, 2, 5},
- {1, 1, 1, 7}, -- Still Alive
- {1, 1, 1, 9},
- {1, 1, 3, 9},
- {0, 1, 3, 0},
- {3, "STILL ALIVE", 0},
- {1, 1, 1, 10}, -- Still Alive
- {1, 1, 1, 12},
- {1, 1, 4, 12},
- {3, "!STILL ALIVE", 0},
- {1, 1, 1, 10},
- {1, 1, 1, 9},
- {1, 1, 16, 9},
- {0, 1, 0, 1},
- -- STILL ALIVE --
- -- Credits
- {4, "", 2},
- {3, "Credits:\n\n", 8},
- {3, "Music by Jonathan Coulton\n", 8},
- {3, "Portal Game by Valve\n\n", 8},
- {3, "Program by Imgoodisher\n\n", 8},
- {3, "Thanks for trying this out!\n", 0},
- },
- }
- local speaker
- for i,v in pairs(rs.getSides()) do
- if peripheral.getType(v) == "speaker" then
- speaker = peripheral.wrap(v)
- break
- end
- end
- local notes = {}
- for n = -256, 256 do
- notes[n] = 2^(n/12)*440
- end
- local events = {
- ["note_on"] = function(channel, n)
- speaker.start(channel, notes[n])
- end,
- ["note_off"] = function(channel)
- speaker.stop(channel)
- end,
- }
- --local file = io.open("/stillalive", "r")
- --local data = textutils.unserialize(file:read("*a"))
- --file:close()
- local function play(data)
- --on/off, channel, time, note (offset from mid A)
- for i,v in pairs(data) do
- if v[1] == 1 then
- speaker.stop(v[2])
- speaker.start(v[2], notes[v[4]])
- elseif v[1] == 0 then
- speaker.stop(v[2])
- elseif v[1] == 3 then
- os.queueEvent("lyrics", v[2])
- elseif v[1] == 4 then
- os.queueEvent("clear")
- end
- sleep(0.25 * v[3])
- end
- end
- local function text()
- term.clear()
- term.setCursorPos(1, 1)
- term.setCursorBlink(true)
- while true do
- local e, text = os.pullEvent()
- if e == "lyrics" then
- if text == "!STILL ALIVE" then
- term.clear()
- local w, h = term.getSize()
- local str = "STILL ALIVE"
- term.setCursorPos(w/2-str:len()/2, h/2-1)
- textutils.slowWrite(str)
- speaker.shutdown()
- else
- textutils.slowWrite(text)
- end
- elseif e == "clear" then
- term.clear()
- term.setCursorPos(1, 1)
- end
- end
- end
- parallel.waitForAny(
- function()
- play(data[1])
- end,
- text
- )
- speaker.shutdown()
Add Comment
Please, Sign In to add comment