MPK-M2-editor icon indicating copy to clipboard operation
MPK-M2-editor copied to clipboard

Problem with installing requirements.txt (Debian 12.1)

Open bazilmuzik opened this issue 2 years ago • 7 comments

I downloaded all project files as .zip, unzipped them and opened a terminal in the downloaded folder. I ran the first command line in the Readme, no problem.

Then, I tried to run the command pip install -r requirements.txt as suggested, and got an error saying it's an "externally managed environment"

After looking online for a solution, I tried pipx install requirements.txt But then an error says that there's no version that satisfies requirements.txt (no version found)

I must say I've never used python related commands so I may have missed steps that aren't mentioned but are essential.

To add a bit more context:

I received an MPK mini from a friend, and want to make it to work inside Pure Data. In a sense, I don't really need the editor to map pads, keys and knobs, as I will need to do it myself in Pure Data anyway.

The only thing I'd like to do is to set the arpeggiator clock to "external", in order to synchronize the MPK mini with Pure Data. Is there any SysEx message that could to the job ? How is this specific parameter implemented in your editor ? This would be an even better solution for my setup.

Thanks in advance !

bazilmuzik avatar Aug 17 '23 20:08 bazilmuzik

Hi, This issue is new for me as well. I assume it’s coming either from a Python update, or more likely to the OS I use (Ubuntu Linux).

For me the issue (and I assume it is the same for you) is that the OS I use already has Python packages available through its package manager. To avoid conflicts between OS-installed packages and pip-installed ones, the default behaviour from Python is to forbid installations using pip. But you may still be able to install the packages from your package manager. If you use Ubuntu, try this:

sudo apt install python3-rtmidi python3-pyqt5

If you use another OS or distribution, these packages may still be available under a different name from your package manager.

If you cannot find them, you could still try one of the solutions outlined in this answer. There might be possible risks of breakage, but this worked for me:

pip install -r requirements.txt --break-system-packages

The sysex messages for the controller set the entirety of a program at once, you can’t really just edit one parameter as far as I know. You’d need to read the current programme, edit the value you want, then send it back — which is basically what this editor does!

PiOverFour avatar Sep 06 '23 18:09 PiOverFour

Oh, interesting ! So the way a sysex message is written is in "one shot" with all parameters... I made many tests yesterday with the "amidi" commend line, and I receive little sysex messages when I press keys, turn knobs... But nothing appears when I put the arpeggiator on, or push "prog change" (in short, anything that isn't cc or note). That's why I'm a bit confused... Also I'm unable to read an entire program. Maybe "amidi" isn't the tool I need, but there's few informations about sysex messages on the internet, and even less so with this specific device. How were you able to see these infos ? Can you recommend some tools ? I will also try the solution for the python problem, at least see if I can make your editor work !

bazilmuzik avatar Sep 12 '23 12:09 bazilmuzik

But nothing appears when I put the arpeggiator on, or push "prog change" (in short, anything that isn't cc or note).

IIRC the sysex I’m referring to only appear when you exchange programs with the editor, by pressing Get/Send Current/All/RAM. The arpeggiator or prog switch only change the operation of the controller, but don’t require sending any data to the computer.

How were you able to see these infos ? Can you recommend some tools ?

I used WireShark at the time I wrote this program, but honestly I pretty much forgot how it works since then. :sweat_smile: However I have documented what a config looks like in the code: each line gives you the expected value or range of values, and what it does.

I will also try the solution for the python problem, at least see if I can make your editor work !

I hope it works for you!

PiOverFour avatar Sep 12 '23 13:09 PiOverFour

Hurray !

So first I tried to send the message that is in init, and nothing worked. I was almost giving up, but out of curiosity I tried to send the GET_CONFIG message, and finally something appeared in my PureData console. After analyzing the values I was seeing, I realized they were the "same" as what I observed in your init method (well, not exactly the same, but same number of bytes, same type of values, etc.). At this point it was pretty obvious I wasn't far from my goal.

After spending some more time not being able to set a program via a sysex message, I saw that the 5th byte ("sysex_4" in your init method, which is set to 103) could be set to 100 (which is a "send" command). So I tried to replace "103" by "100" and changed some parameters and... it worked (well, last step was to use the "Prog Select" button to reload Program 1) !!! I saw the octave down button getting red 4 times without pressing on it :) And now I'm able to synchronize my MPK 2 mini with Pure Data !!!

From all the research I've done before contacting you, I saw there wasn't a lot of documentation (if any) about sending sysex messages with Pure Data. I think I might do a youtube tutorial or a blog post about it. Would you agree to be cited ? It won't be for tomorrow so no urge to respond, but it is clear that I wouldn't have been able to do it without your well commented code :)

bazilmuzik avatar Sep 18 '23 21:09 bazilmuzik

Hurray !

Awesome :sunglasses:

(well, last step was to use the "Prog Select" button to reload Program 1)

This should not be needed if you use Send RAM, which can modify the current state of the controller without editing any program, and without you needing to reload it. This would be done with (102, 0) as sysexes 4 and 5.

Would you agree to be cited ?

Of course, I’m glad it could be of help :) Let me know when you publish it.

PiOverFour avatar Sep 18 '23 21:09 PiOverFour

This would be done with (102, 0) as sysexes 4 and 5

Wait, seriously ? I'll test that later ! This is incredible because Pure Data has now a "child" (PlugData) which is more or less the same thing but can be opened as a vst... This means we should be able to automate state of controllers through a DAW... crazy stuff !!!

Great, I'll let you know when I'm doing this tutorial :)

bazilmuzik avatar Sep 19 '23 12:09 bazilmuzik

Well this time I wasn't lucky...

I tried to replace (100 0) by (102 0) in my message but it didn't change current state. I simply received the full program values in my console. It's like as soon as there's (102), the sysex is interpreted as a query, not a "send" command. Is it possible that other bytes need to be changed ?

Also I tried to mess around with the message, deleting some stuff, going back to (100) instead of (102)... I "succeeded" to make the octave up button blinking as if it was the tap tempo button... I guess I ended up somewhere random in the RAM, but I stopped there because I didn't want to mess everything up haha

bazilmuzik avatar Sep 20 '23 13:09 bazilmuzik