justync7

wrapper

May 15th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. oldWrap = peripheral.wrap
  2. ints = {
  3.   [0] = "note.harp",
  4.   [1] = "note.bd",
  5.   [2] = "note.snare",
  6.   [3] = "note.hat",
  7.   [4] = "note.bassattack"
  8. }
  9.  
  10. peripheral.wrap = function(side)
  11.   local p = oldWrap(side)
  12.   p.oldNote = p.playNote
  13.   p.playNote = function(int, note)
  14.     int = ints[int]
  15.     anote = math.pow(2, (note-12) /12)
  16.     p.playSound(int, anote, 1)
  17.   end
  18.   return p
  19. end
Add Comment
Please, Sign In to add comment