Skip to content

Commit dff442d

Browse files
committed
version 2.0 🔥
1 parent f484a58 commit dff442d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3702
-1894
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
CS-16.pdx/*
33
CS-16.pdx
44
TODO.md
5+
stub.lua
6+
CHANGELOG.md
7+
CS-16.pdx.zip

DEV.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# develop
2+
3+
## building
4+
5+
Building CS-16 is exactly like how you'd build any other Playdate game (in this case, the command is `pdc src/ CS-16.pdx`).
6+
7+
However, I personally use [`just`](https://github.com/casey/just) to make things a little faster! If you install `just` or already have it installed, the default `just` recipe will build CS-16 and open it in the Playdate Simulator, presuming `PlaydateSimulator` is in `$PATH`.
8+
9+
> note: the `just` recipes are only compatible with Linux or MacOS. the `justfile` may need to be modified if you are on Windows.
10+
11+
> also, if you end up taking a look at the code, sorry in advance if it's a mess XD
12+
13+
## visualizers
14+
15+
### format
16+
A CS-16 visualizer at its core is just a function that gets called every playdate.update() loop, so you can do pretty much whatever you want with it!
17+
18+
In order for it to be recognized by CS-16, your visualizer code must be either a standalone `.lua` file, or be in a folder by the same name as one of the `.lua` files.
19+
20+
CS-16 requires that a visualizer returns a table with the name of the visualizer, as well as the function that will be called every update. When it is called, CS-16 will pass in a key-value table containing many values which you may find useful when creating a visualizer.
21+
22+
Here's the code for one of my visualizers, called "bumper", as an example:
23+
24+
```lua
25+
local function bumperUpdate(data)
26+
if data.beat then
27+
pd.display.setOffset(0, 3)
28+
elseif math.floor(data.step) % 8 == 2 then
29+
pd.display.setOffset(0, 1)
30+
else
31+
pd.display.setOffset(0, 0)
32+
end
33+
end
34+
35+
return {"bumper", bumperUpdate}
36+
```
37+
38+
### building and importing
39+
Currently, there is no way to directly load Lua code from the Playdate's Data/ directory (most likely for security reasons), so you'll have to rebuild CS-16 with your custom visualizers in the source code.
40+
41+
To do this, clone this repository with `git clone https://github.com/nanobot567/CS-16`. Then, navigate to the `src/` directory, and create a new folder named `visualizers` if it doesn't already exist. Here, simply paste your .lua files (or the folder containing your .lua file) and rebuild CS-16 with `pdc src/ CS-16.pdx` (or if you have [`just`](https://github.com/casey/just) installed, `just`).
42+
43+
### visualizer key-value table data
44+
45+
| key | type | note |
46+
| -------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
47+
| tempo | number | pattern tempo |
48+
| step | number | pattern step |
49+
| rawStep | number | pattern step, not rounded |
50+
| length | number | pattern length |
51+
| playing | boolean | true if pattern is currently playing |
52+
| beat | boolean | true if current step is a beat |
53+
| tracks | object table | table of `playdate.sound.track`s in the pattern |
54+
| trackNames | string table | table of the names of the tracks |
55+
| userTrackNames | string table | table of user-defined track names. if a name has not been set, the value at that track's index will be an empty string ("") |
56+
| trackSwings | number table | table of swing values for each track |
57+
| mutedTracks | boolean table | mutedTracks[trackNumber] returns true if the track is currently muted |
58+
| instruments | object table | table of `playdate.sound.instrument`s |
59+
| instrumentADSRs | number table table | nested tables contain the attack, decay, sustain and release values in that order for each track |
60+
| instrumentLegatos | boolean table | legato status for each track |
61+
| instrumentParams | number table table | tables within contain parameter 1 and 2 values for square wave tracks and TE synth tracks (phase, digital, vosim) |
62+
| instrumentTransposes | number table | contains the transposition value of each track |
63+
| settings | key-value table | contains the user's settings. refer to your own `settings.json` file if you don't know what the key to a setting may be! |
64+
| sequencer | object | CS-16's `playdate.sound.sequencer`* |

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Nanobot567
3+
Copyright (c) 2024 Nanobot567
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANUAL.md

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# CS-16 manual
22

3-
In CS-16, there are three main screens, each of which will be explored in this manual:
3+
In CS-16, there are four main screens, each of which will be explored in this manual:
44
1. `pattern`
55
2. `track`
6-
3. `song`
6+
3. `fx`
7+
4. `song`
78

89
You can swap between these screens by pressing `B` until the text shown says `screen`, and then cranking. This "crank mode" menu will be accessed often as you use CS-16.
910

@@ -33,7 +34,7 @@ To make placing down and editing notes at intervals easier, there is an option i
3334

3435
![](assets/autonote.gif)
3536

36-
To edit the pitch of the note, cycle through the crank mode menu until you reach `pitch`, then crank like you did for `note status`. Changing the track, velocity, and note length are done this same way.
37+
To edit the pitch of the note, cycle through the crank mode menu until you reach `pitch`, then crank like you did for `note status`. Changing the track, velocity, note length, and swing are done this same way.
3738

3839
You can start or stop the sequence by pressing A.
3940

@@ -43,6 +44,8 @@ If you would like to input notes in real time, there is a `record` function in C
4344

4445
While in record mode, the `A`, `B`, `up`, `down`, `left`, and `right` buttons are mapped to tracks in the song. When pressed, a note is placed at that step in the corresponding track. If quantization is enabled (not 1), then each note you place will be quantized to the nearest multiple of the quantization value.
4546

47+
> swing is applied when you press `stop record`.
48+
4649
![](assets/liverecord.gif)
4750

4851
### track
@@ -58,6 +61,16 @@ In the system menu, there are two options, `copy` and `cpy mode`. To copy a trac
5861

5962
![](assets/copypaste.gif)
6063

64+
#### renaming tracks
65+
66+
To rename one of your tracks, hover over the track you would like to rename, enter the system menu and select `rename`.
67+
68+
To remove your custom track name, enter the `rename` keyboard, delete all of the characters, and press `OK`.
69+
70+
> note: there is a 10-character limit.
71+
72+
![](assets/rename.gif)
73+
6174
#### instrument editor
6275

6376
To edit an instrument, select the track you want in the list. It will be marked with the number and the instrument type. Instrument types can be any of the following:
@@ -99,21 +112,76 @@ Within the file picker, you can enter folders or select a file using `A`, and ex
99112

100113
If you have already selected a sample, however, there will be an extra option in the list: `edit sample`. In the `edit sample` screen, you can trim your samples. Pressing `left` or `right` changes the selected side, and pressing `up` or `down` changes the interval at which you trim the sample using the crank.
101114

102-
If you are editing a sample that was recorded with the Playdate's microphone, you will see a waveform above the start and end frame locations.
115+
If you are editing a sample that was recorded with the Playdate's microphone and you have enabled `settings / sampling / save waveforms`, you will see a waveform above the start and end frame locations.
103116

104117
![](assets/sampleedit.png)
105118

106119
> note: double and triple check your sample before you save it! when you trim it you cannot revert to the original sound.
107120
121+
### fx
122+
123+
![](assets/fx.png)
124+
125+
In the `fx` screen, you can apply punch-in effects to your pattern. Currently there are four effects (ordered clockwise, starting from the top):
126+
127+
1. `TAPE`: high-pass and low-pass filters
128+
2. `BTC`: bitcrush
129+
3. `WTR`: low-pass filter
130+
4. `OVD`: overdrive
131+
132+
While in this screen, press A to activate or deactivate punch-in. The word `ACTV!` will appear at the center of the screen when it's activated. Once activated, the d-pad buttons enable the corresponding effect when pressed, and disable when not.
133+
134+
It is possible to "lock" your button presses! Enable the effects you would like to lock, then switch the crank mode to `lock effect`. Crank clockwise until you see a "lock" icon appear in the bottom left of your screen. To unlock effects, either crank counter-clockwise to unlock all of them, or press the corresponding d-pad button when punch-in is active.
135+
136+
If you would like to change an effect intensity (signified by the decimal number next to the effect), first ensure that punch-in is deactivated. Then, change the crank mode to `effect intensity` and press the d-pad button according to the effect you would like to modify. You'll know you're good to go when there's a box around the effect text. Now just crank until you reach your desired value! Intensities range from 0 (off) to 1 (full effect).
137+
138+
> note: this can be done while an effect is applied, allowing for some pretty fun live performance stuff!
139+
108140
### song
109141

110-
![](assets/song.png)
142+
![](assets/songscreen.gif)
111143

112144
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.
113145

114146
> 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.
115147
116-
Here you can also save and load your songs via the Playdate OS menu. In the menu, you can access and change CS-16 settings, such as dark mode, crank sensitivity, and the name used to sign your saved songs.
148+
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.
149+
150+
![](assets/fileops.gif)
151+
152+
In the system menu, you can also access and change CS-16 settings, such as dark mode, crank sensitivity, and the name used to sign your saved songs. A full list of settings is below.
153+
154+
- `general/`
155+
- `author` (text value, default anonymous)
156+
- `output` (audio output. can be auto, speaker, headset, or speaker and headset)
157+
- `crank speed`
158+
- `credits`
159+
- `behavior/`
160+
- `play on load` (play pattern immediately on song load)
161+
- `stop if sampling` (stop the pattern if you are currently sampling audio)
162+
- `tempo edit stop` (stop the pattern when tempo is modified)
163+
- `save .wav samples` (alongside .pda audio, save .wav files when sampling)
164+
- `crank docked screen` (which screen appears when the crank is docked. `none` disables changing the screen)
165+
- `recording/` (as in tapping in a pattern)
166+
- (button) `button track` (when record is active, this button will correspond to this track)
167+
- `quantization` (quantize recording, can be either off [1], every 16th note [2], or every 8th note [4])
168+
- `sampling/`
169+
- `sample format` (16 bit or 8 bit)
170+
- `save waveforms` (save waveform images along with audio)
171+
- `ui/`
172+
- `dark mode`
173+
- `visualizer` (song screen visualizer options)
174+
- `sine wave` (sine wave where tempo is proportional to frequency and pattern length is proportional to amplitude)
175+
- `notes` (displays track active statuses)
176+
- `stars` (purely decorational, but looks pretty awesome lol)
177+
- `--- external ---` (below this are custom visualizers)
178+
- `show number / total` (display current crank mode number out of total)
179+
- `show note names` (display note names in pattern [C#4, F3, etc.])
180+
- `animate scrn move` (animate screen transitions)
181+
- `use system font` (use an alternate font)
182+
- `show log screens` (display log screens, causes some moderate slowdown at the cost of coolness)
183+
- `fx screen vfx` (when an effect is active, apply the corresponding screen visual effect as well)
184+
- `50fps` (50fps refresh rate)
117185

118186
## other information
119187

@@ -141,13 +209,22 @@ To manage your songs:
141209
2. navigate to `Data/user.*****.com.nano.cs16/songs/`
142210
3. add, copy, delete, or rename your songs, then eject your playdate when you are done.
143211

212+
> if you are sharing your songs on the internet, you can set your author name in `settings / general`!!
213+
144214
### ways to improve performance
145215

146216
All of these are things you can do to improve CS-16's performance and reduce frame drops.
147217

148-
- In `settings/ui/`...
149-
- Disable `visualizer`.
218+
- In `settings / ui /`...
219+
- Disable all `visualizer` elements.
150220
- Disable `show note names`.
151221
- Disable `animate scrn move`.
222+
- Disable `fx screen vfx`.
152223
- Enable `50fps`.
153224
- Use lower quality samples (ex. lower bitrate)
225+
226+
### custom visualizers
227+
228+
I have a few custom visualizers in this repository under `visualizers` (and maybe you'll find another one on the internet somewhere??? idk haha). To import these into CS-16, check out the visualizer `building / importing` section in the [DEV document](DEV.md).
229+
230+
> note: by default, imported visualizers are disabled. head to `settings / ui / visualizers` to enable them.

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# cs-16 (cranky synth 16)
22
a synthesizer for playdate
33

4-
<img src ="https://img.shields.io/tokei/lines/github/nanobot567/cs-16"><img src="https://img.shields.io/github/downloads/nanobot567/cs-16/total"><img src="https://img.shields.io/github/v/release/nanobot567/cs-16">
4+
<img src="https://img.shields.io/github/downloads/nanobot567/cs-16/total"><img src="https://img.shields.io/github/v/release/nanobot567/cs-16">
55

66
<div style="align: center;"><a href="https://github.com/nanobot567/cs-16/releases/latest"><img src="https://github.com/Nanobot567/tAoHtH/blob/main/readme-graphics/Playdate-badge-download.png"></a></img></div>
77

8-
## [manual](https://github.com/nanobot567/cs-16/blob/main/MANUAL.md) | [license](https://github.com/nanobot567/cs-16/blob/main/LICENSE)
8+
## [manual](https://github.com/nanobot567/cs-16/blob/main/MANUAL.md) | [develop](https://github.com/nanobot567/cs-16/blob/main/DEV.md) | [license](https://github.com/nanobot567/cs-16/blob/main/LICENSE)
99

1010
## features
1111
- 16 tracks
@@ -29,7 +29,11 @@ a synthesizer for playdate
2929

3030
*track edit view*
3131

32-
![song view](assets/song.png "song view")
32+
![fx view](assets/fx.png "fx view")
33+
34+
*fx view*
35+
36+
![song view](assets/songscreen.gif "song view")
3337

3438
*song view*
3539

assets/cycle.gif

516 KB
Loading

assets/fileops.gif

3.76 MB
Loading

assets/fx.png

1.92 KB
Loading

assets/mockup.gif

1.95 KB
Loading

assets/pattern.png

869 Bytes
Loading

assets/patternscreen.gif

1.04 MB
Loading

assets/rename.gif

2.45 MB
Loading

assets/song.png

110 Bytes
Loading

assets/songscreen.gif

712 KB
Loading

assets/track-2.png

31 Bytes
Loading

assets/track.png

-30 Bytes
Loading

example-songs/kinomu-alt/1.pda

85.9 KB
Binary file not shown.

example-songs/kinomu-alt/2.pda

63.8 KB
Binary file not shown.

example-songs/kinomu-alt/3.pda

61.9 KB
Binary file not shown.

example-songs/kinomu-alt/4.pda

207 KB
Binary file not shown.

example-songs/kinomu-alt/7.pda

161 KB
Binary file not shown.

example-songs/kinomu-alt/8.pda

171 KB
Binary file not shown.

example-songs/kinomu-alt/song.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[[["smp","smp","smp","smp","tri","squ","smp","smp","sin","squ","saw","tri","nse","poP","poD","poV"],[[{"velocity":1,"length":8,"note":60,"step":8},{"velocity":1,"length":8,"note":60,"step":104},{"velocity":1,"length":8,"note":60,"step":264},{"velocity":1,"length":8,"note":60,"step":360},{"velocity":1,"length":8,"note":60,"step":488},{"velocity":1,"length":8,"note":60,"step":504}],[{"velocity":1,"length":8,"note":60,"step":72},{"velocity":1,"length":8,"note":60,"step":168},{"velocity":1,"length":8,"note":60,"step":328},{"velocity":1,"length":8,"note":60,"step":424}],[{"velocity":1,"length":8,"note":60,"step":40},{"velocity":1,"length":8,"note":60,"step":104},{"velocity":1,"length":8,"note":60,"step":168},{"velocity":1,"length":8,"note":60,"step":296},{"velocity":1,"length":8,"note":60,"step":360},{"velocity":1,"length":8,"note":60,"step":424},{"velocity":1,"length":8,"note":60,"step":440},{"velocity":1,"length":8,"note":60,"step":456}],[{"velocity":1,"length":8,"note":67,"step":40},{"velocity":1,"length":8,"note":62,"step":104},{"velocity":1,"length":8,"note":62,"step":168},{"velocity":1,"length":8,"note":55,"step":232},{"velocity":1,"length":8,"note":67,"step":360},{"velocity":1,"length":8,"note":62,"step":456},{"velocity":1,"length":8,"note":67,"step":488}],[{"velocity":1,"length":256,"note":36,"step":8},{"velocity":1,"length":256,"note":31,"step":264},{"velocity":1,"length":128,"note":43,"step":360},{"velocity":1,"length":8,"note":48,"step":488}],[{"velocity":1,"length":8,"note":60,"step":200},{"velocity":1,"length":8,"note":55,"step":232},{"velocity":1,"length":8,"note":60,"step":264},{"velocity":1,"length":8,"note":67,"step":328},{"velocity":1,"length":8,"note":55,"step":360},{"velocity":1,"length":8,"note":63,"step":392},{"velocity":1,"length":8,"note":62,"step":456}],[{"velocity":1,"length":8,"note":60,"step":8},{"velocity":1,"length":8,"note":60,"step":56},{"velocity":1,"length":8,"note":60,"step":104},{"velocity":1,"length":8,"note":60,"step":136},{"velocity":1,"length":8,"note":60,"step":200},{"velocity":1,"length":8,"note":60,"step":264},{"velocity":1,"length":8,"note":60,"step":312},{"velocity":1,"length":8,"note":60,"step":360},{"velocity":1,"length":8,"note":60,"step":392},{"velocity":1,"length":8,"note":60,"step":456}],[{"velocity":1,"length":8,"note":60,"step":424},{"velocity":1,"length":8,"note":60,"step":440},{"velocity":1,"length":8,"note":60,"step":456}],[],[],[],[],[],[],[],[]],[[0,0,0.80000001192093,0.30000001192093],[0,0,0.80000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,2,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.10000000149012,0.40000000596046],[0,0,0.40000000596046,0.40000000596046],[0,0,0.60000002384186,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046],[0,0,0.30000001192093,0.40000000596046]],[false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false],[[0,0],[0.5,0],[0,0],[0,0],[0,0],[0.40000000596046,0],[0,0],[0,0],[0,0],[0.5,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],[0,0,0,-3,-3,-3,0,0,0,0,0,0,0,0,0,0],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[0,0,-4,0,0,0,0,0,0,0,0,0,0,0,0,0],["kick","snare","hihat","chord","bass","melody","perc","pewpew","","","","","","","",""]],[12,64],["nanobot567",{"millisecond":530,"weekday":3,"second":5,"minute":59,"hour":22,"year":2024,"day":19,"month":6}]]

example-songs/kinomu/1.pda

85.9 KB
Binary file not shown.

example-songs/kinomu/2.pda

63.8 KB
Binary file not shown.

example-songs/kinomu/3.pda

61.9 KB
Binary file not shown.

example-songs/kinomu/4.pda

207 KB
Binary file not shown.

example-songs/kinomu/7.pda

161 KB
Binary file not shown.

example-songs/kinomu/8.pda

171 KB
Binary file not shown.

0 commit comments

Comments
 (0)