Giter Site home page Giter Site logo

cbdevnet / midimonster Goto Github PK

View Code? Open in Web Editor NEW
467.0 31.0 47.0 1.08 MB

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

Home Page: https://midimonster.net/

License: BSD 2-Clause "Simplified" License

C 90.33% C++ 1.40% Makefile 1.81% Shell 3.78% Lua 1.95% Roff 0.23% Python 0.04% Groovy 0.45%
midi artnet art-net protocol-adapter osc lighting music sacn midi-controller dmx512

midimonster's People

Contributors

cbdevnet avatar cbix avatar jduepmeier avatar peternewman avatar scheidleon avatar spacelord09 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

midimonster's Issues

Building question

Hey, could you go into a little more detail on how to compile and run this on Windows? - bit of a noob here :) don't really know what im doing but would really love to use this tool. thanks.

Cannot configure unknown backend ...

% midimonster /usr/share/midimonster/osc-artnet.cfg
Cannot configure unknown backend artnet
Failed to read configuration file /usr/share/midimonster/osc-artnet.cfg
MIDIMonster v0.2
Usage:
	midimonster <configfile>
% midimonster /usr/share/midimonster/midi-mouse.cfg
Cannot configure unknown backend midi
Failed to read configuration file /usr/share/midimonster/midi-mouse.cfg
MIDIMonster v0.2
Usage:
	midimonster <configfile>

Files the package provides;

midimonster-git /usr/
midimonster-git /usr/bin/
midimonster-git /usr/bin/midimonster
midimonster-git /usr/lib/
midimonster-git /usr/lib/midimonster/
midimonster-git /usr/lib/midimonster/artnet.so
midimonster-git /usr/lib/midimonster/evdev.so
midimonster-git /usr/lib/midimonster/jack.so
midimonster-git /usr/lib/midimonster/loopback.so
midimonster-git /usr/lib/midimonster/lua.so
midimonster-git /usr/lib/midimonster/maweb.so
midimonster-git /usr/lib/midimonster/midi.so
midimonster-git /usr/lib/midimonster/osc.so
midimonster-git /usr/lib/midimonster/sacn.so
midimonster-git /usr/share/
midimonster-git /usr/share/midimonster/
midimonster-git /usr/share/midimonster/demo.lua
midimonster-git /usr/share/midimonster/evdev.cfg
midimonster-git /usr/share/midimonster/flying-faders.cfg
midimonster-git /usr/share/midimonster/flying-faders.lua
midimonster-git /usr/share/midimonster/launchctl-sacn.cfg
midimonster-git /usr/share/midimonster/lua.cfg
midimonster-git /usr/share/midimonster/maweb-flying-faders.cfg
midimonster-git /usr/share/midimonster/midi-mouse.cfg
midimonster-git /usr/share/midimonster/midi-osc.cfg
midimonster-git /usr/share/midimonster/osc-artnet.cfg
midimonster-git /usr/share/midimonster/osc-kbd.cfg
midimonster-git /usr/share/midimonster/osc-xy.cfg
midimonster-git /usr/share/midimonster/unifest-17.cfg

And the PKGBUILD that creates the package.

Backend for Testing

@cbdevnet can you add a Backend for testing? that makes "testing" a bit easyer.

The Backend should do a loop from 1 to 127 or from 1 to 255 up and down.. in a specific time.

sysex

Is there sysex support in this app? I didn't find any mentions.
Is it possible to parse osc commands, based on the script logic, before generating midi commands?

OSC Bundle format

Hi.
I try to receive osc signal from Lemur, convert with midimonster and send sacn signal to Win machine.

Lemur osc controller - ip : 2.1.1.5, osc sender
Linux machine - ip : 2.1.1.4, osc listener
Win machine - ip : 2.1.1.2, sacn receiver

In Lemur source, when a button is pushed, I sent osc signal like this.
if (button == 1) oscout(0,'/x',1); //0 is 2.1.1.4 port 8000 osc

In linux midimonster, I convert it to sacn signal and send it to Win machine.
[backend sacn]
bind = 2.1.1.4

[sacn sacn_out]
universe = 9
priority = 100
destination = 2.1.1.2

[backend osc]
detect = on

[osc osc_in]
bind = 2.1.1.4 8000
root = /
/x = f 0.0 1.0 // should I have to make "x" directory in / ??

[map]
osc_in./x:1 > sacn_out.1

I don't have any sacn signal.
Could you help me what's wrong with me??

Is it possible to send midi note in lua function

I just understand how to use lua with midimonster.
I mean how to connect channels.
But is it possible to send midi note in lua function.

apcmini.ch1.note1 > lua.sendnote1

In function of sendnote1, I want to send specific midi note.

Additional event/channel data types (relative, timecode, strings, etc)

Some backends, notably the evdev and maweb backends have controls that output relative values instead of absolute values.

For the evdev backend, these are currently mapped into absolute values using a configuration-provided range value.

There might be value in introducing relative channels as another type of channel, which can be mapped from other relative channels and deltas of absolute channels. Mappings from relative channels to absolute channels would need to either be specified with a range or just be disallowed.

Failed to load plugin /usr/lib/midimonster/lua.so: ... undefined symbol: lua_gettop

Currently I get a failure when trying to run midimonster;

% midimonster /usr/share/midimonster/evdev.cfg
Failed to load plugin /usr/lib/midimonster/lua.so: /usr/lib/midimonster/lua.so: undefined symbol: lua_gettop
Cannot configure unknown backend artnet
Failed to read configuration file /usr/share/midimonster/evdev.cfg
MIDIMonster v0.1
Usage:
	midimonster <configfile>
% ll /usr/lib/midimonster/lua.so
-rwxr-xr-x 1 root root 18K Dec  3 16:08 /usr/lib/midimonster/lua.so

Arch Linux, being rolling release, currently has lua 5.3.5-2, though I also have lua51 and lua52 installed.

From the build output if it helps;

...
make[1]: Entering directory '/home/milk/state/pkgs/in_progress/midimonster-git/src/midimonster/backends'
rm -f libmmbackend.o artnet.so osc.so loopback.so sacn.so lua.so maweb.so jack.so midi.so evdev.so ola.so artnet.dll osc.dll loopback.dll sacn.dll maweb.dll winmidi.dll
make[1]: Leaving directory '/home/milk/state/pkgs/in_progress/midimonster-git/src/midimonster/backends'
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -DPLUGINS=\"/usr/lib/midimonster\" -D_FORTIFY_SOURCE=2  -c -o config.o config.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -DPLUGINS=\"/usr/lib/midimonster\" -D_FORTIFY_SOURCE=2  -c -o backend.o backend.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -DPLUGINS=\"/usr/lib/midimonster\" -D_FORTIFY_SOURCE=2  -c -o plugin.o plugin.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -DPLUGINS=\"/usr/lib/midimonster\" -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-export-dynamic midimonster.c config.o backend.o plugin.o -ldl -o midimonster
make -C backends
make[1]: Entering directory '/home/milk/state/pkgs/in_progress/midimonster-git/src/midimonster/backends'
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic -D_FORTIFY_SOURCE=2 -g -fPIC -I../  -c -o libmmbackend.o libmmbackend.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic  artnet.c libmmbackend.o -o artnet.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic  osc.c libmmbackend.o -o osc.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic  loopback.c  -o loopback.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic  sacn.c libmmbackend.o -o sacn.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
Package lua5.3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'lua5.3', required by 'virtual:world', not found
Package lua5.3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'lua5.3', required by 'virtual:world', not found
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic   lua.c  -o lua.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
Package lua5.3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'lua5.3', required by 'virtual:world', not found
lua.c:55:17: warning: ‘lua_interval’ defined but not used [-Wunused-function]
   55 | static uint32_t lua_interval(){
      |                 ^~~~~~~~~~~~
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic -lssl maweb.c libmmbackend.o -o maweb.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
maweb.c: In function ‘maweb_handle’:
maweb.c:803:3: warning: ‘bytes_handled’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  803 |   memmove(data->buffer, data->buffer + bytes_handled, (data->offset + bytes_read) - bytes_handled);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
maweb.c:754:67: note: ‘bytes_handled’ was declared here
  754 |  ssize_t bytes_read, bytes_left = data->allocated - data->offset, bytes_handled;
      |                                                                   ^~~~~~~~~~~~~
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic -ljack -lpthread jack.c  -o jack.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic -lasound midi.c  -o midi.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fvisibility=hidden -g -fPIC -I../ -Wall -Wpedantic -I/usr/include/libevdev-1.0/  -levdev  evdev.c  -o evdev.so -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared
evdev.c: In function ‘evdev_find’:
evdev.c:158:4: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  158 |    strncpy(result, file_path, strlen(file_path));
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: Leaving directory '/home/milk/state/pkgs/in_progress/midimonster-git/src/midimonster/backends'
...

Communicate mapping direction when resolving channels

Some backends may have optimizations or restrictions based on the direction a backend channel is being mapped (ie. either as input, output or both). This would take the addition of a parameter to the backend_channel function, requiring a backend API version bump.

Backends that would profit from this:

  • maweb: Channels mapped only as input do not need to be fetched from the console, saving on fetch/parse cycles
  • The upcoming jack backend: Jack ports are either input or output channels, but not both
  • evdev: Axes need to be configured before being allowed to be output. This change would allow configurations to fail at mapping time instead of at runtime
  • osc: See evdev

Maximum amount of universe or parameters

I am using MidiMonster 3.0 on Windows 10 64 bit. I am wondering what is the maximum amount of parameters or universe MidiMonster can handle. I'm trying ton convert 36 SACN Universe to 36 Artnet universes send to individual lighting fixtures. Best I could do is 7 Universes whitout MidiMonster crashing. I'v attached my current working config.
Thank you
monster.pdf

Sending midi velocity

To turn on red leds of apc mini, I have to send back midi note with velocity 3.
Defaulty, they looks like sending 0(off) and 1(green on).
I read that to access midi data, I need to access ALSA Sequencer.
Any demo source or example that I can get??

Wildcard matching in OSC path configuration?

Hello,

I found myself today needing to output a lot of similar osc paths.

Basically:

/channel/1/red = f 0.0 1.0
/channel/1/green = f 0.0 1.0
/channel/1/blue = f 0.0 1.0
/channel/2/red = f 0.0 1.0
/channel/2/green = f 0.0 1.0
etc

It would be great if there was a way of doing something like

/channel/*/red = f 0.0 1.0

or even better
/channel/*/[red,green,blue] = f 0.0 1.0

But I'm not sure of a good way to do that that does not interfere with those characters being part of the path--or even if that format is the right way to do things. I'd like to look at implementing something like this, but wanted to get some thoughts first.

Factor out common backend functions into library

This mostly concerns the network-based backends, which currently all implement their own functions for, among others

  • Binding listeners
  • Parsing bind/connect specifications
  • Creating other sockets

With the move of backend implementations to their own directory, factoring out that common code becomes the better option.

This would also aid porting to platforms which handle sockets slightly different, such as Windows.

[sACN] Failed to output universe discovery frame for interface 0: no error

@cbdevnet thank you for this awesome project 🔥

I configure midimonster to convert winMidi to sACN similar to the documentation and it work with network connection on windows machine. But when I try it offline i got the following error message:

[sACN] Failed to output universe discovery frame for interface 0: no error

Is there a possible workaround thats works offline?

FD changes at runtime are not carried into the select loop

As the fd_set used for select()ing in the core loop is only generated once (before the loop) and is then reused across loop iterations, changes made to the set of managed FDs at runtime are not reflected. Either document or fix this.

Support for sACN

Would it be possible that this could support Streaming ACN - E1.31?

[windows] select failed: Result too large

When running midimonster v0.3 on Windows 10, the following output is produced;

C:\Users\root\Dropbox\Apps\midimonster-v0.3-windows>midimonster.exe
Registered backend maweb
select failed: Result too large
maweb   Backend shut down

Happens regardless of backend and configuration.
I have a couple loopback interfaces already, but otherwise it's a pretty vanilla install.

I'm not a windows guy, so let me know what other info I can supply :)

evdev backend

For triggering/responding to keyboard & mouse input

Wishlist: Modal or shift capability (Future feature - layers)

I hope i didnt miss it already, but the one thing that would really make this project completely indispensable to me (ok so it already is...) would be the capability for inputs to trigger a modal capability - or act as a temporary or permanent "shift". For example

  • further (select) inputs are redirected to a different device
  • further (select) inputs are given different channel or notes

The shift could be momentary (while input "on" or key pressed) or variable (expression pedal divided into ranges) or multilevel (press for shift 1, press again for shift 2 etc.)

Multiple different shifts should be possible with different config of levels, permanence, and all mappings should be either as normal or dependant on a particular named shift and level.

Just some random thoughts what it might look like in the config:

[shift myshiftone]
levels 1
mode momentary

[shift myshifttwo]
levels 3 ; implies mode static

midikeys.ch2.cc1 -> myshiftone
midikeys.ch2.cc2 -> myshifttwo.next
midikeys.ch2.cc3 -> myshifttwo.next
midikeys.ch2.cc4 -> myshifttwo.1
midikeys.ch2.cc5 -> myshifttwo.2
midikeys.ch2.cc6 -> myshifttwo.3

midikeys.ch0.note66 <> daw./key1 ^myshiftone=0^
midikeys.ch0.note66 <> daw./key4 ^myshiftone=1^
midikeys.ch0.note66 <> daw./key6 ^myshifttwo=2^

MIDI backend: Mackie mode support

The Mackie HUI protocol allows fine-grained parameter control (well, finer than MIDI's 127 steps) by "misusing" most of MIDIs channel parameters.

Multiple hardware controllers (as well as a lot of A/V software) speak this protocol, so it's become kind of a de-facto standard.

An unofficial documentation is available.

This should probably done within the realm of the MIDI backend, by allowing an instance to be switched to a Mackie emulation mode.

Create basic manpage

Packages will want to be able to install at least a basic manpage for users to refer to.

MAweb Output

Hello,

I am trying to use midimonster to control Dot2 with an Akai APC20.

Translating Midi commands to Dot2 works mostly fine with a few lua functions (The device transmits NoteOff messages with a velocity of 127, so executors are only turned on, not off).

Right now i am trying to get feedback of Executor status (On/Off), but it seems i can't get a output from the MAweb backend.
This is my test configuration:

[maweb ma]
host = 192.168.48.38
user = remote
password = 

[backend midi]
name = MIDIMonster

[midi apc20]
read = 20:0
write = 20:0

[lua calc]
script = apc20-calc.lua

[map]
ma.page1.button201 > calc.echotest

Lua File:

function echotest(value)
    print(value)
end

If I try this configuration with fader1 instead of executor201 i occasionally get an output of the fader position, but this is also not reliable. Executor201 doesn't output anything.

Greetings from Germany,
Leon

OS portability

There have been inquiries about building and running the MIDIMonster on Windows and other platforms.
In theory, most of the core should be platform-independent, with the following obvious problems:

  • getline is used in the configuration parser and is a GNU extension, so it is not supported by all platforms
    • This can be reimplemented on platforms where it is missing
  • Some backends require platform-specific APIs
    • Where possible, this should be arbitrated within the backend, though platform-specific backends will probably required for some protocols due to API differences
  • Backend plugin loading is currently POSIX (dlopen/dlsym/dlclose) library loading and directory traversal
    • At least for Windows, this will have to be replaced with LoadLibrary et al.
  • For Windows, WSAStartup needs to be called before using the Berkeley sockets API
  • The makefile is currently GNUmake
    • Probably the best course of action for now is introducing platform-specific makefiles, with the suffix denoting the system. This would also allow us to build some backends only on some platforms.

As I myself have only a limited number of platforms available (Mostly Debian and Windows), I welcome patches and reports from everyone who wants to ensure the MIDIMonster builds and works on his/her preferred platform :)

Project rename

Some users have remarked that the name MIDIMonster is not really indicative of the scope of the project anymore.

What began as a simple MIDI-to-MIDI conversion tool evolved into a full-fledged multi-protocol programmable translation engine.

This issue will be used to track possible new names for the project.

So far, my favorite up until now would be

  • protomonster

But I'm very open to suggestions.

JACK MIDI/OSC/CV backend

Both JACK and LV2 format have CV signal mechanisms that allow for finer automation than MIDI can support.

carla-git recently introduced internal CV ports, added a CV search filter in the plugin dialog, and will in future expose parameters as CV ports, and zrythm-git has just received CV functionality.

CV support in MIDIMonster would be very handy.

Makefile install target

This has implications for the plugin directory and possibly the default configuration name

OSX Build broken

CLOCK_MONOTONIC_COARSE being used results in a failure on OSX, conditionally replace with CLOCK_MONOTONIC_RAW

Local sACN Input does not work on Windows

Using the config

[backend sacn]
bind = 0.0.0.0

[backend winmidi]

[sacn in]
universe = 1

[winmidi out]
write = LoopBe Internal MIDI

[map]
in.{1..100} >  out.ch0.note.{1..100}

no output is generated on the MIDI device.

The problem is probably the sACN Input as i tested:

  • MIDI Notes -> sACN Output - works
  • sACN Input -> sACN Output - doesn't work, only 0x00 values transmitted
  • sACN Input -> MIDI Notes - doesn't work, no notes sent

I didn't have a look at the code yet, so I don't know what the reason might be. I am using a freshly compiled version from master. sACN was transmitted (locally) from sACN Viewer or GrandMA2, both do not work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.