-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4dffb8b
commit af2ac9a
Showing
16 changed files
with
137 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ TODO.md | |
stub.lua | ||
CHANGELOG.md | ||
CS-16.pdx.zip | ||
CS-16.pdx_withExtraVisualizers.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
-- moar stats!!!! | ||
|
||
local RECT = pd.geometry.rect.new(0, 30, 400, 210) | ||
|
||
local t = {} | ||
local pdstats, stats = {}, { | ||
kernel = "0", | ||
serial = "0", | ||
game = "0", | ||
GC = "0", | ||
wifi = "0", | ||
audio = "0", | ||
idle = "0" | ||
} | ||
|
||
local ticks = 0 | ||
|
||
local refresh = math.floor(pd.display.getRefreshRate() / 2) | ||
|
||
local function statsUpdate() | ||
ticks = ticks + 1 | ||
|
||
if ticks == refresh then -- to reduce calls to stats | ||
ticks = 0 | ||
pdstats = pd.getStats() | ||
|
||
if pdstats == nil then | ||
pdstats = {} | ||
end | ||
|
||
stats = { | ||
kernel = "0", | ||
serial = "0", | ||
game = "0", | ||
GC = "0", | ||
wifi = "0", | ||
audio = "0", | ||
idle = "0" | ||
} | ||
|
||
|
||
for k, v in pairs(pdstats) do | ||
stats[k] = v | ||
end | ||
|
||
t = { | ||
"-- CPU --\n", | ||
"idle: ", | ||
stats.idle, | ||
"\nkernel: ", | ||
stats.kernel, | ||
"\ngame: ", | ||
stats.game, | ||
"\ngc: ", | ||
stats.GC, | ||
"\naudio: ", | ||
stats.audio | ||
} | ||
end | ||
|
||
gfx.setImageDrawMode(gfx.kDrawModeCopy) | ||
|
||
fnt8x8:drawText(table.concat(t), RECT) | ||
end | ||
|
||
return { "cpu stats", statsUpdate } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- dithered active notes | ||
|
||
local DITHER_TYPE = gfx.image.kDitherTypeDiagonalLine | ||
|
||
local img = gfx.image.new(20, 20) | ||
local inst | ||
|
||
local function ditheredNotesUpdate(data) | ||
for i = 1, 16 do | ||
inst = data["instruments"][i] | ||
if inst:isPlaying() then | ||
gfx.setColor(gfx.kColorXOR) | ||
|
||
gfx.pushContext(img) | ||
gfx.setColor(gfx.kColorBlack) | ||
gfx.fillRoundRect(0, 0, 20, 20, 2) | ||
gfx.popContext() | ||
|
||
gfx.setImageDrawMode(gfx.kDrawModeCopy) | ||
img:drawFaded((i * 25) - 22, 110, (instrumentTable[i]:getEnvelope():getValue()), DITHER_TYPE) | ||
|
||
gfx.setColor(gfx.kColorBlack) | ||
end | ||
end | ||
end | ||
|
||
return { "dithered notes", ditheredNotesUpdate } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters