Skip to content

Review, per your request#1

Open
piquan wants to merge 4 commits into
krid:mainfrom
piquan:feature/review
Open

Review, per your request#1
piquan wants to merge 4 commits into
krid:mainfrom
piquan:feature/review

Conversation

@piquan

@piquan piquan commented Aug 19, 2024

Copy link
Copy Markdown

There's a few changes I'd suggest. You've got a few hardcoded values, like in the shebang line, that might not be appropriate for widespread use.

I also cleaned up the MIDI port connection code. Previously, it would connect to the first MIDI device. Now, it lets the user specify the controller name. But I didn't have a two-way MIDI device handy, so I couldn't entirely test that code. I suggest you test it before you merge.

I put this in a few separate commits if you prefer to cherry-pick stuff.

piquan added 4 commits August 19, 2024 02:55
Update copyright.

Set the interpreter to use $PATH.

Add requirements.txt.

Add comments about where to get the correct mapping values.
Use errno.ENODEV instead of hardcoded 19.

Use a struct.Struct object instead of an inline format and a hardcoded
size that are 50 lines apart.

May as well use functools.cache instead of functools.lru_cache on
somewhat more modern Python.
In joymapper, let the user specify a different controller device than
/dev/input/js0.

In midimapper, let the user specify the name of the MIDI controller
they want to communicate with.  Clarify the port-wrangling code.  As
before, we still default to the first device, which is what ALSA (at
least, the alsa_midi library) considers the most usable.

I don't happen to have the controller that Dirk uses, so I haven't
tested all of that code yet.
@piquan piquan changed the title Review Review, per your request Aug 19, 2024
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.

1 participant