wrl/maschine.rs

Screen support.

Mylab6 opened this issue · 6 comments

Hi, I have an old Mikro and I'm trying to turn it into a wireless midi controller. If I could get the screen to work as well( from a Raspberry Pi ) that would open up tons of possibilities .

Do you know what this would entail ?

Hi @Mylab6,

The code here already supports screen blanking; https://github.com/wrl/maschine.rs/blob/trunk/src/devices/mk2/mikro.rs#L299

Further the Ctlra library (disclaimer; I'm the author) supports some screen blitting too:
https://github.com/openAVproductions/openAV-Ctlra/blob/master/ctlra/devices/ni_maschine_mikro_mk2.c#L469

Overall, its just a bitmap (1 = on, 0 = off) screen of ~8192 pixels IIRC. The way to "blit" the image is in 4 seperate writes to the USB endpoint, see https://github.com/wrl/maschine.rs/blob/trunk/src/devices/mk2/mikro.rs#L307 or https://github.com/openAVproductions/openAV-Ctlra/blob/master/ctlra/devices/ni_maschine_mikro_mk2.c#L507.

I've had various Maschine's working with RPi before, using the newer RPi's (with better performing USB implementations) will give better results. I could only get about 5 to 10 FPS on the Maschine Mk3 (with 2x full colour 420x272 px screens) on the RPi 4. I guess with a much simpler (1 bit per pixel) interface like the Mikro Mk2 has, it should work fine.

Hope that helps, -Harry

Thanks Harry, I'm actually a bit stuck even getting the PI to see Maschine's USB connection , if you could assist in automating getting the PI to find Maschine, I'd greatly appreciate it !

I'd like to add an auto-setup script for Machine to my existing repo which automatically sets up Midi wireless.

https://github.com/Mylab6/PiBluetoothMidSetup

@Mylab6; there's nothing "special" about how a RPi uses a USB device vs normal linux. Following the instructions on the README page, https://github.com/wrl/maschine.rs/ says run cargo run --release /dev/hidraw0 and replace hidraw0 with hidrawX where X comes from the output of dmesg (look at dmesg 5 secs after plugging it in, it will list what hidraw it allocated for the device).

Thanks, I think I'm close , but I'm stuck on this error.

 Running `target/release/maschine /dev/hdraw3`

thread 'main' panicked at 'couldn't open /dev/hdraw3: No such file or directory', src/main.rs:385:21
stack backtrace:
0: rust_begin_unwind
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
1: std::panicking::begin_panic_fmt
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
2: maschine::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

@Mylab6; did you typo the /dev/hdraw3? It should be hid not hd. The "no such file or directory" error suggests that...

Thank you !

I have it working via Bluetooth Midi.