Skip to main content

Midi Wrapper

This package contains classes that wrap the Pygame Midi class to allow selection of a midi input device, and simple polling of said device with predefined classes to help interpret the signals.

This implementation is limited in that it is only polling for one event per poll instead of multiple events, as such it will pull one at a time.

Polling for multiple events in one frame may be supported in future.

Usage

from pygame import midi
from midi_wrapper import MidiMenu, MidiDevice

# Boiler plate midi initialization for pygame midi
midi.init()

if (midi == None):
	print("Error initializing midi.")
	exit(-1)

# Initialize the menu to start device selection, then pass to device to get reference
midi_menu = MidiMenu(midi)
midi_device = MidiDevice(midi, midi_menu)

# Bog standard polling loop
while True:
	# Returns None if no events received or a MidiData type if an event is found
	midi_data = midi_device.poll_device()

	if midi_data != None:
		midi_event = midi_data.event
		print(f"Clock: {midi_data.clock} :: Name: {midi_event.name} :: Channel: {midi_event.channel} :: Data: {midi_event.data}")

Release files for midi-wrapper-SnooperXP 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for midi-wrapper-SnooperXP 0.0.5
File Size Uploaded
midi-wrapper-SnooperXP-0.0.5.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for midi-wrapper-SnooperXP 0.0.5
File Interpreter ABI Platform
midi_wrapper_SnooperXP-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / midi-wrapper-SnooperXP-0.0.5.tar.gz

Download URL midi-wrapper-SnooperXP-0.0.5.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aa116daf44ae6496e606dc41081aab5503ae137dd666e96e1d0681c82a26cc4b
BLAKE2b-256 checksum
How to use checksums
7306f69d3c9a8399ba6abaa40aa190f7119145224c133b8e058a8da559223bfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

Release files / midi_wrapper_SnooperXP-0.0.5-py3-none-any.whl

Download URL midi_wrapper_SnooperXP-0.0.5-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de0c863a0a1d583daaf14ffebffd387183eded7295c809a5dddbc2b0b1f602b3
BLAKE2b-256 checksum
How to use checksums
f4f8bb61a31c5f87b46d163c7063ef3ace082a2fb04624476896bab673aa4cb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page