cbdevnet / midimonster Goto Github PK
View Code? Open in Web Editor NEWMulti-protocol control & translation software (ArtNet, MIDI, OSC, sACN, ...)
Home Page: https://midimonster.net/
License: BSD 2-Clause "Simplified" License
Multi-protocol control & translation software (ArtNet, MIDI, OSC, sACN, ...)
Home Page: https://midimonster.net/
License: BSD 2-Clause "Simplified" License
@cbdevnet What do you think about using Whiptail to query the variables from the user?
Have you considered adding an OLA backend:
https://github.com/OpenLightingProject/ola
We already support lots of other lighting protocols and it saves you having to reinvent the wheel. We've got a good API to allow integration:
http://docs.openlighting.org/ola/doc/latest/dmx_cpp_client_tutorial.html
Implement an argument to force updating midimonster.
Implement self update.
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.
0
is noted in the backend documentation as a valid universe specification, but https://github.com/cbdevnet/midimonster/blob/master/backends/sacn.c#L576 checks whether the universe is non-zero.
% 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.
Alternatively, unload unused backends in backend_start
@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.
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?
The UPDATER_SAVE function does save the updater, but the symlink does not work and the name is wrong(/usr/bin/midimonster-updater\n).
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??
So these would be available in the MIDIMonster packages for the user to use or copy.
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.
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.
Not currently a problem, but should be addressed to prevent problems when third-party backends are implemented requiring that functionality
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'
...
In particular -v
(version), -b
(backend option override) and -i
(instance option override)
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 cyclesjack
backend: Jack ports are either input or output channels, but not bothevdev
: Axes need to be configured before being allowed to be output. This change would allow configurations to fail at mapping time instead of at runtimeosc
: See evdev
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
The code at https://github.com/cbdevnet/midimonster/blob/master/backend.c#L212 erroneously computes the minimum polling interval.
The Make Install target is overwriting the default config file from previous installations.
Fix is on the way.
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??
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.
Our readmes structure is not 100% logical.
I'll revise it.
@cbdevnet can you make a port of midimonster for ARM?
This mostly concerns the network-based backends, which currently all implement their own functions for, among others
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.
@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?
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.
Would it be possible that this could support Streaming ACN - E1.31?
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 :)
For triggering/responding to keyboard & mouse input
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
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^
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.
Packages will want to be able to install at least a basic manpage for users to refer to.
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
@cbdevnet If you add a UI backend to configure IP addresses and stuff it would make some of my projects easier.
Allow partial configuration override / addendum via command line parameters.
Example syntax:
-b osc.detect=on
-i midi1.name=foobar
How to install the debian package (Add to README)
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
dlopen
/dlsym
/dlclose
) library loading and directory traversal
LoadLibrary
et al.WSAStartup
needs to be called before using the Berkeley sockets APImakefile
is currently GNUmake
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 :)
Can anyone add a Backend that uses the Webremote from the Dot2?
The evdev
backend has recently been outfitted with improved relative axis handling for input devices, the output portion however still uses the old simplistic logic.
Cf. https://github.com/cbdevnet/midimonster/blob/master/backends/evdev.c#L474
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.
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.
This has implications for the plugin directory and possibly the default configuration name
CLOCK_MONOTONIC_COARSE
being used results in a failure on OSX, conditionally replace with CLOCK_MONOTONIC_RAW
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:
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.