Ma3rX

Speakers from Immibis's Peripherals based Rednet Radio (server)

Nov 8th, 2025
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. rednet.open("top")
  2. print("Radio server started. Broadcasting all notes...")
  3.  
  4. local notes = { "C", "Cs", "D", "Ds", "E", "F", "Fs", "G", "Gs", "A", "As", "B" }
  5.  
  6. local octaves = { 1, 2, 3, 4, 5, 6, 7 }
  7.  
  8. local dur = 0.25
  9.  
  10. while true do
  11.   for _, oct in ipairs(octaves) do
  12.     for _, note in ipairs(notes) do
  13.       local msg = "note="..note..";oct="..oct..";dur="..dur
  14.       rednet.broadcast(msg)
  15.       print("Sent from [" .. tostring(os.getComputerID()) .. ": "..msg)
  16.       sleep(dur)
  17.     end
  18.   end
  19.   print("All notes played. Repeating in 2s...")
  20.   sleep(2)
  21. end
  22.  
Advertisement
Add Comment
Please, Sign In to add comment