|
1 | 1 | # MIDIMonster development guide
|
2 | 2 |
|
3 | 3 | This document serves as a reference for contributors interested in the low-level implementation
|
4 |
| -of the MIDIMonster. It is currently a work in progress and will be extended as problems come |
5 |
| -up and need solving ;) |
| 4 | +of the MIDIMonster. It will be extended as problems come up and need solving ;) |
6 | 5 |
|
7 | 6 | ## Basics
|
8 | 7 |
|
@@ -44,19 +43,55 @@ in spirit rather than by the letter.
|
44 | 43 | * Avoid `atoi()`/`itoa()`, use `strto[u]l[l]()` and `snprintf()`
|
45 | 44 | * Avoid unsafe functions without explicit bounds parameters (eg. `strcat()`).
|
46 | 45 |
|
47 |
| -# Repository layout |
| 46 | +## Repository layout |
48 | 47 |
|
49 | 48 | * Keep the root directory as clean as possible
|
50 | 49 | * Files that are not related directly to the MIDIMonster implementation go into the `assets/` directory
|
51 | 50 | * Prefer vendor-neutral names for configuration files where necessary
|
52 | 51 |
|
53 |
| -# Build pipeline |
| 52 | +## Build pipeline |
54 | 53 |
|
55 | 54 | * The primary build pipeline is `make`
|
56 | 55 |
|
57 |
| -# Architecture |
| 56 | +## Architecture |
58 | 57 |
|
| 58 | +* Strive to make backends platform-portable |
| 59 | + * If that is not possible, try to keep the backend configuration compatible to other backends implementing the same protocol |
59 | 60 | * If there is significant potential for sharing functionality between backends, consider implementing it in `libmmbackend`
|
| 61 | +* Place a premium on keeping the MIDIMonster a lightweight tool in terms of installed dependencies and core functionality |
| 62 | + * If possible, prefer a local implementation to one which requires additional (dynamic) dependencies |
60 | 63 |
|
61 |
| -# Debugging |
| 64 | +## Language & Communication |
62 | 65 |
|
| 66 | +* All visible communication (ie. error messages, debug messages) should be complete, correct english sentences |
| 67 | +* Strive for each output to have a concrete benefit or information to the reader |
| 68 | + * Corollary: If nothing happens, don't send output |
| 69 | + * Debug messages are somewhat exempt from this guideline |
| 70 | +* For error messages, give enough context to reasonably allow the user to either track down the problem or report a meaningful issue |
| 71 | + |
| 72 | +# Packaging |
| 73 | + |
| 74 | +Packaging the MIDIMonster for release in distributions is an important task. It facilitates easy access to |
| 75 | +the MIDIMonster functionality to a wide audience. This section is not strictly relevant for development, but touches |
| 76 | +on some of the same principles. |
| 77 | + |
| 78 | +As the MIDIMonster is a tool designed for interfacing between several different protocols, applications and |
| 79 | +other tools, to use "all" functionality of the MIDIMonster would imply installing additional software the user |
| 80 | +might not actually need. This runs counter to our goal of staying a lightweight tool for translation and control. |
| 81 | + |
| 82 | +The recommended way to package the MIDIMonster for binary distribution would be to split the build artifacts into |
| 83 | +multiple packages, separating out the heavier dependencies into separately installable units. If that is not an option, |
| 84 | +marking external dependencies of backends as `optional` or `recommended` should be preferred to having them required |
| 85 | +to be installed. |
| 86 | + |
| 87 | +Some backends have been marked optional in the repository and are only built when using `make full`. |
| 88 | + |
| 89 | +The recommended grouping into packaging units is as follows (without regard to platform compatibility, which |
| 90 | +may further impact the grouping): |
| 91 | + |
| 92 | +* Package `midimonster`: Core, Backends `evdev`, `artnet`, `osc`, `loopback`, `sacn`, `maweb`, `openpixelcontrol`, `rtpmidi`, `visca`, `mqtt` |
| 93 | + * External dependencies: `libevdev`, `openssl` |
| 94 | +* Package `midimonster-programming`: Backends `lua`, `python` |
| 95 | + * External dependencies: `liblua`, `python3` |
| 96 | +* Package `midimonster-media`: `midi`, `jack`, `ola` |
| 97 | + * External dependencies: `libasound2`, `libjack-jackd2`, `libola` |
0 commit comments