• Stars
    star
    495
  • Rank 88,974 (Top 2 %)
  • Language
    C
  • License
    BSD 2-Clause "Sim...
  • Created over 7 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Multi-protocol control & translation software (ArtNet, MIDI, OSC, sACN, ...)

The MIDIMonster

MIDIMonster Logo

Coverity Scan Build Status CI Pipeline Status IRC Channel

Named for its scary math, the MIDIMonster is a universal control and translation tool for multi-channel absolute-value-based control and/or bus protocols.

Currently, the MIDIMonster supports the following protocols:

Protocol / Interface Operating Systems Notes Backends
MIDI Linux, Windows, OSX Linux: via ALSA/JACK, OSX: via JACK midi, winmidi, jack
ArtNet Linux, Windows, OSX Version 4 artnet
Streaming ACN (sACN / E1.31) Linux, Windows, OSX sacn
OpenSoundControl (OSC) Linux, Windows, OSX osc
MQTT Linux, Windows, OSX Protocol versions 5 and 3.1.1 mqtt
RTP-MIDI Linux, Windows, OSX AppleMIDI sessions supported rtpmidi
OpenPixelControl Linux, Windows, OSX 8 Bit & 16 Bit modes openpixelcontrol
Input devices (Mouse, Keyboard, etc) Linux, Windows evdev, wininput
Open Lighting Architecture Linux, OSX ola
MA Lighting Web Remote Linux, Windows, OSX GrandMA2 and dot2 (incl. OnPC) maweb
JACK/LV2 Control Voltage (CV) Linux, OSX jack
VISCA Linux, Windows, OSX PTZ Camera control over TCP/UDP visca
Lua Scripting Linux, Windows, OSX lua
Python Scripting Linux, OSX python
Loopback Linux, Windows, OSX loopback

With these features, the MIDIMonster allows users to control any channel on any of these protocols, and translate any channel on one protocol into channel(s) on any other (or the same) supported protocol, for example to:

If you encounter a bug or suspect a problem with a protocol implementation, please open an Issue or get in touch with us via IRC on Hackint in #midimonster. We are happy to hear from you!

Table of Contents

Usage

The MIDImonster takes as it's first argument the name of an optional configuration file to use (monster.cfg is used as default if none is specified). The configuration file syntax is explained in the next section.

The current MIDIMonster version can be queried by passing -v as command-line argument.

Configuration

Each protocol supported by MIDIMonster is implemented by a backend, which takes global protocol-specific options and provides instances, which can be configured further.

The configuration is stored in a file with a format very similar to the common INI file format. A section is started by a header in [] braces, followed by lines of the form option = value.

Lines starting with a semicolon are treated as comments and ignored. Inline comments are not currently supported.

Configuration files may be included recursively in other configuration files using the syntax [include <file>]. This will read the referenced configuration file as if it were inserted at that point.

Example configuration files may be found in configs/.

Backend and instance configuration

A configuration section may either be a backend configuration section, started by [backend <backend-name>], an instance configuration section, started by [<backend-name> <instance-name>] or a mapping section started by [map].

Backends document their global options in their backend documentation. Some backends may not require global configuration, in which case the configuration section for that particular backend can be omitted.

To make an instance available for mapping channels, it requires at least the [<backend-name> <instance-name>] configuration stanza. Most backends require additional configuration for their instances.

Backend and instance configuration options can also be overridden via command line arguments using the syntax -b <backend>.<option>=<value> for backend options and -i <instance>.<option>=<value> for instance options. These overrides are applied when the backend/instance is first mentioned in the configuration file.

Channel mapping

The [map] section consists of lines of channel-to-channel assignments, reading like

instance.channel-a < instance.channel-b
instance.channel-a > instance.channel-b
instance.channel-c <> instance.channel-d

The first line above maps any event originating from instance.channel-b to be output on instance.channel-a (right-to-left mapping).

The second line makes that mapping a bi-directional mapping, so both of those channels output eachothers events.

The last line is a shorter way to create a bi-directional mapping.

You can map input channels to as many outputs as you like. This will deliver incoming events for each mapped output. You can also map multiple input channels to one common output channel. This will forward all events on the mapped inputs to the output channel (experienced show-control technicians call this a "latest takes precedence" bus).

Multi-channel mapping

To make mapping large contiguous sets of channels easier, channel names may contain certain types of expressions specifying multiple channels at once.

Expressions of the form {<start>..<end>}, with start and end being positive integers, expand to a range of channels, with the expression replaced by the incrementing or decrementing value.

Expressions of the form {value1,value2,value3} (with any number of values separated by commas) are replaced with each of the specified values in sequence.

Multiple such expressions may be used in one channel specification, with the rightmost expression being evaluated first.

Both sides of a multi-channel assignment need to have the same number of channels, or one side must have exactly one channel.

Example multi-channel mapping:

instance-a.channel{1..5} > instance-b.{a,b,c,d,e}

Backend documentation

Every backend includes specific documentation, including the global and instance configuration options, channel specification syntax and any known problems or other special information. These documentation files are located in the backends/ directory.

Installation

This section will explain how to build and install the MIDIMonster. Development is mainly done on Linux, but builds for OSX and Windows are possible.

Binary builds for all supported systems are available for download on the Release page.

Using the installer

The easiest way to install MIDIMonster and its dependencies on a Linux system is the installer script.

The following commands download the installer, make it executable and finally, start it:

wget https://raw.githubusercontent.com/cbdevnet/midimonster/master/installer.sh ./
chmod +x ./installer.sh
./installer.sh

The installer can also be used for automating installations or upgrades by specifying additional command line arguments. To see a list of valid arguments, run the installer with the --help argument.

The installer script can also update MIDIMonster to the latest version automatically, using a configuration file generated during the installation. To do so, run midimonster-updater as root on your system after using the installer.

If you prefer to install a Debian package you can download the .deb file from our Release page. To install the package, run the following command as the root user:

dpkg -i <file>.deb

Building from source

To build the MIDIMonster directly from the sources, you'll need some libraries that provide support for the protocols to translate. When building from source, you can also choose to exclude backends (for example, if you don't need them or don't want to install their prerequisites).

  • libasound2-dev (for the ALSA MIDI backend)
  • libevdev-dev (for the evdev backend)
  • liblua5.3-dev (for the lua backend)
  • libola-dev (for the optional OLA backend)
  • libjack-jackd2-dev (for the JACK backend)
  • libssl-dev (for the MA Web Remote backend)
  • python3-dev (for the Python backend)
  • pkg-config (as some projects and systems like to spread their files around)
  • A C compiler
  • GNUmake

To build for Windows, the package mingw-w64 provides a cross-compiler that can be used to build a subset of the backends as well as the core.

Building for Linux/OSX

For Linux and OSX, just running make in the source directory should do the trick.

Some backends have been marked as optional as they require rather large additional software to be installed, for example the ola backend. To create a build including these, run make full.

To install a source build with make install, please familiarize yourself with the build parameters as specified in the next section.

Backends may also be built selectively by running make <backendfile> in the backends/ directory, for example

make jack.so

Building for Packaging

The build process accepts the following parameters, either from the environment or as arguments to the make invocation:

Target Parameter Default value Description
build targets DEFAULT_CFG monster.cfg Default configuration file
build targets PLUGINS Linux/OSX: ./backends/, Windows: backends\ Backend plugin library path
install PREFIX /usr Install prefix for binaries
install DESTDIR empty Destination directory for packaging builds
install DEFAULT_CFG empty Install path for default configuration file
install PLUGINS $(PREFIX)/lib/midimonster Install path for backend shared objects
install EXAMPLES $(PREFIX)/share/midimonster Install path for example configurations

Note that the same variables may have different default values depending on the target. This implies that builds that are destined to be installed require those variables to be set to the same value for the build and install targets.

For system-wide install or packaging builds, the following steps are recommended:

export PREFIX=/usr
export PLUGINS=$PREFIX/lib/midimonster
export DEFAULT_CFG=/etc/midimonster/midimonster.cfg
make clean
make full
make install

Depending on your configuration of DESTDIR, the make install step may require root privileges to install the binaries to the appropriate destinations.

To create Debian packages, use the debianization and git-buildpackage configuration on the debian/master branch. Simply running gbp buildpackage should build a package for the last tagged release.

Building for Windows

To build for Windows, you still need to compile on a Linux machine (virtual machines work well for this).

In a fresh Debian installation, you will need to install the following packages (using apt-get install as root):

  • build-essential
  • pkg-config
  • git
  • mingw-w64

Clone the repository and run make windows in the project directory. This will build midimonster.exe as well as a set of backends as DLL files, which you can then copy to the Windows machine.

Note that some backends have limitations when building on Windows (refer to the backend documentation for detailed information).

Development

The architecture is split into the core, handling mapping and resource management, the frontends which handle how the core is invoked and presented (ie. command line or graphical interface), and the backends, which are shared objects loaded at start time providing a protocol mapping to instances / channels.

There is a general developer information document that outlines basic guidelines for contribution. The MIDIMonster knowledge base has a section on development, containing additional helpful information and tutorials.

The backend API, lifecycle and structures are documented in midimonster.h, the frontend API and lifecycle in core/core.h.

To build with clang sanitizers and even more warnings enabled, run make sanitize. This is useful to check for common errors and oversights.

For runtime leak analysis with valgrind, you can use make run.

More Repositories

1

ipmagnet

Check which IP adresses your BitTorrent client is handing out to trackers
JavaScript
256
star
2

rtl2dot

C call graph generator
Python
52
star
3

adhosts

Minimal composite ad-blocking hosts file generator
Shell
49
star
4

websocksy

Highly configurable dynamic WebSocket bridge
C
34
star
5

pt1230

Brother P-Touch 1230PC Linux interface
C
32
star
6

fugit

_Really_ lightweight git access control
Shell
26
star
7

mima

MIninmal MAchine Assembler and Simulator
C
21
star
8

ledger-reports

Ledger reporting scripts
Shell
16
star
9

piechart

Create SVG pie charts from the command line
C
12
star
10

xecho

Render text messages to the screen with minimal dependencies
C
11
star
11

martrix

ArtNet and sACN grid/matrix visualizer and fixture
C
9
star
12

xelflut

Pretty fast server for multiplayer X11 canvas (pixelflut)
C
8
star
13

megadmx

Microcontroller ArtNet and DMX experiments (ATmega8/ATtiny13, ENC28J60)
Assembly
7
star
14

xlaser

X11 ArtNet scanner fixture
C
5
star
15

2t3

Ultimate TicTacToe (with JSON API) Web Implementation
JavaScript
4
star
16

akadns

Hacky dnsmasq API & Frontend
JavaScript
4
star
17

traccoon

Multi-threaded BitTorrent Tracker with SQLite backend
C
3
star
18

signet

Simplified GPG key signing
Shell
3
star
19

jamdisk

Toolchain for creating custom initial RAM filesystems
Shell
2
star
20

rplock

Simple screen locker for ratpoison
Shell
2
star
21

microcontroller-workshop

Assembly listings for a 1-week microcontroller workshop
Assembly
2
star
22

unfit

Periodically read and upload data from BLE bracelet (Miband 1S only currently)
Java
1
star
23

kbserver

Serve configurable strings triggered by input events
C
1
star
24

libsigrokdecode

Decoders for sigrok & pulseview
Python
1
star
25

taskboard

Simple web-based task/todo-list manager
JavaScript
1
star