pyvmancer 0.1.0__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.
- pyvmancer-0.1.0/.github/dependabot.yml +10 -0
- pyvmancer-0.1.0/.github/workflows/ci.yml +34 -0
- pyvmancer-0.1.0/.github/workflows/release.yml +37 -0
- pyvmancer-0.1.0/.gitignore +13 -0
- pyvmancer-0.1.0/LICENSE +201 -0
- pyvmancer-0.1.0/PKG-INFO +115 -0
- pyvmancer-0.1.0/README.md +85 -0
- pyvmancer-0.1.0/docs/firmware-notes.md +84 -0
- pyvmancer-0.1.0/docs/permissions.md +80 -0
- pyvmancer-0.1.0/docs/protocol.md +158 -0
- pyvmancer-0.1.0/pyproject.toml +79 -0
- pyvmancer-0.1.0/pyvmancer/__init__.py +67 -0
- pyvmancer-0.1.0/pyvmancer/cli.py +151 -0
- pyvmancer-0.1.0/pyvmancer/const.py +279 -0
- pyvmancer-0.1.0/pyvmancer/device.py +285 -0
- pyvmancer-0.1.0/pyvmancer/discovery.py +132 -0
- pyvmancer-0.1.0/pyvmancer/errors.py +39 -0
- pyvmancer-0.1.0/pyvmancer/midi.py +281 -0
- pyvmancer-0.1.0/pyvmancer/scaling.py +91 -0
- pyvmancer-0.1.0/pyvmancer/shell.py +495 -0
- pyvmancer-0.1.0/pyvmancer/transports/__init__.py +6 -0
- pyvmancer-0.1.0/pyvmancer/transports/base.py +59 -0
- pyvmancer-0.1.0/pyvmancer/transports/mido_port.py +70 -0
- pyvmancer-0.1.0/pyvmancer/transports/rawmidi.py +70 -0
- pyvmancer-0.1.0/pyvmancer/transports/serial_tty.py +57 -0
- pyvmancer-0.1.0/pyvmancer/transports/usb_cdc.py +151 -0
- pyvmancer-0.1.0/pyvmancer.egg-info/PKG-INFO +115 -0
- pyvmancer-0.1.0/pyvmancer.egg-info/SOURCES.txt +40 -0
- pyvmancer-0.1.0/pyvmancer.egg-info/dependency_links.txt +1 -0
- pyvmancer-0.1.0/pyvmancer.egg-info/entry_points.txt +2 -0
- pyvmancer-0.1.0/pyvmancer.egg-info/requires.txt +13 -0
- pyvmancer-0.1.0/pyvmancer.egg-info/top_level.txt +1 -0
- pyvmancer-0.1.0/setup.cfg +4 -0
- pyvmancer-0.1.0/tests/__init__.py +1 -0
- pyvmancer-0.1.0/tests/conftest.py +144 -0
- pyvmancer-0.1.0/tests/test_const.py +125 -0
- pyvmancer-0.1.0/tests/test_device.py +434 -0
- pyvmancer-0.1.0/tests/test_discovery.py +174 -0
- pyvmancer-0.1.0/tests/test_midi.py +294 -0
- pyvmancer-0.1.0/tests/test_scaling.py +116 -0
- pyvmancer-0.1.0/tests/test_shell.py +483 -0
- pyvmancer-0.1.0/tests/test_transports.py +723 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v7
|
|
18
|
+
- uses: actions/setup-python@v7
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
- name: Install ALSA for python-rtmidi
|
|
22
|
+
# The -dev headers are needed on Pythons with no python-rtmidi wheel (3.13).
|
|
23
|
+
run: sudo apt-get update && sudo apt-get install -y libasound2t64 libasound2-dev
|
|
24
|
+
- name: Install package and dev dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install -e ".[all]"
|
|
28
|
+
pip install --group dev || pip install black pylint pytest pytest-cov pytest-xdist pyserial pyusb
|
|
29
|
+
- name: Format check
|
|
30
|
+
run: black --check .
|
|
31
|
+
- name: Lint
|
|
32
|
+
run: pylint pyvmancer tests
|
|
33
|
+
- name: Test
|
|
34
|
+
run: pytest
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v7
|
|
13
|
+
- uses: actions/setup-python@v7
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.12"
|
|
16
|
+
- name: Build sdist and wheel
|
|
17
|
+
run: |
|
|
18
|
+
python -m pip install --upgrade pip
|
|
19
|
+
pip install build
|
|
20
|
+
python -m build
|
|
21
|
+
- uses: actions/upload-artifact@v7
|
|
22
|
+
with:
|
|
23
|
+
name: dist
|
|
24
|
+
path: dist/
|
|
25
|
+
|
|
26
|
+
publish:
|
|
27
|
+
needs: build
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
environment: pypi
|
|
30
|
+
permissions:
|
|
31
|
+
id-token: write
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/download-artifact@v8
|
|
34
|
+
with:
|
|
35
|
+
name: dist
|
|
36
|
+
path: dist/
|
|
37
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
pyvmancer-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
pyvmancer-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyvmancer
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Automate the LZX Industries Videomancer over USB MIDI and USB serial
|
|
5
|
+
Author-email: Josh Bailey <josh@overlyspecific.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/anarkiwi/pyvmancer
|
|
8
|
+
Project-URL: Issues, https://github.com/anarkiwi/pyvmancer/issues
|
|
9
|
+
Keywords: lzx,videomancer,midi,video-synthesis,usb
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: MIDI
|
|
15
|
+
Classifier: Topic :: System :: Hardware :: Hardware Drivers
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: mido>=1.3
|
|
20
|
+
Requires-Dist: python-rtmidi>=1.5
|
|
21
|
+
Requires-Dist: numpy>=1.24
|
|
22
|
+
Provides-Extra: serial
|
|
23
|
+
Requires-Dist: pyserial>=3.5; extra == "serial"
|
|
24
|
+
Provides-Extra: usb
|
|
25
|
+
Requires-Dist: pyusb>=1.2; extra == "usb"
|
|
26
|
+
Provides-Extra: all
|
|
27
|
+
Requires-Dist: pyserial>=3.5; extra == "all"
|
|
28
|
+
Requires-Dist: pyusb>=1.2; extra == "all"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# pyvmancer
|
|
32
|
+
|
|
33
|
+
Python library and CLI to automate the [LZX Industries Videomancer](https://lzxindustries.net/products/videomancer) over USB.
|
|
34
|
+
|
|
35
|
+
Two control paths, usable together or independently:
|
|
36
|
+
|
|
37
|
+
| Path | Transport | Covers |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| USB MIDI | ALSA rawmidi or any `mido` backend | 12 parameters (7/14-bit CC), preset recall, note triggers, clock/transport |
|
|
40
|
+
| USB serial | `/dev/ttyACM*` or libusb | programs, presets, modulation operators, video, settings, filesystem |
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
pip install pyvmancer # MIDI only
|
|
46
|
+
pip install "pyvmancer[all]" # adds serial and libusb transports
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
On Linux the `python-rtmidi` dependency links `libasound.so.2`:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
sudo apt-get install libasound2t64
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Use
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import pyvmancer as vm
|
|
59
|
+
|
|
60
|
+
d = vm.Videomancer.open()
|
|
61
|
+
|
|
62
|
+
d.load_program("Isotherm")
|
|
63
|
+
d.set_named("Posterize", 5) # native units: Posterize is 0..7
|
|
64
|
+
d.set_named("Mix", 80) # Mix is 0..100
|
|
65
|
+
d.set_source("Contrast", "free lfo")
|
|
66
|
+
|
|
67
|
+
d.set_param(1, 0.75) # or address slots directly, 0.0..1.0
|
|
68
|
+
d.set_param(7, True) # toggles take bools
|
|
69
|
+
d.trigger(4) # note-trigger a modulation operator
|
|
70
|
+
|
|
71
|
+
d.set_bpm(128)
|
|
72
|
+
d.play()
|
|
73
|
+
d.close()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
MIDI only, no serial link needed:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
with vm.open_midi(channel=1) as m:
|
|
80
|
+
m.set_param(1, 0.5)
|
|
81
|
+
m.select_preset(3)
|
|
82
|
+
m.run_clock(120, beats=8)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## CLI
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
vmancer devices # discover attached units and their device nodes
|
|
89
|
+
vmancer operators # list the 25 modulation operators
|
|
90
|
+
vmancer set 1=0.5 7=on # set parameters over MIDI
|
|
91
|
+
vmancer preset 3 # recall a preset
|
|
92
|
+
vmancer programs # list installed FPGA programs
|
|
93
|
+
vmancer load Isotherm # load a program
|
|
94
|
+
vmancer shell modulation status # run any raw shell command
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Permissions
|
|
98
|
+
|
|
99
|
+
MIDI needs read/write on `/dev/snd/midiC*D*` (usually granted by a desktop ACL);
|
|
100
|
+
serial needs the `dialout` group or an ACL on `/dev/ttyACM*`. See
|
|
101
|
+
[docs/permissions.md](docs/permissions.md).
|
|
102
|
+
|
|
103
|
+
## Docs
|
|
104
|
+
|
|
105
|
+
- [docs/protocol.md](docs/protocol.md) — MIDI implementation and the serial command set
|
|
106
|
+
- [docs/permissions.md](docs/permissions.md) — device node access, containers, udev
|
|
107
|
+
- [docs/firmware-notes.md](docs/firmware-notes.md) — observed firmware behaviour and quirks
|
|
108
|
+
|
|
109
|
+
## Status
|
|
110
|
+
|
|
111
|
+
Verified against a Videomancer running firmware `1.0.0-rc.37`. Not affiliated with LZX Industries.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
Apache-2.0
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# pyvmancer
|
|
2
|
+
|
|
3
|
+
Python library and CLI to automate the [LZX Industries Videomancer](https://lzxindustries.net/products/videomancer) over USB.
|
|
4
|
+
|
|
5
|
+
Two control paths, usable together or independently:
|
|
6
|
+
|
|
7
|
+
| Path | Transport | Covers |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| USB MIDI | ALSA rawmidi or any `mido` backend | 12 parameters (7/14-bit CC), preset recall, note triggers, clock/transport |
|
|
10
|
+
| USB serial | `/dev/ttyACM*` or libusb | programs, presets, modulation operators, video, settings, filesystem |
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pip install pyvmancer # MIDI only
|
|
16
|
+
pip install "pyvmancer[all]" # adds serial and libusb transports
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
On Linux the `python-rtmidi` dependency links `libasound.so.2`:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
sudo apt-get install libasound2t64
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Use
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import pyvmancer as vm
|
|
29
|
+
|
|
30
|
+
d = vm.Videomancer.open()
|
|
31
|
+
|
|
32
|
+
d.load_program("Isotherm")
|
|
33
|
+
d.set_named("Posterize", 5) # native units: Posterize is 0..7
|
|
34
|
+
d.set_named("Mix", 80) # Mix is 0..100
|
|
35
|
+
d.set_source("Contrast", "free lfo")
|
|
36
|
+
|
|
37
|
+
d.set_param(1, 0.75) # or address slots directly, 0.0..1.0
|
|
38
|
+
d.set_param(7, True) # toggles take bools
|
|
39
|
+
d.trigger(4) # note-trigger a modulation operator
|
|
40
|
+
|
|
41
|
+
d.set_bpm(128)
|
|
42
|
+
d.play()
|
|
43
|
+
d.close()
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
MIDI only, no serial link needed:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
with vm.open_midi(channel=1) as m:
|
|
50
|
+
m.set_param(1, 0.5)
|
|
51
|
+
m.select_preset(3)
|
|
52
|
+
m.run_clock(120, beats=8)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## CLI
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
vmancer devices # discover attached units and their device nodes
|
|
59
|
+
vmancer operators # list the 25 modulation operators
|
|
60
|
+
vmancer set 1=0.5 7=on # set parameters over MIDI
|
|
61
|
+
vmancer preset 3 # recall a preset
|
|
62
|
+
vmancer programs # list installed FPGA programs
|
|
63
|
+
vmancer load Isotherm # load a program
|
|
64
|
+
vmancer shell modulation status # run any raw shell command
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Permissions
|
|
68
|
+
|
|
69
|
+
MIDI needs read/write on `/dev/snd/midiC*D*` (usually granted by a desktop ACL);
|
|
70
|
+
serial needs the `dialout` group or an ACL on `/dev/ttyACM*`. See
|
|
71
|
+
[docs/permissions.md](docs/permissions.md).
|
|
72
|
+
|
|
73
|
+
## Docs
|
|
74
|
+
|
|
75
|
+
- [docs/protocol.md](docs/protocol.md) — MIDI implementation and the serial command set
|
|
76
|
+
- [docs/permissions.md](docs/permissions.md) — device node access, containers, udev
|
|
77
|
+
- [docs/firmware-notes.md](docs/firmware-notes.md) — observed firmware behaviour and quirks
|
|
78
|
+
|
|
79
|
+
## Status
|
|
80
|
+
|
|
81
|
+
Verified against a Videomancer running firmware `1.0.0-rc.37`. Not affiliated with LZX Industries.
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
Apache-2.0
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Firmware notes
|
|
2
|
+
|
|
3
|
+
Observations from a Videomancer running `1.0.0-rc.37`, serial `E464B0605F113625`.
|
|
4
|
+
The published LZX documentation describes a `2.1.0` firmware, and the two differ
|
|
5
|
+
in several places. Always treat `help` and `fs caps` as authoritative.
|
|
6
|
+
|
|
7
|
+
## `settings export` resets the USB link
|
|
8
|
+
|
|
9
|
+
Running `settings export` reliably drops the CDC connection mid-reply:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
TransportError: read from /dev/ttyACM0 failed: device reports readiness to read
|
|
13
|
+
but returned no data
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The device then re-enumerates with a new USB address; the next write on the old
|
|
17
|
+
handle fails with `EIO`. The unit recovers on its own and no state is lost, but
|
|
18
|
+
any open handle must be reopened, and a `/dev/bus/usb` ACL granted to the old
|
|
19
|
+
address is gone.
|
|
20
|
+
|
|
21
|
+
The reply appears to exceed the shell's response buffer. `pyvmancer` therefore
|
|
22
|
+
does not wrap `settings export`; use `settings get <key_id>` for individual keys.
|
|
23
|
+
|
|
24
|
+
## Error codes are tagged
|
|
25
|
+
|
|
26
|
+
Documented codes are 1-10. This firmware returns them as `0x58000000 | n`, so a
|
|
27
|
+
usage error arrives as `1476395010`. `pyvmancer.shell.decode_error_code` strips
|
|
28
|
+
the tag; `ShellError.code` is the decoded value.
|
|
29
|
+
|
|
30
|
+
## Command set is much larger than documented
|
|
31
|
+
|
|
32
|
+
`help` reports 64 commands against the ~30 in the published guide. The additions
|
|
33
|
+
that matter for automation are the whole `modulation` group (`status`, `source`,
|
|
34
|
+
`set`, `reset`, `cc-map`, `latch`, `audio status`), `program info`, the `video`
|
|
35
|
+
and `remote` groups, and `settings get`/`set`/`reset`.
|
|
36
|
+
|
|
37
|
+
## Not every command acknowledges with `ok`
|
|
38
|
+
|
|
39
|
+
Most commands reply `@<tag>:ok`, but several use a verb of their own. Observed on
|
|
40
|
+
`1.0.0-rc.37`:
|
|
41
|
+
|
|
42
|
+
| Command | Reply |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `remote enable` | `enabled` |
|
|
45
|
+
| `remote disable` | `disabled` |
|
|
46
|
+
| `midi monitor <mode>` | `monitor <mode>` |
|
|
47
|
+
| `log level <level>` | the level, uppercased, e.g. `INFO` |
|
|
48
|
+
| `language` (no argument) | the current locale, e.g. `en_US` |
|
|
49
|
+
|
|
50
|
+
`transport play/stop/bpm`, `modulation set/source/reset/latch`, `remote write` and
|
|
51
|
+
the preset and filesystem mutations all do reply `ok`.
|
|
52
|
+
|
|
53
|
+
## `fs read` is capped at 256 bytes
|
|
54
|
+
|
|
55
|
+
`fs caps` reports `read_max_bytes: 256`. Larger requests fail, so reads must be
|
|
56
|
+
chunked at or below that. `pyvmancer` queries `fs caps` and uses the reported
|
|
57
|
+
limit.
|
|
58
|
+
|
|
59
|
+
## Modulation knobs need an active source
|
|
60
|
+
|
|
61
|
+
`modulation set <index> <manual> <time> <space> <slope>` accepts and acknowledges
|
|
62
|
+
all five arguments even when the slot's source is `Disabled`, but `t`/`sp`/`sl`
|
|
63
|
+
in `program state` stay at 512. Assign a source first, then set the knobs.
|
|
64
|
+
|
|
65
|
+
## Manual value and MIDI are separate
|
|
66
|
+
|
|
67
|
+
A MIDI CC does not change `m` in `program state`. It contributes to the combined
|
|
68
|
+
`o` output in `modulation status` while leaving the stored manual value alone,
|
|
69
|
+
matching the documented `Manual + Modulation + MIDI` sum. To change the stored
|
|
70
|
+
value, use `modulation set` over serial.
|
|
71
|
+
|
|
72
|
+
## Program inventory
|
|
73
|
+
|
|
74
|
+
21 programs on this unit, several of which are not in the published list
|
|
75
|
+
(`Colorbars`, `Passthru`), and some published names are absent (`Fauxtress`,
|
|
76
|
+
`Moire`, `Mycelium`, `Perlin`). `pyvmancer.const.EMBEDDED_PROGRAMS` is a
|
|
77
|
+
convenience list only; call `programs list`.
|
|
78
|
+
|
|
79
|
+
## MIDI byte counts
|
|
80
|
+
|
|
81
|
+
`/proc/asound/card*/midi0` Tx counts are lower than the bytes handed to the
|
|
82
|
+
library because the ALSA sequencer applies running-status compression. A
|
|
83
|
+
high-resolution parameter write plus a program change plus a note pair measured
|
|
84
|
+
21 bytes rather than 26.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Device access and permissions
|
|
2
|
+
|
|
3
|
+
The Videomancer presents four device nodes. `vmancer devices` reports all of
|
|
4
|
+
them:
|
|
5
|
+
|
|
6
|
+
```json
|
|
7
|
+
{
|
|
8
|
+
"serial": "E464B0605F113625",
|
|
9
|
+
"rawmidi": "/dev/snd/midiC6D0",
|
|
10
|
+
"tty": "/dev/ttyACM0",
|
|
11
|
+
"block": "/dev/sdc",
|
|
12
|
+
"usbfs": "/dev/bus/usb/003/041"
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Node | Used for | Default owner |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| `/dev/snd/midiC*D*` | USB MIDI | `root:audio`, usually ACL-granted to the desktop user |
|
|
19
|
+
| `/dev/ttyACM*` | serial shell | `root:dialout` |
|
|
20
|
+
| `/dev/bus/usb/*/*` | serial shell over libusb | `root:root`, mode `0664` |
|
|
21
|
+
| `/dev/sd*` | microSD as mass storage | `root:disk` |
|
|
22
|
+
|
|
23
|
+
## Granting access
|
|
24
|
+
|
|
25
|
+
Serial normally just needs group membership, which takes effect on next login:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
sudo usermod -aG dialout "$USER"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For a persistent, group-free rule, install a udev rule that ACLs every interface
|
|
32
|
+
of the device to the seat's active user:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
# /etc/udev/rules.d/70-lzx-videomancer.rules
|
|
36
|
+
SUBSYSTEM=="usb", ATTR{idVendor}=="16d0", ATTR{idProduct}=="14db", TAG+="uaccess"
|
|
37
|
+
SUBSYSTEM=="tty", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="14db", TAG+="uaccess"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
sudo udevadm control --reload-rules && sudo udevadm trigger
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Containers
|
|
45
|
+
|
|
46
|
+
Passing the device into a container needs the nodes mapped *and* writable by the
|
|
47
|
+
container uid. Mapping `/dev/snd` alone gives you MIDI but not the shell.
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
docker run --device /dev/snd --device /dev/ttyACM0 ...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If `/dev/tty*` cannot be mapped, the serial shell can still be reached through
|
|
54
|
+
libusb against `/dev/bus/usb`, which needs read-write on the usbfs node:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
shell = pyvmancer.open_shell(prefer="usb")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Note that usbfs requires `O_RDWR`; read-only access is not enough to claim the
|
|
61
|
+
interface, and the node's address changes whenever the device re-enumerates.
|
|
62
|
+
|
|
63
|
+
Where `libasound.so.2` is absent, the pure-Python ALSA rawmidi backend still
|
|
64
|
+
works and needs no ALSA userspace at all:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
midi = pyvmancer.open_midi(prefer="rawmidi")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Diagnosing
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
vmancer devices # what the library can see
|
|
74
|
+
amidi -l # ALSA's view of MIDI ports
|
|
75
|
+
cat /proc/asound/card*/midi0 # rawmidi Tx/Rx byte counters
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The Tx counter is the quickest confirmation that bytes actually reached the
|
|
79
|
+
device. ALSA applies running-status compression, so the count is usually lower
|
|
80
|
+
than the number of bytes handed to the library.
|