Skip to content

Turns joysticks into MIDI controllers for ALSA - forked to add button mapping

License

Notifications You must be signed in to change notification settings

onlineadventures/aseqjoy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forked to add mapping of specific buttons to MIDI controllers using the `-b` option.

In this version, only the buttons specified with the `-b` option will be included in the button map. Buttons not defined in the command will be ignored. The format for the `-b` option is `button=controller`.

See below for example usage.


aseqjoy - a simple joystick to ALSA MIDI sequencer converter
============================================================

Copyright 2003-2016 by Alexander König - [email protected]

License: GNU General Public License Version 2 or (at your option) any later 
version - for details please refer to the file [COPYING](./COPYING) included 
with the aseqjoy source code.

What it does: Each axis of the joystick device is mapped to a specific MIDI 
controller. Moving the joystick along an axis will cause aseqjoy to emit
MIDI controller messages via ALSA's sequencer API. The value of the controller
message represents the joystick's position along the axis (eg 'left' -> 0, 
'middle' -> 63, 'right' -> 127). Note that you can run aseqjoy with the '-r'
commandline switch to use fine MIDI control change messages instead (with 14
bit resolution).

aseqjoy uses the ALSA sequencer API to emit the MIDI events. Therefore it
creates and output port named after joystick used. You can then use for example
aconnect (from alsa-utils), QjackCtl or Robert Ham's alsa-patch-bay to connect
an aseqjoy instance to an input port of your choice. 

Requirements
------------

* Current Linux system with joystick input drivers and ALSA sound system 
  properly configured.

Links
-----

* [aseqjoy homepage](https://terminatorx.org/addons/)
* [ALSA homepage](http://www.alsa-project.org)
* [Joystick utils](http://atrey.karlin.mff.cuni.cz/~vojtech/joystick/)
* [QjackCtl](http://qjackctl.sourceforge.net/)
* [ALSA-patch-bay](http://pkl.net/~node/alsa-patch-bay.html)

Howto
-----

In some cases the joystick may not utilize the full range of available 
controller values - in this case you should use "jscal" from the joystick
package (most distributions feature this package) to calibrate your joystick 
before running aseqjoy. Note: Analog PC joysticks are no high-precision 
devices - so even after calibrating the device you might not always be able
to reach "0" or "127" controller values - depending on the joystick you
use.

Start aseqjoy - if you have a working joystick (Nr. 0 - use the -d switch to
select other joysticks) aseqjoy will detect that and map each axis of that 
joystick to a controller from 10 on upwards:

* Axis -> Controller 
* 0 -> 10
* 1 -> 11
* 2 -> 12

From now on aseqjoy emits events over the "Joystick0" output port. To make use
of these events in another application use for example the alsa-patch-bay
to connect that output port to another application's input sequencer port
(for example the "terminatorX" input port for terminatorX). After you've bound
the controllers to certain controls you should see how moving the joystick
affects the corresponding control.

Button Mapping
--------------

You can now map specific buttons to MIDI controllers using the `-b` option. Only the buttons specified with the `-b` option will be included in the button map. Buttons not defined in the command will be ignored. The format for the `-b` option is `button=controller`.

Example usage:

```sh
./aseqjoy -d 0 -v -0 1 -1 2 -2 3 -3 4 -b 0=20 -b 1=21 -b 2=22
```

Explanation:

-d 0: Select joystick 0.
-v: Enable verbose mode.
-0 1, -1 2, -2 3, -3 4: Map joystick axes to MIDI controllers 1, 2, 3, and 4 respectively.
-b 0=20: Map button 0 to MIDI controller 20.
-b 1=21: Map button 1 to MIDI controller 21.
-b 2=22: Map button 2 to MIDI controller 22.

With this configuration, only buttons 0, 1, and 2 will be mapped to MIDI controllers 20, 21, and 22, respectively. Other buttons will be ignored.

About

Turns joysticks into MIDI controllers for ALSA - forked to add button mapping

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 65.3%
  • Roff 24.1%
  • M4 7.9%
  • Makefile 1.4%
  • Shell 1.3%