Skip to content

Commit

Permalink
version 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanobot567 authored Jan 20, 2025
1 parent 4dffb8b commit af2ac9a
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ TODO.md
stub.lua
CHANGELOG.md
CS-16.pdx.zip
CS-16.pdx_withExtraVisualizers.zip
5 changes: 2 additions & 3 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ If you would like to change an effect intensity (signified by the decimal number

In the `song` screen, you can view and modify your song's global options, such as the tempo and pattern length (these can be modified via the crank). Your song name and author name is displayed at the top.

> IMPORTANT NOTE! currently, the tempo can only be changed by intervals of 7.5 because of a bug in Playdate OS. as soon as a fix is implemented, this message will be deleted.
Here you can also save and load your songs via the Playdate OS menu. If you select `load`, you can also perform file operations on your songs, such as renaming, deleting, and cloning. You can press `right` to view file metadata as well.

![](assets/fileops.gif)
Expand All @@ -160,15 +158,16 @@ In the system menu, you can also access and change CS-16 settings, such as dark
- `behavior/`
- `play on load` (play pattern immediately on song load)
- `stop if sampling` (stop the pattern if you are currently sampling audio)
- `precise tempo chg` (enables precise tempo editing [increment / decrement tempo by 0.1 instead of 1 when editing])
- `tempo edit stop` (stop the pattern when tempo is modified)
- `save .wav samples` (alongside .pda audio, save .wav files when sampling)
- `crank docked screen` (which screen appears when the crank is docked. `none` disables changing the screen)
- `recording/` (as in tapping in a pattern)
- (button) `button track` (when record is active, this button will correspond to this track)
- `quantization` (quantize recording, can be either off [1], every 16th note [2], or every 8th note [4])
- `sampling/`
- `sample format` (16 bit or 8 bit)
- `save waveforms` (save waveform images along with audio)
- `save .wav samples` (alongside .pda audio, save .wav files when sampling)
- `ui/`
- `dark mode`
- `visualizer` (song screen visualizer options)
Expand Down
Binary file added assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ release:
just build
-rm CS-16.pdx.zip
zip -rq CS-16.pdx.zip CS-16.pdx

mv visualizers/ src/
pdc -q -sdkpath ~/Documents/PlaydateSDK/ src CS-16
mv src/visualizers .
-rm CS-16_withExtraVisualizers.pdx.zip
zip -rq CS-16_withExtraVisualizers.pdx.zip CS-16.pdx
9 changes: 5 additions & 4 deletions src/fnt/modified-tron-8x8.fnt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--metrics={"baseline":6,"xHeight":2,"capHeight":3,"pairs":{},"left":[],"right":[]}
datalen=1712
data=iVBORw0KGgoAAAANSUhEUgAAAFAAAABICAYAAABhlHJbAAAEyklEQVR4Xu2cbXPcMAiEm///o5u5m9gl3MIuCPvi1P2UVkJCK14eeTr5+HP/WVLg48v6b7DKNo6GHzaqPVrfrt0Zf/i0sr+1f/zsfWD+Pe2tA14sK5AiYMXer139u/cH+VrxfxMw0iNcf0pAJrAdtzetOlwVQ0nL7NLYhe6CdwXcRFBTCEWMT0GfMlIKNUtQ1f+wxE0LmNVMFIVHXoCvcWx/dGHRefYL8AfIooA5gIpylqLRAX10+PpkC35n/VH7yQhAdaezfiTg1PqRgNn6YQlSU85HX8dOKeyXm1MVAnXQ7dBVjppsEoxjJ8YhplUEZK3dgzXrqqzeZusxblM4kWWVtL8qoK1L28IIBbpc1+E8dkAm0Or4c39FwOiZ5UVdKfKocWRdH0Wg35+ViAxbZE5UBLRda0MPXwsZenTGOwJSbgu6VMc/OQKjJmE5ru3A1+JH2LMLYOO+RHhuLQto0wY1FLiBEyhKs4kuqZQQFqHMv5fGp6bw5fjsLIch2wibV5DGF3y0/FkRyCKsMv7U7icJ6BGIYQrjTl+js7MijGLr3wKaABoVEEWmD22Zk5IuG3VBC+rq1yJFANZkWIRCe2S0ImD0PKuA8pECZl24AtZ7XVcFZNjS4bh3ROBbBWQpMMGBj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KXTDRVZBSyJnrrAmtnF/NmWmN7PycpA5QXbWzf9Ql5h+usc+d75xnfySBDNlAr2ZKi8BRfIcx1YU6bwpOEVcKZXBL0AAjYigQm08V/2ONjTFHEogkxcBUCagCRHSIcghMS8qnEKjmvFUFnkKgk2KVArv7WYohWFlAJUcFVvuxDN1sZwFdMNEZY6oa5Hax6ob3gGpss7B+TEAyqy6U1oQAFQwjfRXqzFm8nECGrPBHdEoM1qiBjo0MFoEjRdkYMxRXBUeL7B24huWA2WfPKGS+r2KZwHQSB8+689deYBc0cwGHKfAIAjs1kJ2POKr+lcBBGsEG7ZiWXQVm9hVeTaBM4QuTQAX9RMT66bwpPT3DUpAZcVLoXeHGRp+7CPz/l6kqG0sCnTntU3GKAj8ZpxDoHvKOcGOzamAG95B3xK5deA98MtnTbwIdZK99G9ScNbPuvmYeAtW6u5j5McFVrGvbtbcLHAI7I04V5Iy6IhxinGd2hUOgi1nn3X3qObV+CBwCXQXOBuDuq55zbewO/M9sh1CGlQDcvd+6BrpBHDUnqvOV+qq/ajgUfwF1r/xn/jkm2QAAAABJRU5ErkJggg==
width=8
height=8

Expand All @@ -16,7 +16,7 @@ tracking=1
7 8
8 8
9 8
space 8
space 3
� 8
A 8
B 8
Expand Down Expand Up @@ -86,10 +86,11 @@ z 7
Ć 5
[ 3
] 4
, 8
, 3
= 5
/ 6
' 3
( 3
) 4
% 6

Binary file modified src/img/note_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions src/lists.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
listviewContents = {}

listview = pd.ui.gridview.new(0, 10)
listview.backgroundImage = gfx.image.new(10, 10, gfx.kColorWhite)
listview:setNumberOfRows(16)
listview:setCellPadding(0, 0, 5, 10)
listview:setContentInset(24, 24, 13, 11)
listview:setContentInset(20, 20, 10, 10)

function listview:drawCell(section, row, column, selected, x, y, width, height)
if selected then
Expand All @@ -26,10 +25,9 @@ end
filePickListContents = {}

filePickList = pd.ui.gridview.new(0, 10)
filePickList.backgroundImage = gfx.image.new(10, 10, gfx.kColorWhite)
filePickList:setNumberOfRows(1)
filePickList:setCellPadding(0, 0, 5, 10)
filePickList:setContentInset(24, 24, 13, 11)
filePickList:setContentInset(20, 20, 15, 10)

function filePickList:drawCell(section, row, column, selected, x, y, width, height)
if filePickListContents[row] == ".." then
Expand Down Expand Up @@ -57,10 +55,9 @@ end
settingsListContents = {}

settingsList = pd.ui.gridview.new(0, 10)
settingsList.backgroundImage = gfx.image.new(10, 10, gfx.kColorWhite)
settingsList:setNumberOfRows(1)
settingsList:setCellPadding(0, 0, 5, 10)
settingsList:setContentInset(24, 24, 13, 11)
settingsList:setContentInset(20, 20, 15, 13)

function settingsList:drawCell(section, row, column, selected, x, y, width, height)
if selected then
Expand Down
16 changes: 12 additions & 4 deletions src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function pd.update()

local crank = 0
if crankMode == "tempo" then
crank = pd.getCrankTicks(8)
crank = pd.getCrankTicks(10)
elseif crankMode == "turn knob" then
crank = pd.getCrankTicks(8)
else
Expand Down Expand Up @@ -214,7 +214,15 @@ function pd.update()

screenAnim(b)
elseif crankMode == "tempo" then
seq:setTempo(math.max(16, math.min(512, seq:getTempo() + (crank * 8))))
local tm = getTempoFromSPS(seq:getTempo()) -- this is some goofy math but it works lol

if settings["smallerTempoIncrements"] then
tm = getSPSfromTempo(tm + (crank / 1.25))
else
tm = getSPSfromTempo(tm + (crank * 8))
end

seq:setTempo(math.max(16, math.min(512, tm)))
sinetimer.duration = 400 - (getTempoFromSPS(seq:getTempo()) / 8)
if seq:isPlaying() and settings["stopontempo"] then
seq:stop()
Expand Down Expand Up @@ -337,6 +345,7 @@ function pd.update()
local selRow = listview:getSelectedRow()
if listviewContents[1] ~= "*Ā*" then
if listview.needsDisplay or textTimer.timeLeft ~= 0 then
gfx.clear()
listview:drawInRect(0, 0, 400, 240)

if instrument.allMuted == true then
Expand Down Expand Up @@ -412,10 +421,9 @@ function pd.update()
end
gfx.drawTextInRect(toDraw .. " by " .. songAuthor, 0, 0, 400, 240, nil, nil, align.center)

gfx.drawTextAligned(curMet .. (getTempoFromSPS(seq:getTempo() / 8)), 400, 222, align.right)
gfx.drawTextAligned(curMet .. (math.round(getTempoFromSPS(seq:getTempo() / 8), 2)), 400, 222, align.right)
gfx.drawText(math.floor(stepCount / 8) .. " steps", 0, 222)


if settings["visualizer"]["sine"] then -- sine wave
gfx.setLineWidth(2)
gfx.drawSineWave(0, 120, 405, 120, (stepCount / 2) / 8, (stepCount / 2) / 8,
Expand Down
4 changes: 2 additions & 2 deletions src/pdxinfo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name=CS-16
author=nanobot567
description=cranky synth 16: a 16-track synthesizer/sampler for playdate.
bundleID=com.nano.cs16
version=2.0.3
buildNumber=4625
version=2.0.4
buildNumber=4752
imagePath=SystemAssets/
2 changes: 1 addition & 1 deletion src/save.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function loadSave(name)

log.append("setting tempo to " .. tmp[2][1] .. "...")

seq:setTempo(tmp[2][1] * 8) -- TODO: be sure to implement real world bpm changes once fix is pushed!
seq:setTempo(tmp[2][1] * 8)
sinetimer.duration = 400 - (getTempoFromSPS(seq:getTempo()) / 8)

log.append("setting stepcount...")
Expand Down
3 changes: 2 additions & 1 deletion src/setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ settings = {
["logscreens"] = true,
["fxvfx"] = false,
["crankDockedScreen"] = "pattern",
["foldersPrecedeFiles"] = true
["foldersPrecedeFiles"] = true,
["smallerTempoIncrements"] = false
}
settings = loadSettings()
saveSettings()
Expand Down
3 changes: 2 additions & 1 deletion src/ui/screens/filepicker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function filePicker.update(force)
end

if filePickList.needsDisplay == true or (filePicker.animator ~= nil and filePicker.animator:ended() == false) or force then
gfx.clear()
filePickList:drawInRect(filePicker.animator:currentValue(), 0, 400, 240)
fnt8x8:drawTextAligned("choose a " .. ftype, 200, 0, align.center)
end
Expand All @@ -77,7 +78,7 @@ function filePicker.update(force)
songData[3][1],
"\n\n",
"tempo: ",
songData[2][1] * 8,
math.round(getTempoFromSPS(songData[2][1]), 2),
", ",
songData[2][2],
" steps",
Expand Down
7 changes: 5 additions & 2 deletions src/ui/screens/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function settingsScreen.AButtonDown()
end
elseif settingsScreen.subMenu == "ui/visualizer/" then
if text ~= "----- external -----" then
text = string.split(text, ": ")[1]
text = pd.string.trimTrailingWhitespace(string.split(text, ":")[1])

settings["visualizer"][text] = not settings["visualizer"][text]
end
Expand All @@ -217,8 +217,10 @@ function settingsScreen.AButtonDown()
elseif row == 3 then
settings["stoponsample"] = not settings["stoponsample"]
elseif row == 4 then
settings["stopontempo"] = not settings["stopontempo"]
settings["smallerTempoIncrements"] = not settings["smallerTempoIncrements"]
elseif row == 5 then
settings["stopontempo"] = not settings["stopontempo"]
elseif row == 6 then
settings["crankDockedScreen"] = table.cycle(crankDockList, settings["crankDockedScreen"])
end
elseif settingsScreen.subMenu == "recording/" then
Expand Down Expand Up @@ -324,6 +326,7 @@ function settingsScreen.updateSettings()
"*Ā*",
"play on load: " .. tostring(settings["playonload"]),
"stop if sampling: " .. tostring(settings["stoponsample"]),
"precise tempo chg: " .. tostring(settings["smallerTempoIncrements"]),
"tempo edit stop: " .. tostring(settings["stopontempo"]),
"crank dock screen: " .. tostring(screen)
})
Expand Down
66 changes: 66 additions & 0 deletions visualizers/cpustats.lua
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 }
27 changes: 27 additions & 0 deletions visualizers/ditherednotes.lua
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 }
4 changes: 3 additions & 1 deletion visualizers/ramona/ramona.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ local speechOptions = {
"we getting out of\nthe playdate with\nthis one.",
"let. them. cook!!",
"betcha didn't know\nthere's lore behind\ncs-16...",
"hopefully i don't\nsound like a\nbroken record, haha..."
"hopefully i don't\nsound like a\nbroken record, haha...",
"anyway, hope you've\n been doing\nalright!",
"man, it gets boring\nin here\nsometimes..."
}
local speech = ""
local lastSpeech = "blannnnk"
Expand Down

0 comments on commit af2ac9a

Please sign in to comment.