-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
64 lines (49 loc) · 1.17 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
local Workspace = require 'workspace'
local sampleRate = 48000
local bitDepth = 16
local channelCount = 1
local bufferSize = 1024
local bufferCount = 4
local workspace
function love.load()
workspace = Workspace(sampleRate, channelCount)
workspace:spawnModule('output', vec2(64 * 3, 64 * -1))
workspace:spawnModule('oscillator', vec2(64 * -4, 0))
end
function love.keypressed(...)
local key = ...
if key == 'f11' or (key == 'return' and love.keyboard.isDown('lalt', 'ralt')) then
love.window.setFullscreen(not love.window.getFullscreen())
workspace.cam:setDirty()
return
end
if key == 'q' and love.keyboard.isDown('lctrl', 'rctrl') then
love.event.quit()
return
end
workspace:keypressed(...)
end
function love.keyreleased(...)
workspace:keyreleased(...)
end
function love.mousepressed(...)
workspace:mousepressed(...)
end
function love.mousereleased(...)
workspace:mousereleased(...)
end
function love.wheelmoved(...)
workspace:wheelmoved(...)
end
function love.resize(...)
workspace:resize(...)
end
function love.update(dt)
workspace:update(dt)
end
function love.draw()
workspace:draw()
end
function love.filedropped(...)
workspace:filedropped(...)
end