[PATCH] add python-rtmidi

  • Open
  • quality assurance status badge
Details
2 participants
  • Rick Huijzer
  • jgart
Owner
unassigned
Submitted by
Rick Huijzer
Severity
normal
R
R
Rick Huijzer wrote on 16 Jul 17:23 +0200
(address . guix-patches@gnu.org)(name . Rick Huijzer)(address . ikbenrickhuyzer@gmail.com)
20240716152423.17557-1-ikbenrickhuyzer@gmail.com
---
I've run guix lint and should be fine. I'm having a bit of a hard time with formatting so I will probaby have to recreate the perfect setup from the documentation.
Packaging python-rtmidi in an effort to bring a complete DMX workflow to guix.

gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

Toggle diff (41 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4d7ddeb9d7..8f8cf4a1a8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24710,6 +24710,32 @@ (define-public python-sacn
a network.")
(license license:expat)))
+(define-public python-rtmidi
+ (package
+ (name "python-rtmidi")
+ (version "1.5.8")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "python_rtmidi" version))
+ (sha256
+ (base32 "1yh4s124awzwhfg49m8s6qsa58qxabljlmnb1q00kbk8n1ldx6kz"))))
+ (build-system meson-build-system)
+ (inputs
+ (list glibc
+ python-cffi
+ jack-2
+ boost
+ rtmidi))
+ (native-inputs (list python python-pytest pkg-config python-setuptools))
+ (home-page "https://pypi.org/project/python-rtmidi/")
+ (synopsis "Python bindings for RtMidi")
+ (description
+ "Python-rtmidi is a Python binding for RtMidi, a set of C++ classes that provides
+ a common API for real-time MIDI input/output across Linux (ALSA & JACK), macOS,
+ and Windows (Multimedia Library).")
+ (license license:expat)))
+
(define-public python-bagit
(package
(name "python-bagit")

base-commit: 3c58b759a51072aabd7eaaca680674a0c2b36c23
--
2.45.2
R
R
Rick Huijzer wrote on 18 Jul 17:10 +0200
[PATCH v1] Fix formatting, boost not needed in python-rtmidi
(address . 72142@debbugs.gnu.org)(name . Rick Huijzer)(address . ikbenrickhuyzer@gmail.com)
09a92b6a22245646ca2b51ac5059c5fca54ee0f7.1721315431.git.ikbenrickhuyzer@gmail.com
Change-Id: I96127532b959bec2995180d8c0838595c0943a62
---
Sorry; this is a fixed patch. Still trying to use pytest, but haven't found a nice way to add the add-installed-pythonpath logic, which is not present in the meson-build system
gnu/packages/python-xyz.scm | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4ac585c8d9..a46d36790b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24765,24 +24765,19 @@ (define-public python-rtmidi
(package
(name "python-rtmidi")
(version "1.5.8")
- (source
- (origin
+ (source
+ (origin
(method url-fetch)
(uri (pypi-uri "python_rtmidi" version))
(sha256
(base32 "1yh4s124awzwhfg49m8s6qsa58qxabljlmnb1q00kbk8n1ldx6kz"))))
(build-system meson-build-system)
- (inputs
- (list glibc
- python-cffi
- jack-2
- boost
- rtmidi))
+ (inputs (list glibc python-cffi jack-2 rtmidi))
(native-inputs (list python python-pytest pkg-config python-setuptools))
(home-page "https://pypi.org/project/python-rtmidi/")
(synopsis "Python bindings for RtMidi")
(description
- "Python-rtmidi is a Python binding for RtMidi, a set of C++ classes that provides
+ "Python-rtmidi is a Python binding for RtMidi, a set of C++ classes that provides
a common API for real-time MIDI input/output across Linux (ALSA & JACK), macOS,
and Windows (Multimedia Library).")
(license license:expat)))

base-commit: c3cdb2b4057a2c2e8e7be1e320784431f0f671ae
prerequisite-patch-id: f1cc8a724ee8010966de580066164220f481deff
--
2.45.2
J
4db0c6bee26cf01e8c72bed6d3a2c53df6a8781e@dismail.de
Toggle quote (2 lines)
> + (inputs (list glibc python-cffi jack-2 rtmidi))

Hi, since this is a Python library, do we want to make the Python inputs propagated?

Were you able to test in a shell that the following works fine when run from a script or repl?

If not, can you test that and report back on the results. I'll give it a try after.

Or, how have you gone about testing that this package works in a Guix environment with all the system audio requirements?


```python
import time
import rtmidi

midiout = rtmidi.MidiOut()
available_ports = midiout.get_ports()

if available_ports:
midiout.open_port(0)
else:
midiout.open_virtual_port("My virtual output")

with midiout:
note_on = [0x90, 60, 112] # channel 1, middle C, velocity 112
note_off = [0x80, 60, 0]
midiout.send_message(note_on)
time.sleep(0.5)
midiout.send_message(note_off)
time.sleep(0.1)

del midiout
```

all best,

jgart
R
R
Rick Huijzer wrote on 18 Jul 22:54 +0200
[PATCH] add python-rtmidi
(address . 72142@debbugs.gnu.org)
CAGXOz9YsWOQAxLEbbKXfFisM3KUGS06gD36bDq86tdN5qjWEwQ@mail.gmail.com
Hi,

I will look into the propagated inputs question. Indeed looking at the
documentation python does not belong there.

Your example works at a foreign distro using guix (Fedora) with jack, which
is where I've tested the declaration. On Guix system it seems to work when
using the PipeWire Home Service, but I can't get it to work with the
standalone jack2 just yet. So that's something I've got to look into as
well.

It wasn't my intention to submit a poorly working patch, sorry. Somewhere
next week probably I will compose a new patch revision.

--
Kind regards,

Rick Huijzer
Attachment: file
R
R
Rick Huijzer wrote on 6 Aug 15:28 +0200
(address . 72142@debbugs.gnu.org)
CAGXOz9Y5W4+yXWQfxKOWDYtPnQ-MvA-Ze-5vtLQTwBVUxHnNdw@mail.gmail.com
Hi,

I've installed guix-system and did some further testing:

The package seems to work just fine when properly installing jack2,
pipewire (pw-jack) or jack on guix-system (and Fedora). It's possible to
put jack (v1) in the propagated inputs, but that's not that elegant I
suppose. Furthermore all the audio packages I could find in guix include
jack in the same way, at build time and not as a propagated input.

I cannot test this with actual midi hardware, only with the
midiout.open_virtual_port method. But for my use case (using the OLA
suite), the library works fine, even when using real DMX controller
hardware.

So after testing and configuring my system properly, I have found no reason
for a revised patch. If you or someone else wants to take a look at this
patch, please do.

Thanks.

--
Kind regards,

Rick Huijzer
Attachment: file
R
R
Rick Huijzer wrote 5 days ago
(address . 72142@debbugs.gnu.org)
CAGXOz9ZOR4SggovKEFX8PjM_qaVfmOYq0Vqtpf_t_DV6PmM_dQ@mail.gmail.com
Hi,

Could someone have a look at this? It builds and works. Feedback is much
appreciated.

--
Met vriendelijke groet,

Rick Huijzer
Attachment: file
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 72142@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72142
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch