Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m=peripheral.wrap("right") --Monitor side (set for 3x3 advanced monitor)
- n=peripheral.wrap("back") --Noteblock side
- m.setBackgroundColor(colors.black)
- m.clear()
- function wt(x,y,t,c)
- m.setBackgroundColor(c)
- m.setCursorPos(x,y)
- m.write(t)
- end
- function pn(f,l)
- n.setPitch(f) --pitch {0-24}
- n.triggerNote()
- sleep(l) --note length
- end
- wt(10,2,"Choose song",colors.black)
- wt(14,4,"Moonlight",colors.purple)
- wt(14,5,"Sonata ",colors.purple)
- wt(8,4,"NBC",colors.blue)
- wt(8,6,"One",colors.red)
- wt(7,8,"Zelda",colors.green)
- wt(7,10,"Viva ",colors.purple)
- function nbc()
- pn(15,.2)
- pn(24,.2)
- pn(20,.2)
- end
- function One()
- pn(16,.2)
- pn(23,.2)
- pn(16,.2)
- pn(19,1)
- pn(12,.2)
- pn(23,.2)
- pn(12,.2)
- pn(19,1)
- pn(16,.2)
- pn(23,.2)
- pn(16,.2)
- pn(19,1)
- pn(12,.2)
- pn(23,.2)
- pn(12,.2)
- pn(19,.4)
- pn(24,.1)
- end
- function viva()
- pn(0,.2)
- pn(0,.2)
- pn(0,.2)
- pn(0,.1)
- pn(2,.2)
- pn(2,.1)
- pn(2,.2)
- pn(2,.2)
- pn(2,.2)
- pn(7,.2)
- pn(7,.2)
- pn(7,.2)
- pn(7,.1)
- pn(4,.2)
- pn(4,.1)
- pn(4,.2)
- pn(4,.2)
- pn(4,.2)
- end
- function zelda() --http://www.zeldacapital.com/sheet_music/piano/loz_pdfs/LegendofZelda-Overworld.pdf
- pn(5,.8)
- pn(5,.2)
- pn(5,.1)
- pn(5,.2)
- pn(5,.1)
- pn(5,.3)
- pn(3,.1)
- pn(5,.6)
- pn(5,.2)
- pn(5,.1)
- pn(5,.2)
- pn(5,.1)
- pn(5,.3)
- pn(3,.1)
- pn(5,.6)
- pn(5,.2)
- pn(5,.1)
- pn(5,.2)
- pn(5,.1)
- pn(5,.2)
- pn(0,.1)
- pn(0,.1)
- pn(0,.2)
- pn(0,.1)
- pn(0,.1)
- pn(0,.2)
- pn(0,.1)
- pn(0,.1)
- pn(0,.2)
- pn(0,.2)
- pn(5,.4)
- pn(0,.7)
- pn(5,.1)
- pn(5,.1)
- pn(7,.1)
- pn(9,.1)
- pn(10,.1)
- pn(12,.9) -- not done
- end
- function moonlight()
- end
- function touch()
- if mouseWidth > 7 and mouseWidth < 11 and mouseHeight == 4 then
- nbc()
- elseif mouseWidth > 7 and mouseWidth < 11 and mouseHeight == 6 then
- One()
- elseif mouseWidth > 6 and mouseWidth < 12 and mouseHeight == 8 then
- zelda()
- elseif mouseWidth > 6 and mouseWidth < 12 and mouseHeight == 10 then
- viva()
- elseif mouseWidth > 13 and mouseWidth < 23 and mouseHeight > 3 and mouseHeight < 6 then
- moonlight()
- end
- end
- print("Screen is now ready.")
- print("Press 'x' to exit.")
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if event=="monitor_touch" then
- mouseWidth = p2
- mouseHeight = p3
- touch()
- end
- until event=="char" and p1==("x") --press x to exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement