-
Notifications
You must be signed in to change notification settings - Fork 36
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
[WIP] Support for Maschine MK3 #9
Comments
A bit of success: I can now make |
Okay, I got the buttons working (partially). My c++ is very rusty, so I need to figure out how the mapping in cabl works. I added debug outputs to both the I now have a partial map of buttons, some buttons didn't output anything, so I guess the index list is wrong. I also tried to modify the button list in |
That's good news, I didn't really have time so far to work on the Mk3 support :) |
I'm on to the display support. I've captured frames via Wireshark and usbpcap. What I know so far is documented in this google doc: https://docs.google.com/document/d/1xdWTY4XAMPFj8dKzvZJnUyJy-SxdZiPVdcSUw1nVl8A/edit?usp=sharing Feel free to read and comment if you find something interesting ;) |
Great job @FELICITUS, that was really quick :) |
@shaduzlabs not yet. Right now I only have a PHP script to convert a 480x272 image to a data file and a python script to send the raw data to the interface. If you want both the python and the PHP script tell me :) There's more to the protocol, but right now I just send the raw pixel data using command code 1 to the device. Command code 2 supports pixel repetition, maybe there are other command codes. I also gotta clean up the documentation |
I can finally watch anime on the Maschine MK3 ;) |
A few words on the protocol: It's basically a bunch of commands being sent to the display. Format is RGB565. Right now I found two commands: first 16 bytes: Header, which includes the display to address as well as X/Y start position and the width/height of the transmission. After that commands are following. Each command header is 4 bytes long. The first of that 4 bytes is the command code and the next 3 are parameters. Command Code 00: Sends the next two pixel values to the display. Parameters are all zero. Data is two pixels with 2 bytes each |
Documentation for the display protocoll can now be found here: https://github.com/Drachenkaetzchen/cabl/tree/develop/doc/hardware/maschine-mk3 Will send a PR as soon as I got the code working. |
I just added documentation for the HID protocol, including touch strip, touch sense knobs and all LEDs. Fun fact: The Maschine MK3 even knows the physical state of the volume knobs on the back. |
I now have a preliminary version in my repository. However, currently it's very unlikely that I'll finish support, since my C++ isn't that strong anymore and my holiday is almost over. There are a few things to consider:
|
Wow! Kudos for this seriously impressive work :) Now I'll be able to add support for Komplete Kontrol MK2 and Maschine Studio as well since they use the same display protocol. |
@shaduzlabs have there been any updates? |
@Drachenkaetzchen amazing work with that documentation regarding the mk3!! |
@shaduzlabs |
@Drachenkaetzchen @shaduzlabs https://youtu.be/NPPl5OQnLEg @Drachenkaetzchen : I have some different behavior of the screen selection part of the header . If interested I can post the differences. After that fix i can send a full display update at ones (Wireshark reports 261175 bytes ? ). (windows 10 Visual C++ + libusb). Plus I get some strange behavior with some part of the end packets (any help really appreciated) |
Do you think this would work on a Komplete Kontrol mk2? |
@spacepluk the screens look the same so my short answer is yes. Long Answer : Probably some code tweaks must be done. The protocol must be kinda similar but the |
I have a s61 mk2 here. I'll give it a try this weekend. |
@ mpex2006km Did you alter any of the original code to have it working on the S5? |
@3phase33 What do you mean by that . Original code from native ? or from CABL. Native : Did not use any of their code not even the driver. (it doesn't let me access the USB interface ) But all code is written from scratch in visual c++ and hours in wire shark |
@mpex2006km Thanks for the quick reply. |
If it's any help, I have a branch/fork of node-traktor-f1 at https://github.com/asutherland/node-traktor-f1/tree/maschine-mk3 based on Drachenkaetzchen's work here that is able to display stuff on the screens of Mk3's and Traktor Kontrol D2 using node.js. Note that if you send the Mk3 packets it doesn't like, it may need to be power-cycled before it will start responding correctly to well-formed packets. |
@asutherland My S5 did not have any problems like this . I sent a lot of "bad" packets but i was unable to make it unrecoverable. As soon as i send a good packet the screens go back to normal. One question do you have any video of the displays while you load the software . I had a strange effect of hole display turning white for a burst of time but then goes back to normal. This only happens some times only on loading. I am wondering what is so different between the protocol of MK3 is compared to S5. The packets in wireshark look the same . Did you use the native instruments driver and if yes in what os ? Thank you very much in advance (again @Drachenkaetzchen documentation helped a lot) |
It may have been a situation where the Mk3 was expecting a packet size of N and while experimenting I sent it <N and so the effective phase of the packets was messed up once I corrected it to N. It may also just be that I run linux and the USB subsystem was sad.
I haven't seen anything like that across 2 Mk3's and the one D2 in general use or in a video I just took and slowmo scrubbed across. The displays start initialized to showing "Maschine" and "Production and Performance System" in white text on a black background. My software then sends images derived from HTML with a black background, and there's no blanking flicker or anything like that.
Just Ubuntu Linux using libusb with udev permissions set like https://github.com/node-hid/node-hid#udev-device-permissions suggests. |
@asutherland Any hints on how i could go about testing this out? |
In the interest of not getting too off-topic on this issue, I've enabled issues on https://github.com/asutherland/node-traktor-f1 and changed the default branch to be the maschine-mk3 one. Feel free to open an issue there if you want to elaborate on your use case (what NI device you want to work, what OS you're trying to interface with it on, what you're generally trying to achieve, etc.) and I'll see what advice I can give. |
@asutherland Thanks. |
I'm currently working code for Maschine Studio. Note that the end differs. Question: The display number does not work, i get it work on the left screen only not on the right. Any ideas?
Any ideas welcome. |
I wrote a litte program in C++:
It clear and draws on booth displays. |
Amazing stuff, @cap4096. I wonder whether it would be feasible to take an free software GUI (e.g. Rasterman's EFL) toolkit and add an output renderer to it. That way we would get a whole lot of stuff for free (advanced text rendering, geometric primitives, alpha blending, etc.)�. |
You probably could, but I think the limited display sizes requires some "minimalistic" GUI toolkit to produce a usable GUI. Also I think that if you have a "flat" theme on the GUI it is possible to compress the image transfer. I have not tried that yet but I think that is what the protocol is made for. |
So glad to see there is still current work going on with this! |
Just to mention it for those who are (still) interested in using the Native Instruments devices for other stuff: I've reverse engineered the proprietary (ipc) protocol which Native Instruments is using for talking to their daemons/services called "Native Instruments Hardware Agent" (NIHA) and "Native Instruments Host Integration Agent" (NIHIA). They are running as service on Windows and as Agent/Daemon on MacOS. Why is that maybe interesting? To use the devices (Maschine MK2, MK3, Komplete Kontrol MK2, ....) for different purposes NIHA/NIHIA have to be killed and a direct USB connection to the devices is needed - but that also kills the possibility to use "Maschine" and "Komplete Kontrol" in parallel. That's possible now via the (ipc) connection to NIHA/NIHIA. I'm currently writing a cross platform (well, Windows and OS X) C library and golang based OSC gateway using that library which can be integrated in any other applications.
just showing some knob/button and display instance control. My assumption is that the protocol exists at least since 2012 and is deeply integrated into the software stack of NI (and maybe not easily changeable). I know that it's working with the KK MK2 S61, Maschine MK3 and Maschine Mikro MK2 but I assume that it's also working with:
but I can't test it yet due to missing hardware. We'll try to test this in further beta stages or after public release. Not sure about a timeframe but there are some additional ideas for the future:
Bugs known: horrible slow regarding the displays but that's known due to massive debug stuff and some functions which are currently implemented temporarily on the Lua script side. Next alpha/beta will be released to interested users within June - I've implemented a JsonRPC API and some first commands (sendLedData, sendDisplayData). Need to test that on Windows now... Maybe first public release, not sure yet. If anybody is interested drop me a message/comment here. |
I'm still interested – and although I currently don't have a free NI device for experimenting, I'll keep an eye on their product line and may buy the next MASCHINE & KK incarnation. |
Hey Terminar (Björn) - the code which interfaces with NIHardwareAgent to drive the displays... Do you have it shared anywhere? |
Also... Anyone here keen on collaborating on a full Bitwig controller script integration into Maschine via the NIHardwareAgent IPC protocol? |
@maranite yes, both. |
oooo... a bitwig controller with this would be amazing |
I have already success with some cases in this direction. Work in progress :) |
Hi. I don't have discord. Is there any update on this project or where it's headed please? |
This issue documents my findings about the Maschine MK3.
Basic Information from
usb-devices
if#=5 is bulk data, maybe for the displays?
if#=6 seems to be for the firmware update.
The text was updated successfully, but these errors were encountered: