Advertisement
Guest User

Music

a guest
Sep 21st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. s = peripheral.wrap('left')
  2. function playnote(s,channel,note, time)
  3.   local f = 0
  4.   if     note == 'c' then f = 261.63
  5.   elseif note == 'c#' then f = 277.18
  6.   elseif note == 'd' then f = 293.66
  7.   elseif note == 'd#' then f = 311.13
  8.   elseif note == 'e' then f = 329.63
  9.   elseif note == 'f' then f = 349.23
  10.   elseif note == 'f#' then f = 369.99
  11.   elseif note == 'g' then f = 392.00
  12.   elseif note == 'g#' then f = 415.30
  13.   elseif note == 'a' then f = 440.00
  14.   elseif note == 'a#' then f = 466.16
  15.   elseif note == 'b' then f = 493.88
  16. end
  17.  
  18. s.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement