Skip to content

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).

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.

3 participants