omnipython-applibs 0.1.2.dev16__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.
- omnipython_applibs-0.1.2.dev16/LICENSE +21 -0
- omnipython_applibs-0.1.2.dev16/PKG-INFO +90 -0
- omnipython_applibs-0.1.2.dev16/README.md +74 -0
- omnipython_applibs-0.1.2.dev16/VERSION +1 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/__init__.py +52 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/__init__.pyi +17 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/data.py +149 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/data.pyi +25 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/foreground.py +357 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/foreground.pyi +45 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/home.py +19 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/home.pyi +8 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/hover.py +59 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/hover.pyi +13 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/index.py +199 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/index.pyi +30 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/launcher.py +1075 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/launcher.pyi +96 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/manifest.py +75 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/manifest.pyi +8 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/net.py +167 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/net.pyi +34 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/places.py +202 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/places.pyi +39 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/scope.py +636 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/scope.pyi +110 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/shell.py +121 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/shell.pyi +32 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/worker.py +409 -0
- omnipython_applibs-0.1.2.dev16/lib/appkit/worker.pyi +83 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/__init__.py +19 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/__init__.pyi +10 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/_draw.py +88 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/_safe.py +29 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/dotmatrix.py +101 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/dotmatrix.pyi +23 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/encoder.py +297 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/encoder.pyi +55 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/font5x7.py +22 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/font5x7.pyi +11 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/lamp_button.py +92 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/lamp_button.pyi +40 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/meter.py +86 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/meter.pyi +30 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/mock.py +116 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/mock.pyi +35 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/pad_grid.py +113 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/pad_grid.pyi +41 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/slider.py +185 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/slider.pyi +49 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/sprites.py +279 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/sprites.pyi +22 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/theme.py +120 -0
- omnipython_applibs-0.1.2.dev16/lib/controlkit/theme.pyi +15 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/__init__.py +74 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/__init__.pyi +18 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/forecast.py +261 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/forecast.pyi +40 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/localtime.py +215 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/localtime.pyi +33 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/shell.py +113 -0
- omnipython_applibs-0.1.2.dev16/lib/deskkit/shell.pyi +33 -0
- omnipython_applibs-0.1.2.dev16/lib/omnipython_applibs.egg-info/PKG-INFO +90 -0
- omnipython_applibs-0.1.2.dev16/lib/omnipython_applibs.egg-info/SOURCES.txt +168 -0
- omnipython_applibs-0.1.2.dev16/lib/omnipython_applibs.egg-info/dependency_links.txt +1 -0
- omnipython_applibs-0.1.2.dev16/lib/omnipython_applibs.egg-info/top_level.txt +9 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/__init__.py +27 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/__init__.pyi +8 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/board.py +56 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/board.pyi +20 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/press.py +63 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/press.pyi +17 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/rows.py +149 -0
- omnipython_applibs-0.1.2.dev16/lib/programkit/rows.pyi +34 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/__init__.py +109 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/__init__.pyi +124 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/auth.py +811 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/auth.pyi +102 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/client.py +1286 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/client.pyi +138 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/keepalive.py +371 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/keepalive.pyi +53 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/local.py +85 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/local.pyi +28 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/object_specs.py +706 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/object_specs.pyi +8 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/objects.py +411 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/objects.pyi +854 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/schema_coverage.py +210 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/schema_coverage.pyi +13 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/transport.py +426 -0
- omnipython_applibs-0.1.2.dev16/lib/sayso/transport.pyi +47 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/__init__.py +30 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/__init__.pyi +9 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/link.py +189 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/link.pyi +53 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/model.py +238 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/model.pyi +40 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/page.html +225 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/page_data.py +236 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/page_data.pyi +6 -0
- omnipython_applibs-0.1.2.dev16/lib/songmodel/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/__init__.py +7 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/__init__.pyi +6 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/engine.py +1001 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/engine.pyi +196 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/names.py +298 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/names.pyi +30 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/pipes.py +105 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/pipes.pyi +31 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/run.py +249 -0
- omnipython_applibs-0.1.2.dev16/lib/soundmodule/run.pyi +49 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/__init__.py +72 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/__init__.pyi +30 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/analyzer.py +231 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/analyzer.pyi +67 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/fake_music.py +201 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/fake_music.pyi +36 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/pump_levels.py +126 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/pump_levels.pyi +46 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/spectrum_view.py +403 -0
- omnipython_applibs-0.1.2.dev16/lib/spectrum/spectrum_view.pyi +80 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/__init__.py +4 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/__init__.pyi +4 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/cam.py +146 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/cam.pyi +35 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/clock.py +18 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/clock.pyi +6 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/ecp.py +134 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/ecp.pyi +28 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/net.py +347 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/net.pyi +27 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/py.typed +0 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/settings.py +85 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/settings.pyi +17 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/shell.py +268 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/shell.pyi +42 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/ui.py +167 -0
- omnipython_applibs-0.1.2.dev16/lib/touchkit/ui.pyi +53 -0
- omnipython_applibs-0.1.2.dev16/pyproject.toml +32 -0
- omnipython_applibs-0.1.2.dev16/setup.cfg +4 -0
- omnipython_applibs-0.1.2.dev16/tests/test_board_name.py +132 -0
- omnipython_applibs-0.1.2.dev16/tests/test_camera.py +220 -0
- omnipython_applibs-0.1.2.dev16/tests/test_controls.py +102 -0
- omnipython_applibs-0.1.2.dev16/tests/test_deskkit.py +412 -0
- omnipython_applibs-0.1.2.dev16/tests/test_engine.py +134 -0
- omnipython_applibs-0.1.2.dev16/tests/test_folders.py +44 -0
- omnipython_applibs-0.1.2.dev16/tests/test_gamepad.py +264 -0
- omnipython_applibs-0.1.2.dev16/tests/test_hover.py +108 -0
- omnipython_applibs-0.1.2.dev16/tests/test_hover_browser.py +172 -0
- omnipython_applibs-0.1.2.dev16/tests/test_huey.py +301 -0
- omnipython_applibs-0.1.2.dev16/tests/test_midicontroller.py +525 -0
- omnipython_applibs-0.1.2.dev16/tests/test_panel_contract.py +204 -0
- omnipython_applibs-0.1.2.dev16/tests/test_perch.py +102 -0
- omnipython_applibs-0.1.2.dev16/tests/test_relative_imports.py +75 -0
- omnipython_applibs-0.1.2.dev16/tests/test_repl_app.py +149 -0
- omnipython_applibs-0.1.2.dev16/tests/test_songmodel_page.py +114 -0
- omnipython_applibs-0.1.2.dev16/tests/test_soundmodule_names.py +194 -0
- omnipython_applibs-0.1.2.dev16/tests/test_stompbox.py +80 -0
- omnipython_applibs-0.1.2.dev16/tests/test_synthstation_govern.py +146 -0
- omnipython_applibs-0.1.2.dev16/tests/test_synthstation_midi.py +60 -0
- omnipython_applibs-0.1.2.dev16/tests/test_touchkit_shell.py +506 -0
- omnipython_applibs-0.1.2.dev16/tests/test_vamp.py +266 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Brad Barnett
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: omnipython-applibs
|
|
3
|
+
Version: 0.1.2.dev16
|
|
4
|
+
Summary: The libraries apps share: appkit, controlkit, deskkit, programkit, sayso, songmodel, soundmodule, spectrum and touchkit
|
|
5
|
+
Author: Brad Barnett
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: lvgl,controls,apps,micropython
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: Implementation :: MicroPython
|
|
12
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
# Apps
|
|
20
|
+
|
|
21
|
+
The apps for PyDevices: things you run on a board or a desktop. A Home app lives in `apps/`; a program, which runs on its own, lives in [`programs/`](programs/README.md).
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
On a Wi-Fi board, one line installs an app with what it needs, and another
|
|
26
|
+
starts Home at boot ([install an app](docs/guides/install-an-app.md)):
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
import omip
|
|
30
|
+
omip.install("github:PyDevices/apps/apps/home")
|
|
31
|
+
omip.install("github:PyDevices/apps/apps/home/main.py", target="/")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
On a computer, the apps are used from a clone, beside the libraries they build on:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/PyDevices/apps
|
|
38
|
+
git clone https://github.com/PyDevices/audioinstruments
|
|
39
|
+
git clone https://github.com/PyDevices/audioeffects
|
|
40
|
+
git clone https://github.com/PyDevices/audiodsp
|
|
41
|
+
pip install ./audiodsp numpy
|
|
42
|
+
pip install --no-deps ./audioinstruments ./audioeffects/lib/audioeffects
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The libraries the apps share (`appkit`, `controlkit`, `deskkit`, `sayso`,
|
|
46
|
+
`songmodel`, `soundmodule`, `spectrum` and `touchkit`) also install as a package, under
|
|
47
|
+
their own names. Each is imported directly, as in `import controlkit`:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install -i https://test.pypi.org/simple/ omnipython-applibs
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
On a board, use `mip.install("applibs", index="https://lib.omnipython.org")`.
|
|
54
|
+
To freeze them into firmware, name this repository's folder as a module of the
|
|
55
|
+
build: its [manifest.py](manifest.py) lists them.
|
|
56
|
+
|
|
57
|
+
## Try it
|
|
58
|
+
|
|
59
|
+
Render a MIDI file through the sound module to a WAV, with no MIDI hardware.
|
|
60
|
+
The sound comes from a General MIDI SoundFont (`.sf2`) that you supply, such
|
|
61
|
+
as [GeneralUser GS](https://schristiancollins.com/generaluser.php):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
cd apps
|
|
65
|
+
python tools/render_mid.py tests/midi/musicbox1_spooky_waltz.mid take.wav --bank GeneralUser-GS.sf2 --path lib
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
It writes `take.wav`, 53 seconds of celesta, and prints what it measured:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
notes 261
|
|
72
|
+
played 261
|
|
73
|
+
held 0
|
|
74
|
+
sounding 0
|
|
75
|
+
song 53.310
|
|
76
|
+
render 0.947
|
|
77
|
+
reverb 0
|
|
78
|
+
chorus 0
|
|
79
|
+
soundmodule: cpython 3.12.3 (linux): 0 bytes of MIDI, 0 Identity Requests answered, render behind by at most 0 ms while playing (0 ms before the first note)
|
|
80
|
+
channel 1: 157 notes, bank 0:0 program 8, Celesta
|
|
81
|
+
channel 2: 56 notes, bank 0:0 program 8, Celesta
|
|
82
|
+
channel 3: 32 notes, bank 0:0 program 8, Celesta
|
|
83
|
+
channel 16: 16 notes, bank 0:0 program 8, Celesta
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`played` equals `notes` when every note sounded. The `render` and interpreter lines are yours to differ on.
|
|
87
|
+
|
|
88
|
+
[Docs](docs/index.md) | [Examples](https://gallery.omnipython.org) | [Roadmap](ROADMAP.md)
|
|
89
|
+
|
|
90
|
+
Made by [PyDevices](https://pydevices.com).
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Apps
|
|
4
|
+
|
|
5
|
+
The apps for PyDevices: things you run on a board or a desktop. A Home app lives in `apps/`; a program, which runs on its own, lives in [`programs/`](programs/README.md).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
On a Wi-Fi board, one line installs an app with what it needs, and another
|
|
10
|
+
starts Home at boot ([install an app](docs/guides/install-an-app.md)):
|
|
11
|
+
|
|
12
|
+
```python
|
|
13
|
+
import omip
|
|
14
|
+
omip.install("github:PyDevices/apps/apps/home")
|
|
15
|
+
omip.install("github:PyDevices/apps/apps/home/main.py", target="/")
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
On a computer, the apps are used from a clone, beside the libraries they build on:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git clone https://github.com/PyDevices/apps
|
|
22
|
+
git clone https://github.com/PyDevices/audioinstruments
|
|
23
|
+
git clone https://github.com/PyDevices/audioeffects
|
|
24
|
+
git clone https://github.com/PyDevices/audiodsp
|
|
25
|
+
pip install ./audiodsp numpy
|
|
26
|
+
pip install --no-deps ./audioinstruments ./audioeffects/lib/audioeffects
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The libraries the apps share (`appkit`, `controlkit`, `deskkit`, `sayso`,
|
|
30
|
+
`songmodel`, `soundmodule`, `spectrum` and `touchkit`) also install as a package, under
|
|
31
|
+
their own names. Each is imported directly, as in `import controlkit`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install -i https://test.pypi.org/simple/ omnipython-applibs
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
On a board, use `mip.install("applibs", index="https://lib.omnipython.org")`.
|
|
38
|
+
To freeze them into firmware, name this repository's folder as a module of the
|
|
39
|
+
build: its [manifest.py](manifest.py) lists them.
|
|
40
|
+
|
|
41
|
+
## Try it
|
|
42
|
+
|
|
43
|
+
Render a MIDI file through the sound module to a WAV, with no MIDI hardware.
|
|
44
|
+
The sound comes from a General MIDI SoundFont (`.sf2`) that you supply, such
|
|
45
|
+
as [GeneralUser GS](https://schristiancollins.com/generaluser.php):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cd apps
|
|
49
|
+
python tools/render_mid.py tests/midi/musicbox1_spooky_waltz.mid take.wav --bank GeneralUser-GS.sf2 --path lib
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
It writes `take.wav`, 53 seconds of celesta, and prints what it measured:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
notes 261
|
|
56
|
+
played 261
|
|
57
|
+
held 0
|
|
58
|
+
sounding 0
|
|
59
|
+
song 53.310
|
|
60
|
+
render 0.947
|
|
61
|
+
reverb 0
|
|
62
|
+
chorus 0
|
|
63
|
+
soundmodule: cpython 3.12.3 (linux): 0 bytes of MIDI, 0 Identity Requests answered, render behind by at most 0 ms while playing (0 ms before the first note)
|
|
64
|
+
channel 1: 157 notes, bank 0:0 program 8, Celesta
|
|
65
|
+
channel 2: 56 notes, bank 0:0 program 8, Celesta
|
|
66
|
+
channel 3: 32 notes, bank 0:0 program 8, Celesta
|
|
67
|
+
channel 16: 16 notes, bank 0:0 program 8, Celesta
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`played` equals `notes` when every note sounded. The `render` and interpreter lines are yours to differ on.
|
|
71
|
+
|
|
72
|
+
[Docs](docs/index.md) | [Examples](https://gallery.omnipython.org) | [Roadmap](ROADMAP.md)
|
|
73
|
+
|
|
74
|
+
Made by [PyDevices](https://pydevices.com).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.2.dev16
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Brad Barnett
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
"""appkit: apps you can switch between, and a launcher to run them.
|
|
5
|
+
|
|
6
|
+
::
|
|
7
|
+
|
|
8
|
+
import appkit
|
|
9
|
+
appkit.run() # a home screen of every app in ./apps
|
|
10
|
+
appkit.run("hello") # one app, alone
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from .foreground import serve
|
|
14
|
+
from .launcher import Launcher, host, run_pending_script
|
|
15
|
+
from .scope import AppScope
|
|
16
|
+
from .shell import Shell
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def run(name=None, folder="apps", *, data_root=None):
|
|
20
|
+
"""Run the apps in *folder*: a home screen listing them, or app *name* alone.
|
|
21
|
+
|
|
22
|
+
The home screen is the folder's own app named ``home`` when it has one,
|
|
23
|
+
and otherwise appkit's list of buttons, ``appkit.home``.
|
|
24
|
+
|
|
25
|
+
It ends in the main-thread loop, `serve`, and returns the
|
|
26
|
+
``Launcher`` when the program quits. In a browser, where the page has
|
|
27
|
+
the main thread, it returns the launcher at once. *data_root* moves
|
|
28
|
+
every app's ``data_dir`` and the launcher's restart file (see
|
|
29
|
+
``appkit.data``). A plain script the home screen started runs here
|
|
30
|
+
first, before the display opens, and doesn't return.
|
|
31
|
+
"""
|
|
32
|
+
if run_pending_script(data_root):
|
|
33
|
+
return None # a browser, reloading
|
|
34
|
+
from display_driver import app # the one App every LVGL program shares
|
|
35
|
+
|
|
36
|
+
launcher = Launcher(app)
|
|
37
|
+
launcher.scan(folder)
|
|
38
|
+
if name is None:
|
|
39
|
+
_use_home(launcher)
|
|
40
|
+
launcher.shell = Shell(launcher)
|
|
41
|
+
launcher.boot(name)
|
|
42
|
+
if host() != "browser":
|
|
43
|
+
serve(app)
|
|
44
|
+
return launcher
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _use_home(launcher):
|
|
48
|
+
"""Make ``home`` the launcher's home screen: the folder's own app named
|
|
49
|
+
home when the scan found one, else appkit's list of buttons."""
|
|
50
|
+
if "home" not in launcher.names:
|
|
51
|
+
launcher.add("home", "appkit.home")
|
|
52
|
+
launcher.home = "home"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Brad Barnett
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
"""appkit: apps you can switch between, and a launcher to run them."""
|
|
5
|
+
|
|
6
|
+
from .foreground import serve as serve
|
|
7
|
+
from .launcher import Launcher as Launcher, host as host, run_pending_script as run_pending_script
|
|
8
|
+
from .scope import AppScope as AppScope
|
|
9
|
+
from .shell import Shell as Shell
|
|
10
|
+
|
|
11
|
+
def run(name: str | None = None, folder: str = 'apps', *, data_root: str | None = None) -> Launcher | None:
|
|
12
|
+
"""Run the apps in `folder`: a home screen listing them, or app `name` alone.
|
|
13
|
+
|
|
14
|
+
Ends in the main-thread loop and returns the `Launcher` when the program
|
|
15
|
+
quits. In a browser it returns the launcher at once. `data_root` moves every
|
|
16
|
+
app's `data_dir` and the launcher's restart file.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Brad Barnett
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
"""Where apps keep their files: the data root, and a folder per app under it.
|
|
5
|
+
|
|
6
|
+
The data root is one setting for the whole program. Each app's folder is
|
|
7
|
+
``<root>/<app>``, made on first use. The launcher's restart file lives in
|
|
8
|
+
the root too. By default the root is:
|
|
9
|
+
|
|
10
|
+
============== ==========================================================
|
|
11
|
+
Linux ``$XDG_DATA_HOME/appkit``, or ``~/.local/share/appkit``
|
|
12
|
+
Windows ``%LOCALAPPDATA%\\appkit``
|
|
13
|
+
macOS ``~/Library/Application Support/appkit``
|
|
14
|
+
a board ``/data`` (``/flash/data`` on an STM32, whose ``/`` only holds mounts)
|
|
15
|
+
the browser ``/data``
|
|
16
|
+
============== ==========================================================
|
|
17
|
+
|
|
18
|
+
``appkit.run(data_root=...)``, the same argument to ``Shell`` or
|
|
19
|
+
`set_root` moves it everywhere. Without one, ``APPKIT_DATA`` moves it
|
|
20
|
+
on a desktop.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
import sys
|
|
24
|
+
|
|
25
|
+
#: Platforms that are a desktop operating system, whatever the interpreter.
|
|
26
|
+
DESKTOPS = ("linux", "darwin", "win32", "cygwin", "freebsd", "openbsd", "netbsd")
|
|
27
|
+
|
|
28
|
+
_root = None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def desktop(platform=None, implementation=None):
|
|
32
|
+
"""True on a desktop operating system (CPython, or MicroPython's unix or
|
|
33
|
+
Windows port), False on a board or in the browser."""
|
|
34
|
+
platform = platform or sys.platform
|
|
35
|
+
implementation = implementation or sys.implementation.name
|
|
36
|
+
if platform in ("webassembly", "emscripten", "wasi"):
|
|
37
|
+
return False
|
|
38
|
+
if implementation == "cpython":
|
|
39
|
+
return True
|
|
40
|
+
return platform in DESKTOPS
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _getenv(name):
|
|
44
|
+
import os
|
|
45
|
+
|
|
46
|
+
getenv = getattr(os, "getenv", None) # boards have none
|
|
47
|
+
if getenv is None:
|
|
48
|
+
return None
|
|
49
|
+
try:
|
|
50
|
+
return getenv(name) or None
|
|
51
|
+
except Exception:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def default_root(platform=None, implementation=None, getenv=None):
|
|
56
|
+
"""The data root this host uses when nothing sets one.
|
|
57
|
+
|
|
58
|
+
*platform*, *implementation* and *getenv* stand in for ``sys.platform``,
|
|
59
|
+
``sys.implementation.name`` and ``os.getenv``, to ask about another host.
|
|
60
|
+
"""
|
|
61
|
+
platform = platform or sys.platform
|
|
62
|
+
if getenv is None:
|
|
63
|
+
getenv = _getenv
|
|
64
|
+
if not desktop(platform, implementation):
|
|
65
|
+
# The stm32 port's "/" is only where /flash and /sd are mounted, and
|
|
66
|
+
# a folder can't be made there.
|
|
67
|
+
return "/flash/data" if platform == "pyboard" else "/data"
|
|
68
|
+
explicit = getenv("APPKIT_DATA")
|
|
69
|
+
if explicit:
|
|
70
|
+
return explicit
|
|
71
|
+
if platform == "win32":
|
|
72
|
+
base = getenv("LOCALAPPDATA")
|
|
73
|
+
if not base:
|
|
74
|
+
base = (getenv("USERPROFILE") or ".") + "\\AppData\\Local"
|
|
75
|
+
return base + "\\appkit"
|
|
76
|
+
home = getenv("HOME") or getenv("USERPROFILE") or "."
|
|
77
|
+
if platform == "darwin":
|
|
78
|
+
# Untested: macOS is community-supported.
|
|
79
|
+
return home + "/Library/Application Support/appkit"
|
|
80
|
+
base = getenv("XDG_DATA_HOME") or home + "/.local/share"
|
|
81
|
+
return base + "/appkit"
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def root():
|
|
85
|
+
"""The data root: what `set_root` set, else `default_root`."""
|
|
86
|
+
return _root if _root is not None else default_root()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def set_root(path):
|
|
90
|
+
"""Move the data root for the whole program; None goes back to the default."""
|
|
91
|
+
global _root
|
|
92
|
+
if path is not None:
|
|
93
|
+
path = str(path)
|
|
94
|
+
while len(path) > 1 and path[-1] in "/\\" and not path.endswith(":\\"):
|
|
95
|
+
path = path[:-1]
|
|
96
|
+
_root = path
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def join(base, *parts):
|
|
100
|
+
"""*base* and *parts* joined with the separator *base* already uses."""
|
|
101
|
+
sep = "\\" if ("\\" in base and "/" not in base) else "/"
|
|
102
|
+
out = base
|
|
103
|
+
for part in parts:
|
|
104
|
+
if out and out[-1] in "/\\":
|
|
105
|
+
out += part
|
|
106
|
+
else:
|
|
107
|
+
out += sep + part
|
|
108
|
+
return out
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _exists(path):
|
|
112
|
+
import os
|
|
113
|
+
|
|
114
|
+
try:
|
|
115
|
+
os.stat(path)
|
|
116
|
+
return True
|
|
117
|
+
except OSError:
|
|
118
|
+
return False
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def makedirs(path):
|
|
122
|
+
"""Make folder *path* and any parents it needs; fine if it exists.
|
|
123
|
+
|
|
124
|
+
``os.makedirs`` for MicroPython, which has only ``os.mkdir``.
|
|
125
|
+
"""
|
|
126
|
+
import os
|
|
127
|
+
|
|
128
|
+
if _exists(path):
|
|
129
|
+
return path
|
|
130
|
+
# Every prefix, shortest first: "/a", "/a/b", ... or "C:\\a", "C:\\a\\b".
|
|
131
|
+
prefixes = []
|
|
132
|
+
for i in range(1, len(path)):
|
|
133
|
+
if path[i] in "/\\" and path[i - 1] not in "/\\:":
|
|
134
|
+
prefixes.append(path[:i])
|
|
135
|
+
prefixes.append(path)
|
|
136
|
+
for p in prefixes:
|
|
137
|
+
if not _exists(p):
|
|
138
|
+
try:
|
|
139
|
+
os.mkdir(p)
|
|
140
|
+
except OSError:
|
|
141
|
+
pass # made meanwhile, or a drive or root we can't make
|
|
142
|
+
if not _exists(path):
|
|
143
|
+
raise OSError("could not make the folder %r" % (path,))
|
|
144
|
+
return path
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def app_dir(name, base=None):
|
|
148
|
+
"""App *name*'s folder under *base* (default: the data root), made if missing."""
|
|
149
|
+
return makedirs(join(base if base is not None else root(), name))
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Brad Barnett
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
"""Where apps keep their files: the data root, and a folder per app under it."""
|
|
5
|
+
|
|
6
|
+
from collections.abc import Callable
|
|
7
|
+
|
|
8
|
+
DESKTOPS: tuple[str, ...]
|
|
9
|
+
|
|
10
|
+
def desktop(platform: str | None = None, implementation: str | None = None) -> bool:
|
|
11
|
+
"""True on a desktop operating system, False on a board or in the browser."""
|
|
12
|
+
def default_root(
|
|
13
|
+
platform: str | None = None, implementation: str | None = None, getenv: Callable[[str], str | None] | None = None
|
|
14
|
+
) -> str:
|
|
15
|
+
"""The data root this host uses when nothing sets one."""
|
|
16
|
+
def root() -> str:
|
|
17
|
+
"""The data root: what `set_root` set, else `default_root`."""
|
|
18
|
+
def set_root(path: str | None) -> None:
|
|
19
|
+
"""Move the data root for the whole program; None goes back to the default."""
|
|
20
|
+
def join(base: str, *parts: str) -> str:
|
|
21
|
+
"""`base` and `parts` joined with the separator `base` already uses."""
|
|
22
|
+
def makedirs(path: str) -> str:
|
|
23
|
+
"""Make folder `path` and any parents it needs; fine if it exists."""
|
|
24
|
+
def app_dir(name: str, base: str | None = None) -> str:
|
|
25
|
+
"""App `name`'s folder under `base` (default: the data root), made if missing."""
|