/aiolaunchpad

Framework to control Novation LaunchControlXL from Python with AsyncIO

Primary LanguagePythonApache License 2.0Apache-2.0

AioLaunchpad

Framework to control Novation Launch controllers from Python with AsyncIO.

The goal of aiolaunchpad is to make it very easy to handle concurrent actions and interface with other asynchronous tools, especially based on Asyncio.

Supports the Launch Control XL MK2 at the moment, but support for other boards should be pretty straightforward.

Usage

A basic usage of AioLaunchpad looks like the following:

from aiolaunchpad import LaunchControlXL

pad = LaunchControlXL()

@pad.register
async def print_fader_0(code, input: pad.inputs.fader0, value, device):
    print("Hello, fader 0 has value", value)

@pad.register
async def print_all_faders(code, input, value, device):
    print("Any fader prints this")

if __name__ == '__main__':
    pad.run_app()

AioLaunchpad uses a simplified subscriber system, based on Type Hints, to call your function only when the values match.

Have a look at the examples.

Requirements

A UNIX-style system is required to talk with the MIDI device natively, and aiofiles must be installed (pip install aiofiles).