Program for mapping midi signals to shell commands
Find a file
2019-07-22 16:25:47 +02:00
include Better handling of bad file format 2019-07-22 16:20:06 +02:00
src Better handling of bad file format 2019-07-22 16:20:06 +02:00
example.mim Added comment support 2019-07-03 19:50:30 +02:00
LICENSE Initial commit 2019-06-15 21:02:57 +02:00
Makefile Changed install method 2019-07-22 16:25:47 +02:00
README Changed todo list to known issues 2019-07-08 06:44:47 +02:00

Maps midi signals coming from ALSA midi devices to shell commands

Build: `$ make && sudo make install`

usage: midiMap <config file>
This is a daemon program, it does not start any background process by itself and needs to be constantly running for the mapping to be active

This program is in early stage but is fully functional without any major errors

Known issues:
- Doesn't support multiple identical devices
- Error reporting on wrong config is sub-par


See 'example.mim' for an example config file

To scan for devices use `$ aseqdump -l`
To scan a device's inputs use `$ aseqdump -p <client name>`

-- [COMMAND FORMAT] --

Format is regular shell format

-- Environment

[Note]
$id: id of the note
$channel: channel of the note
$velocity: velocity of the note

[Controller]
$value: value of the controller (remapped)
$id: id of the controller
$channel: channel of the controller
$rawvalue: original value of the controller

[Pitch]
$value: value of the bend (remapped)
$rawvalue: original value of the bend

[System]
$code: hexadecimal code of the system signal


-- [FILE FORMAT] --

[<device>,<device>]

- <device> format:
{
  name=<name>
  commands=[<command>,<command>]
}
-
*name: string referring to client name of the device

--<command> format (global):
{
  <tag>=<value>
  <tag>=<value>
  ...
}


-- COMMAND TAGS

[Global tags]
  type=<note/controller/pitch/system/connect/disconnect>
  shell=<shell command>
--
*type: type of the signal: note/controller/pitch/system/connect/disconnect
  > mandatory
*shell: shell command to be executed
  > mandatory

[Note tags]
  id=<interval>
  channel=<x/*>
  trigger=<interval>
--
*id: note id from 0 to 127
  > optional, default 0:127
*channel: value from 0 to 16 for channel, * for any channel
  > optional, default *
*trigger: note velocity from 0 to 127 that triggers the command
  > optional, default 1:127

[Controller tags]
  id=<interval>
  channel=<x/*>
  range=<interval>
  remap=<interval>
  float=<true/false>
--
*id: controller id from 0 to 127
  > optional, default 0:127
*channel: value from 0 to 16 for channel, * for any channel
  > optional, default *
*range: controller value from 0 to 127 that triggers command
  > optional, default 0:127
*remap: remaps the range to given interval
  > optional, default same as range
*float: boolean value defining if output is a floating point value
  > optional, default false

[Pitch bend tags]
  range=<interval>
  remap=<interval>
  float=<true/false>
--
*range: controller value from -8192 to 8191 that triggers command
  > optional, default -8192:8191
*remap: remaps the range to given interval
  > optional, default same as range
*float: boolean value defining if output is a floating point value
  > optional, default false

--Interval Format
x:y   range from x to y
x     single value x
*     all possible values


Comments can be done with //
  note: // in value lines will not be ignored

A shell command can be written on multiple lines by containing it between '' right after =
  note: additional ' in the command need to be escaped with \