Skip to main content

Python interface for ALSA MIDI sequencer

Project description

This project provides Python interface to ALSA sequencer API.

Features

  • Pythonic API to most of the ALSA sequencer functionality

  • Access to ALSA sequencer features not available when using other (‘portable’) Python MIDI libraries:

    • Precise timestamping of messages sent and received

    • Port connection management, including connection between ports on different clients

    • Access to non-MIDI events, like announcements about new clients, ports and connections

  • Python 3.7 – 3.11 compatibility

  • Both synchronous (blocking) and asynchronous (asyncio) I/O

  • Only Python code, no need to compile a binary module. Requires cffi, though.

  • MIDO backend provided

Installation

This package requires ALSA library to be installed (libasound.so.2 – ‘libasound2’ package on Debian-like systems). On a typical Linux system it is probably already installed for some other audio or MIDI software.

python-alsa-midi package may be installed with pip:

python3 -m pip install alsa-midi

This should normally install a binary wheel compiled on a compatible system or pure-python wheel working without compilation.

If no compatible wheel is found build from source package will be triggered, which will also require ALSA library development files (libasound2-dev).

To force installing from source (and compiling the binary extension) use:

python3 -m pip install --no-binary=alsa-midi alsa-midi

To force installing from source without compiling the extension:

PY_ALSA_MIDI_NO_COMPILE=1 python3 -m pip install --no-binary=alsa-midi alsa-midi

Alternatively one can just add the source directory (as checked out from https://github.com/Jajcus/python-alsa-midi.git) to $PYTHONPATH and use the packages directly, with no compilation.

Usage

Detailed documentation is available at https://python-alsa-midi.readthedocs.io/

Simple example:

import time
from alsa_midi import SequencerClient, READ_PORT, NoteOnEvent, NoteOffEvent

client = SequencerClient("my client")
port = client.create_port("output", caps=READ_PORT)
dest_port = client.list_ports(output=True)[0]
port.connect_to(dest_port)
event1 = NoteOnEvent(note=60, velocity=64, channel=0)
client.event_output(event1)
client.drain_output()
time.sleep(1)
event2 = NoteOffEvent(note=60, channel=0)
client.event_output(event2)
client.drain_output()

Using with MIDO

python-alsa-midi can be used as a MIDO back-end too:

export MIDO_BACKEND=alsa_midi.MIDO_BACKEND
mido/examples/midifiles/play_midi_file.py file.mid

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alsa-midi-1.0.2.tar.gz (299.2 kB view details)

Uploaded Source

Built Distributions

alsa_midi-1.0.2-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

alsa_midi-1.0.2-cp311-cp311-manylinux_2_28_x86_64.whl (395.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

alsa_midi-1.0.2-cp311-cp311-manylinux_2_17_x86_64.whl (395.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

alsa_midi-1.0.2-cp311-cp311-manylinux_2_17_i686.whl (354.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

alsa_midi-1.0.2-cp310-cp310-manylinux_2_28_x86_64.whl (396.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

alsa_midi-1.0.2-cp310-cp310-manylinux_2_17_x86_64.whl (395.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

alsa_midi-1.0.2-cp310-cp310-manylinux_2_17_i686.whl (354.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

alsa_midi-1.0.2-cp310-cp310-manylinux_2_12_x86_64.whl (372.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

alsa_midi-1.0.2-cp310-cp310-manylinux_2_12_i686.whl (320.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ i686

alsa_midi-1.0.2-cp39-cp39-manylinux_2_28_x86_64.whl (395.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

alsa_midi-1.0.2-cp39-cp39-manylinux_2_17_x86_64.whl (395.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

alsa_midi-1.0.2-cp39-cp39-manylinux_2_17_i686.whl (354.2 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

alsa_midi-1.0.2-cp39-cp39-manylinux_2_12_x86_64.whl (373.1 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

alsa_midi-1.0.2-cp39-cp39-manylinux_2_12_i686.whl (320.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

alsa_midi-1.0.2-cp38-cp38-manylinux_2_28_x86_64.whl (396.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

alsa_midi-1.0.2-cp38-cp38-manylinux_2_17_x86_64.whl (395.2 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

alsa_midi-1.0.2-cp38-cp38-manylinux_2_17_i686.whl (354.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

alsa_midi-1.0.2-cp38-cp38-manylinux_2_12_x86_64.whl (373.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

alsa_midi-1.0.2-cp38-cp38-manylinux_2_12_i686.whl (320.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

alsa_midi-1.0.2-cp37-cp37m-manylinux_2_28_x86_64.whl (393.4 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.28+ x86-64

alsa_midi-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.whl (392.4 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

alsa_midi-1.0.2-cp37-cp37m-manylinux_2_17_i686.whl (351.7 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

alsa_midi-1.0.2-cp37-cp37m-manylinux_2_12_x86_64.whl (370.3 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

alsa_midi-1.0.2-cp37-cp37m-manylinux_2_12_i686.whl (318.0 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

File details

Details for the file alsa-midi-1.0.2.tar.gz.

File metadata

  • Download URL: alsa-midi-1.0.2.tar.gz
  • Upload date:
  • Size: 299.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for alsa-midi-1.0.2.tar.gz
Algorithm Hash digest
SHA256 456573ba98edde04e8dedda12166fe4066d7abca07b87e97690b394ca1e6b22b
MD5 b13a3811adea028e386753c0460b4f55
BLAKE2b-256 07ccd48b9365bf98d27136d63e0892525a7256af68a466abc64527c1ddfee061

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: alsa_midi-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for alsa_midi-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb9614a9545b8567a60d919b7e86736cfc52db2e106755ff1f5cdb3ca9f461e2
MD5 191b6ca87c3f582b147ef3ac5cf9118b
BLAKE2b-256 5b1700ebe932b4dbcf091b36ddfe03c83333b02f975eab8b5b267c942c87d1e1

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 89b8457bdf2d144f3c3d33442869b136360dc3569f4c355c7c97238bea7a558c
MD5 9f272bccdaa33f5ab54f917a32996647
BLAKE2b-256 6571913da4473473e93f405933ed02f03a45b124b8edcc0e04bcad08cafbfdae

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 27e65c83a55b3a3f0748f6e9067f30e8dec8af355070d82a967dee47381b9e5a
MD5 9bdfde5ba4e717a465261d6b4b7d6403
BLAKE2b-256 d71d42951b69886ce797769c823bd6498d0ff105883709442f88e5bdcc23e23d

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp311-cp311-manylinux_2_17_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp311-cp311-manylinux_2_17_i686.whl
Algorithm Hash digest
SHA256 52651d916b29566feb5ee0790e3edd51baab06fcffe3036407ee48767424943d
MD5 d7a575927294e730e88850d6d7304575
BLAKE2b-256 fb347b70ce922f5d7729427532dc49cea44ac488bba764d2ba82de498892ec9c

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5ce1a8b0e29b3c3ac752c981e88ce517a3417c36d6e4ae7b643e95af90e4f1e1
MD5 8806d087e7b62288f5b428a32a765c26
BLAKE2b-256 d825356a23e62ffac873a7cc10624051b34ab220fad25c4336b9be6db425e79d

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 26be92d281c65832922847a97b148b6448e531f9394a3f5a2fe6fad2aecc4fd6
MD5 6fac570590ecc1ffda3f07cd0486276a
BLAKE2b-256 8b2c074e5d510a8276c372f315700a5fe41b4326210046418edad240aa1e8b6b

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp310-cp310-manylinux_2_17_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp310-cp310-manylinux_2_17_i686.whl
Algorithm Hash digest
SHA256 56aaa95f626662e8555c639bd6f2ccd4bc3dfd4f1f8df8324ab9733f2f13aa2b
MD5 13ec47b51dba97629f109d53ef16c79f
BLAKE2b-256 1260bdaeecd96fcb44a637108323986920e29e7db3018f4ea91c6ad7e12ac4a9

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp310-cp310-manylinux_2_12_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp310-cp310-manylinux_2_12_x86_64.whl
Algorithm Hash digest
SHA256 e95745acf153a528798ddd5eb0e7718e3470d14d2832f47effc70ed2bfb07ebb
MD5 9f70dfbbcc230c9131e50c84bc4e6267
BLAKE2b-256 fc28035d8c7bd51bdf8acd74acfaee849c3db7aee62960c49214ed482ac42754

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp310-cp310-manylinux_2_12_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp310-cp310-manylinux_2_12_i686.whl
Algorithm Hash digest
SHA256 ddcfd483b4613a5a0caef04043815c5f289c0c2c174f853741dec9005333d290
MD5 3abd510a3eb17c41ce76a1a172e94eeb
BLAKE2b-256 f789ee5f71d9aca11cc7f5a6dde367b2a93ab9caeed0f4944e7240f53b00ae32

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1e41df060684391ced5414cbe7bf06dda434e7bfb0ac87889afa9bfb34bfed15
MD5 6920d5da5e1472e74f4ea4b83e6fd718
BLAKE2b-256 e0b3c12ed2c101777a0b56a2187d592d5510554927c8b83e5f8b13adea919226

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp39-cp39-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f6fc73fb2cd4106e7fc6756189d881d73081d4f12840548fb0a14ed85f861679
MD5 bde03ae362b8743d9939c3e60a353d38
BLAKE2b-256 26ee4d07894967371fe84491530a91e521c74e6b97e834017d7372e6fa064d0d

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp39-cp39-manylinux_2_17_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp39-cp39-manylinux_2_17_i686.whl
Algorithm Hash digest
SHA256 e2116da540c8b8730448470f98823fd44b306ff9ee7ea48878bffa225ad44aeb
MD5 38190239f7abf554dfb70734b568c734
BLAKE2b-256 d0f6818aabc1b086bec826356f8d0898e06dc9dc197e983e783e6df992e09b50

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp39-cp39-manylinux_2_12_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp39-cp39-manylinux_2_12_x86_64.whl
Algorithm Hash digest
SHA256 daf1b31eeeeed100cea0262fa58380d2565db034df825afa42eba3df649f9e3f
MD5 1252a601a82ce59d4368900eb4d12345
BLAKE2b-256 f3bfa7b7e92ab84587aea1fce1beb33dd3a8ade1f9c24b3f0850c691cf643dd8

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp39-cp39-manylinux_2_12_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp39-cp39-manylinux_2_12_i686.whl
Algorithm Hash digest
SHA256 7f155de5b315ab11aade65a7f4fa9af5657d6bff4e169a011751176a1e8327fa
MD5 fbab5aa9e56a78d4db4c9ab717a86669
BLAKE2b-256 272be715608f17509ab74aaef1cb14ef67f922ca94679dd0ecdf1ade9b42e001

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b30b41f4461cebc623742228383313623301ca005e3a1deba17c83ee2613b2dd
MD5 13d05e22537b091c4342e69e0dd5fd5a
BLAKE2b-256 3fbfc2b22b98e5539a38cc54fcc7786c429de5212ae41c99ebd5d55a81601ee9

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 06c76fb6d4d7895c037f98d8715be6e7ab694903f37b46f77f84f9b27e127911
MD5 96331d4dc0435734cbb245876ff4cb86
BLAKE2b-256 3d05f131600b4aab588f1fcd7467ff33246fbe2a6558da2cc9569ed9575eced3

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp38-cp38-manylinux_2_17_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp38-cp38-manylinux_2_17_i686.whl
Algorithm Hash digest
SHA256 76fd8759ee2da0cc71e0d7544ba2a87c4909e8b1350e996581e57495b7b01e1a
MD5 fa5b58d3389d92a98c4ece7cfd31a67a
BLAKE2b-256 b41eef94e34771badd464e346085036797d4a5d6bf42ab8d5484463861ac5d3c

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp38-cp38-manylinux_2_12_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp38-cp38-manylinux_2_12_x86_64.whl
Algorithm Hash digest
SHA256 8dcd3534e7d1d553ea725553331cb432782d737057e1e5e7d435023c1455165c
MD5 11f3ddfcd5eba2af7b0b4cb0087dd74e
BLAKE2b-256 782fe34c57eb30af4e5c6282a5b7140ddec36d978e9202d14183a852124cbb64

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp38-cp38-manylinux_2_12_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp38-cp38-manylinux_2_12_i686.whl
Algorithm Hash digest
SHA256 fb6277e98e2376c644017adc55b2182285bfd3e8d27b84a5be82d8fd1217afd9
MD5 23a72fb503f83ff4a279727deea55c31
BLAKE2b-256 8af594439bd741968c4bd13a88bf0034a14ca4943bec259c9b4fa990a0d9f7f3

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp37-cp37m-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2752d7311d082169dc751bddf812c94a4a10289fc1d288e3edebd2cc5d4e2a92
MD5 59fd6401ad354a0dce1d49d572141102
BLAKE2b-256 6e33ba79ea15aa1234b83b3a828af6e2f84b4929652a77aede9efaf49ce59361

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 53259c3c0d54546c339e884a8a4478254fabac502eabc6eb95ac324105cdf128
MD5 4923d66686f369adc07e8fe90232044f
BLAKE2b-256 61c50770a2ba93c0cd8108b5403d45b0a3b4b0b5b415bd1925c6d1ef4d365822

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp37-cp37m-manylinux_2_17_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp37-cp37m-manylinux_2_17_i686.whl
Algorithm Hash digest
SHA256 2d0945353c8905ddb830d3f2d2b37c850645aab4b0b7881cc452e892c6110ed1
MD5 861060d97551554859f81b3fdf27c5c5
BLAKE2b-256 d833c88e7534b04abd4d5908b07412efe6b4d32052b1f41a6a531d8326e7a78f

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp37-cp37m-manylinux_2_12_x86_64.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp37-cp37m-manylinux_2_12_x86_64.whl
Algorithm Hash digest
SHA256 d46a80ddbcb534b80d1e91f188076a6489d0640d7c354575d7eec4cbeda3d035
MD5 8d76bf3e289201a10d57e30c8400c127
BLAKE2b-256 217eb7c31a82290920ad49c3db2a48d05a65404107a5057e5e31c9454272537b

See more details on using hashes here.

File details

Details for the file alsa_midi-1.0.2-cp37-cp37m-manylinux_2_12_i686.whl.

File metadata

File hashes

Hashes for alsa_midi-1.0.2-cp37-cp37m-manylinux_2_12_i686.whl
Algorithm Hash digest
SHA256 3b578c2ef79884812aefa2ee1e66daacef8dac0bae81c548bd0577c73238bd22
MD5 46ae1ac6bb683f5df76deda3b02f6bc8
BLAKE2b-256 63acabb6fd8718f17404e4fbae6242a4054159ba2a22aeff84c43f1ab4b6f9f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page