Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for python-rtmidi #62

Closed
wants to merge 1 commit into from
Closed

Conversation

dosas
Copy link

@dosas dosas commented Apr 23, 2024

There seems to be quite some interest (and also confusion) from the community about using up to date rpi images and python 3.9 :

This PR adds the possibility to use python-rtmidi while keeping backwards compatibility to rtmidi-python

The apt package libasound2-dev is an additional requirement

Thanks to @theredled for the code snippet

Due to the lack of a midi keyboard / input device I used the following code to test on a raspberry pi 1 with Python 3.9.2

import time
import rtmidi

midiout = rtmidi.MidiOut()
midiout.open_virtual_port("My virtual output")
time.sleep(2)
note_on = [0x90, 60, 112] # channel 1, middle C, velocity 112
note_off = [0x80, 60, 0]
midiout.send_message(note_on)
time.sleep(1)
midiout.send_message(note_off)

Works nicely!

Also tested on debian bookworm (Python 3.11.2) x86-64

To better handle the distinction between 'old' and 'new' python versions I created a follow up PR #63

@dosas dosas changed the title Add support for rtmidi-python Add support for python-rtmidi Apr 23, 2024
@dosas dosas mentioned this pull request Apr 23, 2024
@josephernest
Copy link
Owner

Good idea @dosas, for the requirements on switching the MIDI library, see #58 (comment).

README.md Show resolved Hide resolved
while keeping backwards compatibility to rtmidi-python
@josephernest
Copy link
Owner

Thank you for the PR but this is not needed anymore - we can keep rtmidi-python since it works perfectly well with Python 3.9+, see #58.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants