-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Python 3.9+ support (Rtmidi-python) #58
Comments
Hi @theredled, thanks for the report! (which has been reported a few times) I agree this rtmidi-python might be a problem in the future if not supported anymore, but if we change this library by a replacement, we should first confirm that it works:
If you are interested, could you provide a demo It would be super interesting to have this! |
Thanks for your answer! My personal purpose would be to put it on an existing RPi beside other applications. |
Thanks @theredled! The main challenge before switching from "rtmidi-python" to any other new library is that each condition 1. 2. 3. 4. 5. 6. 7. is still preserved. Very often I'm used to the fact that the devil is in the details :) |
Side note, |
Doesn't seem to buildable on windows without VC++ : https://spotlightkid.github.io/python-rtmidi/install-windows.html If it remains really important to you, do you mind if I do a fork with updated dependencies and without that Windows requirement? |
@theredled Thanks for your feedback. Yes some people use SamplerBox on Windows. (I personally work on both Linux and Windows). Also some people still use SamplerBox with RPi2 and not-latest versions of Raspbian/RPiOS (so they don't have Py 3.12, but rather 3.7 or 3.8). I mistyped my previous message, here is the correct version: "easily I mean someone without VC++ installed should be able to
I don't think it's a good idea to drop a platform, I built everything to be as cross-platform as possible ;) Can you provide a small |
Hi @josephernest! Do we agree that:
Extra question, why are non-dev people using samplerbox on windows? Isn't designed to be a RPi software? Why wouldn't we release current version (1.0) and then make a new release (1.1, 2.0 ?) that trade "Compatible with Windows for non-devs" requirement for "Compatible with recent software"? |
As for import rtmidi, time
def MidiCallback(message, time_stamp):
print(message)
midi_in = [rtmidi.MidiIn()]
previous = []
while True:
all_ports = midi_in[0].get_ports()
for port_num,port in enumerate(all_ports):
if port not in previous and 'Midi Through' not in port:
print('new ports found in : ', all_ports)
midi_in.append(rtmidi.MidiIn())
midi_in[-1].set_callback(MidiCallback)
midi_in[-1].open_port(port_num)
print('midi_in', midi_in)
print('Opened MIDI: ' + str(port))
previous = midi_in[0].get_ports()
time.sleep(2) |
I agree this rtmidi-python might be a problem in the future if not supported anymore, but if we change this library by a replacement, we should first confirm that it works: for Py 3.7-3.8 on RPi (many people still use this on currently working sytems) It would be super interesting to have this! |
Why did you c/p 2nd post ? |
@theredled I did not, @Hurtknight seems to be a spam bot. I haven't had time to answer your other messages, I'll do it in the next days. |
No pb! |
For the record, I forked a Python 3.9-compatible and a bit rewritten/refactored version : https://github.com/theredled/SamplerBox |
As far as I can see rtmidi-python now supports all current python versions? |
That's |
Argh ... who chooses names like this ;) |
@dosas The main challenge before switching from "rtmidi-python" to any other new library is that these conditions are preserved, in particular:
Did someone test this thoroughly with These were very important design conditions at the start of the project (many people are using multiple MIDI devices at the same time and/or hot-plugging of new MIDI devices on the fly. Example: you start SamplerBox, then you plug a new USB MIDI keyboard => it should be recognized. This is guaranteed with |
I cannot test it at the moment because I have no midi keyboard/controller available. @josephernest I would assume as maintainer/owner of the project you probably have some different raspberry pi models Would you mind installing the code from the PR and testing items 5 and 6?
I get that you want to keep the features as is but what is the exit strategy here? Have a deprecated and continuously less usable project with the full feature set or have an up to date and usable project with a slightly reduced feature set? With this PR the feature set is kept as is for the 'old devices' (depending on the python version) and the 'new devices' will work with a possible slightly reduced feature set. |
After analysis, I notice superquadratic/rtmidi-python works very well with Python 3.9+. See solution here: superquadratic/rtmidi-python#25 Therefore no need to change the MIDI library for SamplerBox. What I've learnt from decades of programming is that changing one dependency (that worked perfectly during 10 years) to a very-similar-one often brings surprises, and other unexpected things, that are complicated to solve. Therefore, since I will update the installation instructions for Python 3.9+ soon. |
Solution:
Thank you @theredled @dosas @mojca for having reported this. |
That does not seem to work for me.
|
@mojca The installation instructions, and SamplerBox support in general, have always been for x86-64 Linux and RaspiOS (arm). For Windows, but you're a bit more on your own (as it has always been) 😉 Now the solution, tested right now with Windows 10, Python 3.11, Cython 3.0.10 : instead of the
I just updated the documentation accordingly. Happy that it finally works for Linux, RaspiOS, and Windows! 🎉 |
BTW: I tested it with |
Required
rtmidi-python
is a 2014 library.Therefore, it's not working anymore with Python >= 3.9 (https://stackoverflow.com/questions/71410788/pip-failed-building-wheel-for-rtmidi-python-subprocess-exited-with-error-and-le).
Problem is current Python version is 3.12, and even Raspberry Pi OS legacy version (11 Bullseye) is bundled with Python 3.9.
Any idea to get around this?
The text was updated successfully, but these errors were encountered: