summaryrefslogtreecommitdiff
path: root/audio/lsmi
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2013-06-03 16:24:41 -0500
committerRobby Workman <rworkman@slackbuilds.org>2013-06-04 00:11:32 -0500
commitbf4ab6962d0aa471d1906c66041b0f45f8e0391f (patch)
treef7ec7d93c1294fa446a8456628c02024e2184e21 /audio/lsmi
parent995fe8e3c439e833c80c41a8fd0ccbcb582d6db5 (diff)
downloadslackbuilds-bf4ab6962d0aa471d1906c66041b0f45f8e0391f.tar.gz
audio/lsmi: Added (map device input to ALSA MIDI sequencer events)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'audio/lsmi')
-rw-r--r--audio/lsmi/README16
-rw-r--r--audio/lsmi/lsmi.SlackBuild110
-rw-r--r--audio/lsmi/lsmi.info10
-rw-r--r--audio/lsmi/man/lsmi-joystick.183
-rw-r--r--audio/lsmi/man/lsmi-keyhack.190
-rw-r--r--audio/lsmi/man/lsmi-monterey.1172
-rw-r--r--audio/lsmi/man/lsmi-mouse.1100
-rw-r--r--audio/lsmi/rtprio.diff153
-rw-r--r--audio/lsmi/setcap.sh5
-rw-r--r--audio/lsmi/slack-desc19
10 files changed, 758 insertions, 0 deletions
diff --git a/audio/lsmi/README b/audio/lsmi/README
new file mode 100644
index 0000000000..21d8f4b6b0
--- /dev/null
+++ b/audio/lsmi/README
@@ -0,0 +1,16 @@
+lsmi (map keyboard/mouse/joystick input to ALSA MIDI sequencer events)
+
+These simple user-space drivers support using certain homemade,
+repurposed, or commercial devices as MIDI controllers on Linux, even
+though the devices themselves are not capable of generating MIDI messages;
+this does not include things like MIDI-over-serial or PIC based projects,
+which are true MIDI devices.
+
+Reasons for using this software include: achieving MIDI entry on machines
+without MIDI ports, reusing old hardware, pure frugality, and fun.
+
+This package uses POSIX filesystem capabilities to execute with
+elevated privileges (required for realtime audio processing). This
+may be considered a security/stability risk. Please read
+http://www.slackbuilds.org/caps/ for more information. To disable
+capabilities, pass SETCAP=no to the script.
diff --git a/audio/lsmi/lsmi.SlackBuild b/audio/lsmi/lsmi.SlackBuild
new file mode 100644
index 0000000000..9bd4a8ba15
--- /dev/null
+++ b/audio/lsmi/lsmi.SlackBuild
@@ -0,0 +1,110 @@
+#!/bin/bash
+
+# Slackware build script for lsmi
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://sam.zoy.org/wtfpl/ for details.
+
+PRGNAM=lsmi
+VERSION=${VERSION:-0.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG/usr/bin $OUTPUT
+cd $TMP
+rm -rf $PRGNAM
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# all this seddery could have been done with a diff, I just felt like
+# using sed today for some reason.
+
+# use our flags and install to our directory.
+sed -i \
+ -e "s/-g/$SLKCFLAGS/" \
+ -e "s,/usr/local/bin,$PKG/usr/bin," \
+ -e "s,install ,install -s -m0755 ," \
+ Makefile
+
+# fix typo in --help output
+sed -i 's/thrree/three/' lsmi-mouse.c
+
+# make keyhack's --help actually work
+sed -i 's/fprintf.*Help.*/usage();/' lsmi-keyhack.c
+
+# fix possible segfault
+sed -i 's/\(char *prog_buf\)\[4\]/\1[5]/' lsmi-keyhack.c
+
+# As shipped, only lsmi-monterey supports POSIX realtime scheduling. This
+# patch (by the SlackBuild author) adds the -R option to the other lsmi-*
+# binaries.
+patch -p1 < $CWD/rtprio.diff
+
+make
+make install
+
+# man pages came from the Musix project:
+# ftp://musix.ourproject.org/pub/musix/deb/lsmi_0.1-1_i386.deb
+# Modified a bit: fixed a typo, rewrote section
+# about realtime scheduling so it applies to Slackware.
+mkdir -p $PKG/usr/man/man1
+cd $CWD/man
+for i in *; do
+ gzip -9c < $i > $PKG/usr/man/man1/$i.gz
+done
+cd -
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+if [ "${SETCAP:-yes}" = "yes" ]; then
+ cat $CWD/setcap.sh >> $PKG/install/doinst.sh
+ for i in lsmi-joystick lsmi-keyhack lsmi-monterey lsmi-mouse; do
+ chown root:audio $PKG/usr/bin/$i
+ chmod 0750 $PKG/usr/bin/$i
+ done
+fi
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/audio/lsmi/lsmi.info b/audio/lsmi/lsmi.info
new file mode 100644
index 0000000000..8cfe4a9570
--- /dev/null
+++ b/audio/lsmi/lsmi.info
@@ -0,0 +1,10 @@
+PRGNAM="lsmi"
+VERSION="0.1"
+HOMEPAGE="http://lsmi-all.sourceforge.net/"
+DOWNLOAD="http://downloads.sourceforge.net/project/lsmi-all/lsmi-all/lsmi-0.1/lsmi-0.1.tar.gz"
+MD5SUM="42e988a854dfc36810193de6c5469f78"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/audio/lsmi/man/lsmi-joystick.1 b/audio/lsmi/man/lsmi-joystick.1
new file mode 100644
index 0000000000..72bb02ab80
--- /dev/null
+++ b/audio/lsmi/man/lsmi-joystick.1
@@ -0,0 +1,83 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH LSMI-JOYSTICK 1 "May 15, 2012"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+
+lsmi-joystick \- Linux Pseudo MIDI Input -- Joystick
+.SH SYNOPSIS
+.B lsmi-joystick
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+
+This driver allows any joystick supported by the Linux joydev interface to
+be used as a MIDI pitch/modulation controller. Of course, some joysticks are
+more suitable than others. I use an old analog flight stick. Holding down
+button 1 causes the vertical axis to send pitchbend messages, while button 2
+causes the vertical axis to send modulation messages. Holding down both
+buttons causes the vertical axis to send pitchbend messages and the
+horizontal axis to send modulation messages.
+
+.SH USAGE
+
+Distribution specific init scripts are not included. The drivers may be
+started from init, your .bashrc, by qjackctl, etc. In order to be run by a
+non-root user the drivers must have access to the device files in /dev/input.
+This may be accomplished by adding a group 'input', adding desired users to
+this group, and configuring udev to assign the appropriate ownership to files
+in /dev/input. It should be perfectly safe to run the drivers as root,
+however.
+
+For realtime scheduling (the \-R option), either use set_rlimits, or set the
+appropriate POSIX capabilities on the executable:
+.P
+/sbin/setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/lsmi-joystick
+.P
+The lsmi.SlackBuild script already includes RT scheduling support.
+
+.SH OPTIONS
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-d, \-\-device specialfile
+Event device to use (instead of js0).
+.TP
+.B \-R, \-\-realtime rtprio
+Use realtime priority 'rtprio' (requires privs).
+.TP
+.B \-v, \-\-verbose
+Be verbose (show note events).
+.TP
+.B \-p, \-\-port client:port
+Connect to ALSA Sequencer client on startup.
+.TP
+.B \-n, \-\-no-hold
+Send controller data even when no joystick button is held.
+.TP
+.B \-z, \-\-daemon
+Fork and don't print anything to stdout.
+.SH SEE ALSO
+.BR lsmi-keyhack (1),
+.BR lsmi-monterey (1),
+.BR lsmi-mouse (1).
+.br
+.SH AUTHOR
+lsmi was written by Jonathan Moore Liles.
+.PP
+This manual page was written by Ariel Errera <ariel@musix.org.ar>,
+for the Debian project (but may be used by others). It was then modified
+by B. Watson for the SlackBuilds.org project.
diff --git a/audio/lsmi/man/lsmi-keyhack.1 b/audio/lsmi/man/lsmi-keyhack.1
new file mode 100644
index 0000000000..17a932c4bb
--- /dev/null
+++ b/audio/lsmi/man/lsmi-keyhack.1
@@ -0,0 +1,90 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH LSMI-KEYHACK 1 "May 15, 2012"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+
+lsmi-keyhack \- Linux Pseudo MIDI Input -- Keyboard Hack
+.SH SYNOPSIS
+.B lsmi-keyhack
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+
+This driver is for a hacked AT / PS/2 keyboard functioning as a MIDI
+controller.
+
+It is somewhat specific to the author's own hardware, but, since it relies a learning
+capability rather than a fixed keymap, it should be equally useful for
+others wishing to build their own fake MIDI keyboard. Of course, such a
+keyboard will not be velocity sensitive, but this project is a good way to
+salvage both an old QWERTY keyboard and a manual from a decrepit analog
+organ or cheap PCM noise-maker.
+
+The driver supports up to 88 musical keys, three footswitches, and several
+additional buttons for control and data entry. It has the rather unfortunate
+side-effect of rendering the console useless, unless, of course you have
+another (USB) keyboard to type on.
+
+.SH USAGE
+
+Distribution specific init scripts are not included. The drivers may be
+started from init, your .bashrc, by qjackctl, etc. In order to be run by a
+non-root user the drivers must have access to the device files in /dev/input.
+This may be accomplished by adding a group 'input', adding desired users to
+this group, and configuring udev to assign the appropriate ownership to files
+in /dev/input. It should be perfectly safe to run the drivers as root,
+however.
+
+For realtime scheduling (the \-R option), either use set_rlimits, or set the
+appropriate POSIX capabilities on the executable:
+.P
+/sbin/setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/lsmi-joystick
+.P
+The lsmi.SlackBuild script already includes RT scheduling support.
+
+.SH OPTIONS
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-d, \-\-device specialfile
+Event device to use (instead of event0).
+.TP
+.B \-R, \-\-realtime rtprio
+Use realtime priority 'rtprio' (requires privs).
+.TP
+.B \-v, \-\-verbose
+Be verbose (show note events).
+.TP
+.B \-c, \-\-channel n
+Initial MIDI channel.
+.TP
+.B \-p, \-\-port client:port
+Connect to ALSA Sequencer client on startup.
+.TP
+.B \-k, \-\-keydata file
+Name file to read/write key mappings (instead of ~/.keydb).
+.SH SEE ALSO
+.BR lsmi-joystick (1),
+.BR lsmi-monterey (1),
+.BR lsmi-mouse (1).
+.br
+.SH AUTHOR
+lsmi was written by Jonathan Moore Liles.
+.PP
+This manual page was written by Ariel Errera <ariel@musix.org.ar>,
+for the Debian project (but may be used by others). It was then modified
+by B. Watson for the SlackBuilds.org project.
diff --git a/audio/lsmi/man/lsmi-monterey.1 b/audio/lsmi/man/lsmi-monterey.1
new file mode 100644
index 0000000000..67b365f0b5
--- /dev/null
+++ b/audio/lsmi/man/lsmi-monterey.1
@@ -0,0 +1,172 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH LSMI-MONTEREY 1 "May 15, 2012"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+
+lsmi-monterey \- Linux Pseudo MIDI Input -- Monterey
+.SH SYNOPSIS
+.B lsmi-monterey
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+
+Monterey is a userspace driver for Monterey
+International MK-9500 / K617W reversible keyboard.
+
+This device consists of a 104 QWERTY AT computer keyboard on one side and a
+37 key, velocity sensitive musical keyboard on the other. In addition to
+flipping the unit over, one must flip a switch on the right side in order to
+change the mode.
+
+The keyboard interface is standard, except that the musical side sends
+two-scancode packets for each piano key press and release ('make' codes
+only). The first scancode indicates the note, the second the velocity: 7
+being the lowest, 1 the highest, and 0 representing a release (or sometimes
+a very very light keypress). The musical side also has buttons for keys F1
+through F9, left and right arrow keys, and return--all generating 'make'
+codes only with no way to register release.
+
+This driver creates an ALSA Sequencer port and attempts to fill it with
+realtime MIDI data representing input from the musical side of the keyboard,
+while passing regular textual data through the uinput interface and on to
+Linux console or X Window System. There is no need to load a special
+application or even run X in order to generate MIDI events: simply flip the
+keyboard over and go nuts. The driver doesn't interfere at all with
+multiple/international layouts. You can even use it along
+side another (merged input) keyboard (ie. plugged into a laptop) and the
+driver should be able to sort everything out (provided that you refrain from
+typing on both keyboards simultaneously).
+
+.SH FUNCTION KEYS
+
+There's no reliable way to distinguish the function keys on the musical
+side from those on the QWERTY side in order to map them to channel,
+program change and so on. One solution is to interpret any function key
+(including arrows and return) pressed within two seconds of the 'quaver'
+key (F9) as a MIDI event.
+
+.TP
+.B Program Change
+The first four keys (I-IV) function as patch pages, each page able to
+address 32 patches. To change to program number 2 (GM Bright Acoustic
+Piano), first press QUAVER, then function key I, then press the second
+piano key from the left (the first black key).
+
+.TP
+.B Bank Change
+Keys V-VIII work similarly to program change, but alter current bank
+instead. Note that you won't see any effect until you change patches as
+well.
+
+.TP
+.B Channel Change and Octave Change
+The arrow keys are used to change channel or octave. To lower or raise
+the octave (from that of middle C) the octave, press QUAVER followed by
+the appropriate arrow key. QUAVER may be ommitted between subsequent
+arrow presses, if they occur within 2 seconds of each other. To change
+the channel, press QUAVER followed by 'R' (return), then an arrow key.
+
+All of these heuristics are timing critical and might fail to operate under
+heavy system loads. To ensure proper performance, use a high realtime
+priority, like 99 (and it wouldn't hurt to do the same for your keyboard
+controller's IRQ).
+
+.SH KNOWN ISSUES
+
+.TP
+.B Events
+For some reason the kernel event layer drops KEY events, mostly when
+switching between a piano key and its associated text key. I believe this
+is a due to a bug in the repeat state tracking code, exposed here because
+the keyboard generates only 'make' scancodes on the musical side. The
+driver works around this by tracking the MSC_SCAN events instead, but it's
+kind of a hack and requires massaging the events more than I'm comfortable
+with (might not work with PS2->USB adaptors, etc.)
+
+.TP
+.B Repeat Rate
+To prevent frustrating "stuck" repeats in X (the console doesn't appear to
+suffer from this problem) the driver converts all REPEAT events it passes
+to PRESSes.
+
+.TP
+.B LEDs
+The LEDs don't work. This little driver is the only example of a real
+uinput filter I've seen. I'm not sure the kernel developers anticipated
+the problem of managing the LEDs. Ideally it would be transparent. As it
+is, it would probably take a large amount of code to get the keyboard LEDs
+working again--which seems silly.
+
+.SH PREREQUISITES
+
+2.6 series kernel with evdev and uinput modules loaded.
+ALSA Sequencer drivers and library.
+
+An MK-9500 or K617W keyboard...
+
+.SH USAGE
+
+Distribution specific init scripts are not included. The drivers may be
+started from init, your .bashrc, by qjackctl, etc. In order to be run by a
+non-root user the drivers must have access to the device files in /dev/input.
+This may be accomplished by adding a group 'input', adding desired users to
+this group, and configuring udev to assign the appropriate ownership to files
+in /dev/input. It should be perfectly safe to run the drivers as root,
+however.
+
+For realtime scheduling (the \-R option), either use set_rlimits, or set the
+appropriate POSIX capabilities on the executable:
+.P
+/sbin/setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/lsmi-joystick
+.P
+The lsmi.SlackBuild script already includes RT scheduling support.
+
+.SH OPTIONS
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-d, \-\-device specialfile
+Event device to use (instead of event0).
+.TP
+.B \-v, \-\-verbose
+Be verbose (show note events).
+.TP
+.B \-p, \-\-port client:port
+Connect to ALSA Sequencer client on startup.
+.TP
+.B \-R, \-\-realtime rtprio
+Use realtime priority 'rtprio' (requires privs).
+.TP
+.B \-n, \-\-no-velocity
+Ignore velocity information from keyboard.
+.TP
+.B \-c, \-\-channel n
+Initial MIDI channel.
+.TP
+.B \-z, \-\-daemon
+Fork and don't print anything to stdout.
+.SH SEE ALSO
+.BR lsmi-joystick (1),
+.BR lsmi-keyhack (1),
+.BR lsmi-mouse (1).
+.br
+.SH AUTHOR
+lsmi was written by Jonathan Moore Liles.
+.PP
+This manual page was written by Ariel Errera <ariel@musix.org.ar>,
+for the Debian project (but may be used by others). It was then modified
+by B. Watson for the SlackBuilds.org project.
diff --git a/audio/lsmi/man/lsmi-mouse.1 b/audio/lsmi/man/lsmi-mouse.1
new file mode 100644
index 0000000000..d7162d2489
--- /dev/null
+++ b/audio/lsmi/man/lsmi-mouse.1
@@ -0,0 +1,100 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH LSMI-MOUSE 1 "May 15, 2012"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+
+lsmi-mouse \- Linux Pseudo MIDI Input -- Mouse
+.SH SYNOPSIS
+.B lsmi-mouse
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+
+This driver is capable of generating a stream of MIDI controller and/or note
+events from the state of mouse buttons. I have a MouseSystems serial mouse
+controller board with footswitches wired to each of its three buttons. You
+must have evdev and the kernel driver for your mouse type loaded (in my
+case, this is sermouse). Mouse axes, wheels, or additional buttons are not
+used (if you can think of something to do with them [rotary encoders for
+filter and resonance?], then, by all means, let me know).
+
+I use this device to control Freewheeling and various softsynths. Much
+cheaper than a real MIDI pedalboard, of this I assure you.
+
+.SH EXAMPLE
+
+Use mouse device "/dev/input/event4", mapping left button
+to Controller #64, middle button to Note #36, and
+right button to Note #37 (all on Channel #1):
+.br
+.B lsmi-mouse -d /dev/input/event4 -1 c:1:64 -2 n:1:36 -3 n:1:37
+
+.SH USAGE
+
+Distribution specific init scripts are not included. The drivers may be
+started from init, your .bashrc, by qjackctl, etc. In order to be run by a
+non-root user the drivers must have access to the device files in /dev/input.
+This may be accomplished by adding a group 'input', adding desired users to
+this group, and configuring udev to assign the appropriate ownership to files
+in /dev/input. It should be perfectly safe to run the drivers as root,
+however.
+
+For realtime scheduling (the \-R option), either use set_rlimits, or set the
+appropriate POSIX capabilities on the executable:
+.P
+/sbin/setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/lsmi-joystick
+.P
+The lsmi.SlackBuild script already includes RT scheduling support.
+
+.SH OPTIONS
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-d, \-\-device specialfile
+Event device to use (instead of event0).
+.TP
+.B \-R, \-\-realtime rtprio
+Use realtime priority 'rtprio' (requires privs).
+.TP
+.B \-v, \-\-verbose
+Be verbose (show note events).
+.TP
+.B \-p, \-\-port client:port
+Connect to ALSA Sequencer client on startup.
+.TP
+.B \-1, \-\-button-one 'c'|'n':n:n
+Button mapping.
+.TP
+.B \-2, \-\-button-two 'c'|'n':n:n
+Button mapping.
+.TP
+.B \-3, \-\-button-thrree 'c'|'n':n:n
+Button mapping.
+.TP
+.B \-z, \-\-daemon
+Fork and don't print anything to stdout.
+.SH SEE ALSO
+.BR lsmi-joystick (1),
+.BR lsmi-keyhack (1),
+.BR lsmi-monterey (1).
+.br
+.SH AUTHOR
+lsmi was written by Jonathan Moore Liles.
+.PP
+This manual page was written by Ariel Errera <ariel@musix.org.ar>,
+for the Debian project (but may be used by others). It was then modified
+by B. Watson for the SlackBuilds.org project.
diff --git a/audio/lsmi/rtprio.diff b/audio/lsmi/rtprio.diff
new file mode 100644
index 0000000000..4322314f9a
--- /dev/null
+++ b/audio/lsmi/rtprio.diff
@@ -0,0 +1,153 @@
+diff -Naur lsmi/lsmi-joystick.c lsmi.patched//lsmi-joystick.c
+--- lsmi/lsmi-joystick.c 2012-05-14 20:08:19.000000000 -0400
++++ lsmi.patched//lsmi-joystick.c 2012-05-14 20:15:16.000000000 -0400
+@@ -46,6 +46,7 @@
+ #include <sys/time.h>
+ #include <signal.h>
+ #include <getopt.h>
++#include <sched.h>
+
+ #include "seq.h"
+ #include "sig.h"
+@@ -99,6 +100,7 @@
+ "Options:\n\n"
+ " -h | --help Show this message\n"
+ " -d | --device specialfile Event device to use (instead of js0)\n"
++ " -R | --realtime rtprio Use realtime priority 'rtprio' (requires privs)\n"
+ " -v | --verbose Be verbose (show note events)\n"
+ " -p | --port client:port Connect to ALSA Sequencer client on startup\n"
+ " -n | --no-hold Send controller data even when no joystick button is held\n" );
+@@ -121,6 +123,7 @@
+ { "verbose", no_argument, NULL, 'v' },
+ { "device", required_argument, NULL, 'd' },
+ { "no-hold", no_argument, NULL, 'n' },
++ { "realtime", required_argument, NULL, 'R' },
+ { "daemon", no_argument, NULL, 'z' },
+ { NULL, 0, NULL, 0 }
+ };
+@@ -164,6 +167,23 @@
+ case 'z':
+ daemonize = 1;
+ break;
++ case 'R':
++ {
++ struct sched_param sp;
++
++ sp.sched_priority = atoi( optarg );
++
++ if ( sched_setscheduler( 0, SCHED_FIFO, &sp ) < 0 )
++ {
++ perror( "sched_setscheduler()" );
++ fprintf( stderr, "Failed to get realtime priority!\n" );
++ exit( 1 );
++ }
++
++ fprintf( stderr, "Using realtime priority %i.\n",
++ sp.sched_priority );
++ }
++ break;
+ }
+
+ }
+diff -Naur lsmi/lsmi-keyhack.c lsmi.patched//lsmi-keyhack.c
+--- lsmi/lsmi-keyhack.c 2012-05-14 20:08:19.000000000 -0400
++++ lsmi.patched//lsmi-keyhack.c 2012-05-14 20:14:07.000000000 -0400
+@@ -111,6 +111,7 @@
+ #include <getopt.h>
+
+ #include <linux/input.h>
++#include <sched.h>
+ #include <stdint.h>
+
+ #include "seq.h"
+@@ -261,6 +262,7 @@
+ " -h | --help Show this message\n"
+ " -d | --device specialfile Event device to use (instead of event0)\n"
+ " -v | --verbose Be verbose (show note events)\n"
++ " -R | --realtime rtprio Use realtime priority 'rtprio' (requires privs)\n"
+ " -c | --channel n Initial MIDI channel\n"
+ " -p | --port client:port Connect to ALSA Sequencer client on startup\n"
+ " -k | --keydata file Name file to read/write key mappings (instead of ~/.keydb)\n"
+@@ -281,6 +283,7 @@
+ { "channel", required_argument, NULL, 'c' },
+ { "device", required_argument, NULL, 'd' },
+ { "keydata", required_argument, NULL, 'k' },
++ { "realtime", required_argument, NULL, 'R' },
+ { "verbose", no_argument, NULL, 'v' },
+ { NULL, 0, NULL, 0 }
+ };
+@@ -320,6 +323,23 @@
+ case 'v':
+ verbose = 1;
+ break;
++ case 'R':
++ {
++ struct sched_param sp;
++
++ sp.sched_priority = atoi( optarg );
++
++ if ( sched_setscheduler( 0, SCHED_FIFO, &sp ) < 0 )
++ {
++ perror( "sched_setscheduler()" );
++ fprintf( stderr, "Failed to get realtime priority!\n" );
++ exit( 1 );
++ }
++
++ fprintf( stderr, "Using realtime priority %i.\n",
++ sp.sched_priority );
++ }
++ break;
+ }
+
+ }
+diff -Naur lsmi/lsmi-mouse.c lsmi.patched//lsmi-mouse.c
+--- lsmi/lsmi-mouse.c 2012-05-14 20:08:19.000000000 -0400
++++ lsmi.patched//lsmi-mouse.c 2012-05-14 20:11:08.000000000 -0400
+@@ -55,6 +55,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
+
++#include <sched.h>
+ #include <stdint.h>
+
+ #include <getopt.h>
+@@ -144,6 +145,7 @@
+ " -h | --help Show this message\n"
+ " -d | --device specialfile Event device to use (instead of event0)\n"
+ " -v | --verbose Be verbose (show note events)\n"
++ " -R | --realtime rtprio Use realtime priority 'rtprio' (requires privs)\n"
+ " -p | --port client:port Connect to ALSA Sequencer client on startup\n"
+
+ " -1 | --button-one 'c'|'n':n:n Button mapping\n"
+@@ -169,6 +171,7 @@
+ { "button-one", required_argument, NULL, '1' },
+ { "button-two", required_argument, NULL, '2' },
+ { "button-three", required_argument, NULL, '3' },
++ { "realtime", required_argument, NULL, 'R' },
+ { "daemon", no_argument, NULL, 'z' },
+ { NULL, 0, NULL, 0 }
+ };
+@@ -202,6 +205,23 @@
+ case '3':
+ parse_map( 2, optarg );
+ break;
++ case 'R':
++ {
++ struct sched_param sp;
++
++ sp.sched_priority = atoi( optarg );
++
++ if ( sched_setscheduler( 0, SCHED_FIFO, &sp ) < 0 )
++ {
++ perror( "sched_setscheduler()" );
++ fprintf( stderr, "Failed to get realtime priority!\n" );
++ exit( 1 );
++ }
++
++ fprintf( stderr, "Using realtime priority %i.\n",
++ sp.sched_priority );
++ }
++ break;
+ case 'z':
+ daemonize = 1;
+ break;
diff --git a/audio/lsmi/setcap.sh b/audio/lsmi/setcap.sh
new file mode 100644
index 0000000000..56bb60de0b
--- /dev/null
+++ b/audio/lsmi/setcap.sh
@@ -0,0 +1,5 @@
+if [ -x /sbin/setcap ]; then
+ for i in lsmi-joystick lsmi-keyhack lsmi-monterey lsmi-mouse; do
+ /sbin/setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/$i
+ done
+fi
diff --git a/audio/lsmi/slack-desc b/audio/lsmi/slack-desc
new file mode 100644
index 0000000000..5a28c80892
--- /dev/null
+++ b/audio/lsmi/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+lsmi: lsmi (map keyboard/mouse/joystick input to ALSA MIDI sequencer events)
+lsmi:
+lsmi: These simple user-space drivers support using certain homemade,
+lsmi: repurposed, or commercial devices as MIDI controllers on Linux, even
+lsmi: though the devices themselves are not capable of generating MIDI
+lsmi: messages; this does not include things like MIDI-over-serial or PIC
+lsmi: based projects, which are true MIDI devices.
+lsmi:
+lsmi: Reasons for using this software include: achieving MIDI entry on
+lsmi: machines without MIDI ports, reusing old hardware, pure frugality,
+lsmi: and fun.