pycodedj 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {pycodedj-0.1.1 → pycodedj-0.1.3}/CHANGELOG.md +17 -0
  2. pycodedj-0.1.3/LICENSE +48 -0
  3. pycodedj-0.1.3/PKG-INFO +275 -0
  4. {pycodedj-0.1.1 → pycodedj-0.1.3}/README.ja.md +1 -1
  5. {pycodedj-0.1.1 → pycodedj-0.1.3}/README.md +1 -1
  6. pycodedj-0.1.3/docs/CNAME +1 -0
  7. pycodedj-0.1.3/docs/index.html +886 -0
  8. pycodedj-0.1.3/docs/visualizer-concept.html +438 -0
  9. {pycodedj-0.1.1 → pycodedj-0.1.3}/pyproject.toml +3 -1
  10. pycodedj-0.1.1/PKG-INFO +0 -11
  11. {pycodedj-0.1.1 → pycodedj-0.1.3}/.github/workflows/workflow.yml +0 -0
  12. {pycodedj-0.1.1 → pycodedj-0.1.3}/.gitignore +0 -0
  13. {pycodedj-0.1.1 → pycodedj-0.1.3}/docs/manual.ja.md +0 -0
  14. {pycodedj-0.1.1 → pycodedj-0.1.3}/docs/manual.md +0 -0
  15. {pycodedj-0.1.1 → pycodedj-0.1.3}/examples/club_set.py +0 -0
  16. {pycodedj-0.1.1 → pycodedj-0.1.3}/examples/demo.py +0 -0
  17. {pycodedj-0.1.1 → pycodedj-0.1.3}/examples/hello_sc.py +0 -0
  18. {pycodedj-0.1.1 → pycodedj-0.1.3}/sc/synths.scd +0 -0
  19. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/__init__.py +0 -0
  20. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/__main__.py +0 -0
  21. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/analyzer.py +0 -0
  22. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/block_parser.py +0 -0
  23. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/engine.py +0 -0
  24. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/mapper.py +0 -0
  25. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/osc_bridge.py +0 -0
  26. {pycodedj-0.1.1 → pycodedj-0.1.3}/src/pycodedj/watcher.py +0 -0
  27. {pycodedj-0.1.1 → pycodedj-0.1.3}/tests/__init__.py +0 -0
  28. {pycodedj-0.1.1 → pycodedj-0.1.3}/tests/test_analyzer.py +0 -0
  29. {pycodedj-0.1.1 → pycodedj-0.1.3}/tests/test_block_parser.py +0 -0
  30. {pycodedj-0.1.1 → pycodedj-0.1.3}/tests/test_engine.py +0 -0
  31. {pycodedj-0.1.1 → pycodedj-0.1.3}/tests/test_mapper.py +0 -0
  32. {pycodedj-0.1.1 → pycodedj-0.1.3}/tests/test_osc_bridge.py +0 -0
  33. {pycodedj-0.1.1 → pycodedj-0.1.3}/tests/test_watcher.py +0 -0
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.3] - 2026-05-07
4
+
5
+ ### Fixes
6
+
7
+ - Add `readme = "README.md"` to `pyproject.toml` so PyPI shows the project description
8
+
9
+ ## [0.1.2] - 2026-05-07
10
+
11
+ ### Features
12
+
13
+ - License changed to MIT + Commons Clause — personal use, modification, and live performances (including paid shows) are permitted; selling or commercially distributing the software itself is not
14
+
15
+ ### Docs
16
+
17
+ - Add project homepage at `docs/index.html` with live demo animation and accurate engine-computed parameter values
18
+ - Add visualizer concept page at `docs/visualizer-concept.html` showing Canvas 2D animation synced to music parameters
19
+
3
20
  ## [0.1.1] - 2026-05-07
4
21
 
5
22
  ### Docs
pycodedj-0.1.3/LICENSE ADDED
@@ -0,0 +1,48 @@
1
+ MIT License with Commons Clause
2
+
3
+ "Commons Clause" License Condition v1.0
4
+
5
+ The Software is provided to you by the Licensor under the License,
6
+ as defined below, subject to the following condition.
7
+
8
+ Without limiting other conditions in the License, the grant of rights
9
+ under the License will not include, and the License does not grant to
10
+ you, the right to Sell the Software.
11
+
12
+ For purposes of the foregoing, "Sell" means practicing any or all of
13
+ the rights granted to you under the License to provide to third
14
+ parties, for a fee or other consideration (including without limitation
15
+ fees for hosting or consulting/support services related to the
16
+ Software), a product or service whose value derives, entirely or
17
+ substantially, from the functionality of the Software. Any license
18
+ notice or attribution required by the License must also include this
19
+ Commons Clause License Condition notice.
20
+
21
+ Software: PyCodeDJ
22
+ License: MIT
23
+ Licensor: Yuichi Kaneko
24
+
25
+ -------------------------------------------------------------------------------
26
+
27
+ MIT License
28
+
29
+ Copyright (c) 2026 Yuichi Kaneko
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ "Software"), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included
40
+ in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,275 @@
1
+ Metadata-Version: 2.4
2
+ Name: pycodedj
3
+ Version: 0.1.3
4
+ License: MIT License with Commons Clause
5
+
6
+ "Commons Clause" License Condition v1.0
7
+
8
+ The Software is provided to you by the Licensor under the License,
9
+ as defined below, subject to the following condition.
10
+
11
+ Without limiting other conditions in the License, the grant of rights
12
+ under the License will not include, and the License does not grant to
13
+ you, the right to Sell the Software.
14
+
15
+ For purposes of the foregoing, "Sell" means practicing any or all of
16
+ the rights granted to you under the License to provide to third
17
+ parties, for a fee or other consideration (including without limitation
18
+ fees for hosting or consulting/support services related to the
19
+ Software), a product or service whose value derives, entirely or
20
+ substantially, from the functionality of the Software. Any license
21
+ notice or attribution required by the License must also include this
22
+ Commons Clause License Condition notice.
23
+
24
+ Software: PyCodeDJ
25
+ License: MIT
26
+ Licensor: Yuichi Kaneko
27
+
28
+ -------------------------------------------------------------------------------
29
+
30
+ MIT License
31
+
32
+ Copyright (c) 2026 Yuichi Kaneko
33
+
34
+ Permission is hereby granted, free of charge, to any person obtaining
35
+ a copy of this software and associated documentation files (the
36
+ "Software"), to deal in the Software without restriction, including
37
+ without limitation the rights to use, copy, modify, merge, publish,
38
+ distribute, sublicense, and/or sell copies of the Software, and to
39
+ permit persons to whom the Software is furnished to do so, subject to
40
+ the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be included
43
+ in all copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
46
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
47
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
48
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
49
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
50
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
51
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52
+ License-File: LICENSE
53
+ Requires-Python: >=3.10
54
+ Requires-Dist: python-osc>=1.8
55
+ Provides-Extra: dev
56
+ Requires-Dist: mypy; extra == 'dev'
57
+ Requires-Dist: pytest; extra == 'dev'
58
+ Requires-Dist: ruff; extra == 'dev'
59
+ Provides-Extra: watch
60
+ Requires-Dist: watchdog>=3.0; extra == 'watch'
61
+ Description-Content-Type: text/markdown
62
+
63
+ # PyCodeDJ
64
+
65
+ [日本語版 README はこちら](https://github.com/kanekoyuichi/pycodedj/blob/main/README.ja.md)
66
+
67
+ A live-coding environment that translates Python code structure into music in real time. Every save changes the performance.
68
+
69
+ ---
70
+
71
+ ## Concept
72
+
73
+ PyCodeDJ connects "writing code" directly to "making sound."
74
+
75
+ Add more functions and the polyphony widens. Deepen nesting and the filter opens up. Fill in comments and the space grows. The structure of your code is the instrument.
76
+
77
+ Two things set it apart from existing Python ↔ SuperCollider bridges (sc3nb, supriya):
78
+
79
+ - **Hot-reload performance** — swap out a loop without stopping it. Saving a file becomes an immediate sound change.
80
+ - **Audible code structure** — structural features extracted via AST analysis (depth, branch count, function count, etc.) are automatically mapped to musical parameters.
81
+
82
+ ---
83
+
84
+ ## Architecture
85
+
86
+ ```
87
+ [Python engine] →OSC→ [SuperCollider] →audio out→ speakers
88
+ ↓ OSC
89
+ [Hydra etc.] →video out→ screen
90
+ ```
91
+
92
+ | Layer | Role | Technology |
93
+ | :--- | :--- | :--- |
94
+ | Control | Code analysis, scheduling, OSC dispatch | Python 3.10+, python-osc, watchdog |
95
+ | Audio | Real-time sound synthesis | SuperCollider (scsynth) |
96
+ | Visual | Music-synced visuals | Hydra or Pyxel |
97
+
98
+ BPM clock is held by SuperCollider's `TempoClock`. Python only sends parameter updates over OSC; timing accuracy is delegated to SuperCollider.
99
+
100
+ ---
101
+
102
+ ## Code Structure → Music Parameter Mapping
103
+
104
+ | Code feature | Music parameter | Musical rationale |
105
+ | :--- | :--- | :--- |
106
+ | Max nesting depth | Filter Cutoff (200–4000 Hz) | Deep structure = complexity = brightness |
107
+ | Control-flow count (if/for/while) | LFO rate (0.1–5.0 Hz) | More branches = faster modulation |
108
+ | Function definition count | Polyphony voice count (1–4) | Functions = independent voices |
109
+ | Comment ratio | Reverb depth (0.0–0.8) | More whitespace = more space |
110
+
111
+ Tempo (BPM) and root pitch are controlled explicitly by the performer, to prevent the foundation of the piece from shifting on every save.
112
+
113
+ ---
114
+
115
+ ## Installation
116
+
117
+ **Requirements**
118
+
119
+ - Python 3.10 or later
120
+ - SuperCollider (with scsynth available)
121
+
122
+ ```bash
123
+ pip install 'pycodedj[watch]'
124
+ ```
125
+
126
+ The `[watch]` extra enables the `pycodedj watch` command.
127
+
128
+ Development install:
129
+
130
+ ```bash
131
+ git clone https://github.com/yourname/pycodedj
132
+ cd pycodedj
133
+ pip install -e ".[dev]"
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Quick Start
139
+
140
+ **1. Boot SuperCollider and load the synths**
141
+
142
+ Open `sc/synths.scd` in the SuperCollider IDE and evaluate it.
143
+
144
+ **2. Write a live-coding file**
145
+
146
+ ```python
147
+ # @loop bass interval=2.0
148
+ def bass():
149
+ for i in range(8):
150
+ if i % 2 == 0:
151
+ pass
152
+
153
+ # @loop melody interval=0.5
154
+ def melody():
155
+ x = 1
156
+ y = 2
157
+ return x + y
158
+
159
+ # @loop pad interval=4.0
160
+ def pad():
161
+ # make space
162
+ # a little more
163
+ pass
164
+ ```
165
+
166
+ **3. Evaluate a block**
167
+
168
+ ```bash
169
+ pycodedj eval demo.py::bass
170
+ ```
171
+
172
+ On success, feedback is printed immediately:
173
+
174
+ ```
175
+ [pycodedj] bass cutoff=418Hz lfo=1.08Hz reverb=0.00 voices=1
176
+ ```
177
+
178
+ Other loops keep playing without interruption.
179
+
180
+ **4. Live-code with watch mode**
181
+
182
+ Instead of running eval manually, use watch to re-evaluate all loops on every save:
183
+
184
+ ```bash
185
+ pycodedj watch demo.py
186
+ ```
187
+
188
+ From here, just write code and save.
189
+
190
+ > **Note on `interval` (current MVP):** Values like `interval=2.0` are parsed and stored, but are not yet sent over OSC. Loop repeat timing is managed by SuperCollider's `TempoClock`. A mechanism to pass interval to SC is planned for a future release.
191
+
192
+ ---
193
+
194
+ ## Example Files
195
+
196
+ | File | Contents |
197
+ | :--- | :--- |
198
+ | `examples/demo.py` | Intro demo with bass / melody / pad |
199
+ | `examples/club_set.py` | Club-style demo: sub_bass / hat_engine / neon_stab / acid_lead / warehouse_air |
200
+
201
+ ---
202
+
203
+ ## Live-Coding Examples
204
+
205
+ ### Deeper nesting opens the filter
206
+
207
+ ```python
208
+ # @loop bass interval=2.0
209
+ def bass():
210
+ for i in range(4): # control flow +1
211
+ for j in range(4): # depth +1, control flow +1
212
+ if i == j: # depth +1, control flow +1
213
+ pass
214
+ ```
215
+
216
+ ### More functions = more polyphony
217
+
218
+ ```python
219
+ # @loop chord interval=1.0
220
+ def voice_a(): pass
221
+ def voice_b(): pass
222
+ def voice_c(): pass
223
+ def voice_d(): pass
224
+ ```
225
+
226
+ ### More comments = more space (reverb)
227
+
228
+ ```python
229
+ # @loop pad interval=4.0
230
+ # leave space here
231
+ # a little more
232
+ # silence is music
233
+ def pad(): pass
234
+ ```
235
+
236
+ ---
237
+
238
+ ## OSC Address Reference
239
+
240
+ Addresses used to communicate with SuperCollider.
241
+
242
+ | Address | Type | Range | Parameter |
243
+ | :--- | :--- | :--- | :--- |
244
+ | `/pycodedj/loop/<name>/cutoff` | float | 200–4000 Hz | Filter Cutoff |
245
+ | `/pycodedj/loop/<name>/lfo_rate` | float | 0.1–5.0 Hz | LFO rate |
246
+ | `/pycodedj/loop/<name>/reverb` | float | 0.0–0.8 | Reverb depth |
247
+ | `/pycodedj/loop/<name>/voice_count` | int | 1–4 | Polyphony voice count |
248
+
249
+ `<name>` is the loop name (e.g. `bass`, `melody`). Each loop has its own address namespace, so multiple loops never overwrite each other's parameters.
250
+
251
+ External visualisers such as Hydra can receive the same parameters on a separate port.
252
+
253
+ ---
254
+
255
+ ## Requirements
256
+
257
+ - **Recommended OS:** macOS (low-latency Core Audio) or Linux (Raspberry Pi 5, etc.)
258
+ - **Python:** 3.10 or later
259
+ - **SuperCollider:** 3.12 or later
260
+
261
+ ---
262
+
263
+ ## Roadmap
264
+
265
+ - [x] Spec design and mapping design
266
+ - [ ] Phase 0: Listening validation of mapping hypotheses
267
+ - [x] Phase 1: Python → SuperCollider OSC prototype
268
+ - [x] Phase 2: Hot-reload live loop implementation (`pycodedj watch`)
269
+ - [ ] Phase 3: Hydra visualiser integration
270
+
271
+ ---
272
+
273
+ ## License
274
+
275
+ MIT + Commons Clause — free to use, modify, and perform (including paid live performances). Selling or commercially distributing the software itself is not permitted. See [LICENSE](LICENSE) for details.
@@ -210,4 +210,4 @@ Hydra 等の外部ビジュアライザーへは同じパラメーターを別
210
210
 
211
211
  ## ライセンス
212
212
 
213
- MIT
213
+ MIT + Commons Clause — 個人利用・改変・ライブパフォーマンス(有料公演含む)は自由です。ソフトウェアそのものの販売・有償サービス化は禁止しています。詳細は [LICENSE](LICENSE) を参照してください。
@@ -210,4 +210,4 @@ External visualisers such as Hydra can receive the same parameters on a separate
210
210
 
211
211
  ## License
212
212
 
213
- MIT
213
+ MIT + Commons Clause — free to use, modify, and perform (including paid live performances). Selling or commercially distributing the software itself is not permitted. See [LICENSE](LICENSE) for details.
@@ -0,0 +1 @@
1
+ pycodedj.com