Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cbdevnet/midimonster
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2
Choose a base ref
...
head repository: cbdevnet/midimonster
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 13,257 additions and 3,097 deletions.
  1. +6 −0 .gitignore
  2. +0 −84 .travis-ci.sh
  3. +0 −201 .travis.yml
  4. +97 −0 DEVELOPMENT.md
  5. +49 −17 Makefile
  6. +157 −59 README.md
  7. +0 −15 TODO
  8. +1 −0 assets/MIDIMonster.svg
  9. +64 −0 assets/TODO
  10. +73 −0 assets/ci-config
  11. +342 −0 assets/ci.sh
  12. +42 −0 assets/midimonster.1
  13. BIN assets/midimonster.ico
  14. +22 −0 assets/midimonster.rc
  15. +0 −286 backend.c
  16. +71 −15 backends/Makefile
  17. +332 −157 backends/artnet.c
  18. +69 −9 backends/artnet.h
  19. +22 −6 backends/artnet.md
  20. +76 −94 backends/evdev.c
  21. +4 −4 backends/evdev.h
  22. +1 −2 backends/evdev.md
  23. +238 −137 backends/jack.c
  24. +22 −8 backends/jack.h
  25. +17 −2 backends/jack.md
  26. +114 −15 backends/libmmbackend.c
  27. +35 −4 backends/libmmbackend.h
  28. +17 −29 backends/loopback.c
  29. +4 −4 backends/loopback.h
  30. +357 −121 backends/lua.c
  31. +23 −8 backends/lua.h
  32. +75 −20 backends/lua.md
  33. +235 −136 backends/maweb.c
  34. +11 −6 backends/maweb.h
  35. +8 −7 backends/maweb.md
  36. +269 −161 backends/midi.c
  37. +16 −6 backends/midi.h
  38. +21 −11 backends/midi.md
  39. +1,005 −0 backends/mqtt.c
  40. +87 −0 backends/mqtt.h
  41. +85 −0 backends/mqtt.md
  42. +28 −54 backends/ola.cpp
  43. +4 −4 backends/ola.h
  44. +686 −0 backends/openpixelcontrol.c
  45. +59 −0 backends/openpixelcontrol.h
  46. +55 −0 backends/openpixelcontrol.md
  47. +146 −129 backends/osc.c
  48. +4 −4 backends/osc.h
  49. +2 −2 backends/osc.md
  50. +801 −0 backends/python.c
  51. +49 −0 backends/python.h
  52. +113 −0 backends/python.md
  53. +1,942 −0 backends/rtpmidi.c
  54. +195 −0 backends/rtpmidi.h
  55. +112 −0 backends/rtpmidi.md
  56. +247 −134 backends/sacn.c
  57. +20 −8 backends/sacn.h
  58. +11 −4 backends/sacn.md
  59. +474 −0 backends/visca.c
  60. +94 −0 backends/visca.h
  61. +70 −0 backends/visca.md
  62. +766 −0 backends/wininput.c
  63. +54 −0 backends/wininput.h
  64. +135 −0 backends/wininput.md
  65. +268 −189 backends/winmidi.c
  66. +25 −11 backends/winmidi.h
  67. +21 −6 backends/winmidi.md
  68. +0 −499 config.c
  69. +0 −1 config.h
  70. +75 −0 configs/i3msg.lua
  71. +51 −0 configs/latch.lua
  72. +3 −1 configs/launchctl-sacn.cfg
  73. +24 −0 configs/layering.cfg
  74. +16 −0 configs/layering.lua
  75. +25 −0 configs/midi-gamepad.cfg
  76. +1 −1 configs/osc-artnet.cfg
  77. +5 −0 configs/print.lua
  78. +8 −0 configs/pyexample.py
  79. +24 −0 configs/returnbool.lua
  80. +23 −0 configs/returnjustone.lua
  81. +24 −0 configs/returnone.lua
  82. +22 −0 configs/rtpmidi.cfg
  83. +22 −0 configs/scripting-example.cfg
  84. +59 −0 configs/trackpad.lua
  85. +34 −0 configs/visca.cfg
  86. +416 −0 core/backend.c
  87. +6 −4 { → core}/backend.h
  88. +711 −0 core/config.c
  89. +57 −0 core/config.h
  90. +270 −0 core/core.c
  91. +43 −0 core/core.h
  92. +29 −19 { → core}/plugin.c
  93. +2 −0 { → core}/plugin.h
  94. +202 −0 core/routing.c
  95. +9 −0 core/routing.h
  96. +297 −0 installer.sh
  97. +90 −321 midimonster.c
  98. +81 −82 midimonster.h
  99. +174 −0 midimonster_gui.c
  100. +6 −0 portability.h
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
midimonster
midimonster.exe
libmmapi.a
*.tgz
*.zip
*.swp
*.o
*.so
*.dll
__pycache__
.vscode/
deployment/
local-configs/
84 changes: 0 additions & 84 deletions .travis-ci.sh

This file was deleted.

201 changes: 0 additions & 201 deletions .travis.yml

This file was deleted.

97 changes: 97 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# MIDIMonster development guide

This document serves as a reference for contributors interested in the low-level implementation
of the MIDIMonster. It will be extended as problems come up and need solving ;)

## Basics

All rules are meant as guidelines. There may be situations where they need to be applied
in spirit rather than by the letter.

### Architectural guidelines

* Change in functionality or behaviour requires a change in documentation.
* There is more honor in deleting code than there is in adding code.
* Corollary: Code is a liability, not an asset.
* But: Benchmark the naive implementation before optimizing prematurely.
* The `master` branch must build successfully. Test breaking changes in a branch.
* Commit messages should be in the imperative voice ("When applied, this commit will: ").
* The working language for this repository is english.
* External dependencies are only acceptable when necessary and available from package repositories.
* Note that external dependencies make OS portability complicated

### Code style

* Tabs for indentations, spaces for word separation
* Lines may not end in spaces or tabs
* There should be no two consecutive spaces (or spaces intermixed with tabs)
* There should be no two consecutive newlines
* All symbol names in `snake_case` except where mandated by external interfaces
* When possible, prefix symbol names with their "namespace" (ie. the relevant section or module name)
* Variables should be appropriately named for what they do
* The name length should be (positively) correlated with usage
* Loop counters may be one-character letters
* Prefer to name unsigned loop counters `u` and signed ones `i`
* Place comments above the section they are commenting on
* Use inline comments sparingly
* Do not omit '{}' brackets, even if optional (e.g. single-statement conditional bodies)
* Opening braces stay on the same line as the condition

#### C specific

* Prefer lazy designated initializers to `memset()`
* Avoid `atoi()`/`itoa()`, use `strto[u]l[l]()` and `snprintf()`
* Avoid unsafe functions without explicit bounds parameters (eg. `strcat()`).

## Repository layout

* Keep the root directory as clean as possible
* Files that are not related directly to the MIDIMonster implementation go into the `assets/` directory
* Prefer vendor-neutral names for configuration files where necessary

## Build pipeline

* The primary build pipeline is `make`

## Architecture

* Strive to make backends platform-portable
* If that is not possible, try to keep the backend configuration compatible to other backends implementing the same protocol
* If there is significant potential for sharing functionality between backends, consider implementing it in `libmmbackend`
* Place a premium on keeping the MIDIMonster a lightweight tool in terms of installed dependencies and core functionality
* If possible, prefer a local implementation to one which requires additional (dynamic) dependencies

## Language & Communication

* All visible communication (ie. error messages, debug messages) should be complete, correct english sentences
* Strive for each output to have a concrete benefit or information to the reader
* Corollary: If nothing happens, don't send output
* Debug messages are somewhat exempt from this guideline
* For error messages, give enough context to reasonably allow the user to either track down the problem or report a meaningful issue

# Packaging

Packaging the MIDIMonster for release in distributions is an important task. It facilitates easy access to
the MIDIMonster functionality to a wide audience. This section is not strictly relevant for development, but touches
on some of the same principles.

As the MIDIMonster is a tool designed for interfacing between several different protocols, applications and
other tools, to use "all" functionality of the MIDIMonster would imply installing additional software the user
might not actually need. This runs counter to our goal of staying a lightweight tool for translation and control.

The recommended way to package the MIDIMonster for binary distribution would be to split the build artifacts into
multiple packages, separating out the heavier dependencies into separately installable units. If that is not an option,
marking external dependencies of backends as `optional` or `recommended` should be preferred to having them required
to be installed.

Some backends have been marked optional in the repository and are only built when using `make full`.

The recommended grouping into packaging units is as follows (without regard to platform compatibility, which
may further impact the grouping):

* Package `midimonster`: Core, Backends `evdev`, `artnet`, `osc`, `loopback`, `sacn`, `maweb`, `openpixelcontrol`, `rtpmidi`, `visca`, `mqtt`
* External dependencies: `libevdev`, `openssl`
* Package `midimonster-programming`: Backends `lua`, `python`
* External dependencies: `liblua`, `python3`
* Package `midimonster-media`: `midi`, `jack`, `ola`
* External dependencies: `libasound2`, `libjack-jackd2`, `libola`
Loading