You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CrazedProgrammer edited this page Dec 13, 2016
·
1 revision
Welcome to the wave wiki!
Contents
Context
Output
Track
Instance
Installation
Because this API is not publicly released yet, I don't provide a PasteBin download.
Instead what you do is download the wave.lua file and put it on your CC computer.
You load the API with dofile: local wave = dofile("path/to/wave.lua")
Example program
local wave = dofile("wave.lua") -- loads wave
local context = wave.createContext() -- creates the audio context
context:addOutput(commands) -- Adds the command computer output
local track = wave.loadTrack("A Kind Of Magic.nbs") -- Loads the track from the file
local instance = context:addInstance(track) -- Creates and adds an audio instance from the track
while instance.playing do -- While the instance hasn't finished playing
context:update() -- Updates the context which in turn plays the notes
os.sleep(0.05) -- Sleeps for 0.05s
end