Advertisement
DEV_Programming

devnote

Aug 3rd, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. --[[Devnote is created by Devon the Novice and has no usage limits at all, edit, rewrite, and destroy this all you want, some credit would be nice, but is not required and report the bugs. by bugs I mean me screwing up with a name or something]]--
  2.  
  3. note = nil
  4.  
  5. function wrap(side)
  6.  local wrapped = false
  7.  if side ~= nil then
  8.   note = peripheral.wrap(side)
  9.   wrapped = true
  10.  else
  11.   for _,side in pairs(rs.getSides()) do
  12.    if peripheral.isPresent(side) and peripheral.getType(side) == "note" then
  13.     note = peripheral.wrap(side)
  14.     wrapped = true
  15.    end
  16.   end
  17.  end
  18.  return wrapped
  19. end
  20.  
  21. function piano(nPitch)
  22.  note.playNote(0,nPitch)
  23. end
  24.  
  25. function drum(nPitch)
  26.  note.playNote(1,nPitch)
  27. end
  28.  
  29. function snare(nPitch)
  30.  note.playNote(2,nPitch)
  31. end
  32.  
  33. function click(nPitch)
  34.  note.playNote(3,nPitch)
  35. end
  36.  
  37. function bass(nPitch)
  38.  note.playNote(4,nPitch)
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement