Open-source NI maschine device handling

Overview
                                     __
                                    /\ \      __
    ___ ___      __      ____    ___\ \ \___ /\_\    ___      __       _ __   ____
  /' __` __`\  /'__`\   /',__\  /'___\ \  _ `\/\ \ /' _ `\  /'__`\    /\`'__\/',__\
  /\ \/\ \/\ \/\ \L\.\_/\__, `\/\ \__/\ \ \ \ \ \ \/\ \/\ \/\  __/  __\ \ \//\__, `\
  \ \_\ \_\ \_\ \__/.\_\/\____/\ \____\\ \_\ \_\ \_\ \_\ \_\ \____\/\_\\ \_\\/\____/
   \/_/\/_/\/_/\/__/\/_/\/___/  \/____/ \/_/\/_/\/_/\/_/\/_/\/____/\/_/ \/_/ \/___/


    maschine.rs is an open-source implementation of native instruments's USB HID
    protocol for the maschine mk2 devices (and also the maschine mikro mk1).

    current support is only for the maschine mikro mk2, though support for other
    devices should be simple enough to add.

    also it only runs on linux. if you're on win/mac you probably don't need this.

    you'll need rustc and cargo to build/run. do this:

        $ cargo build --release
        $ cargo run --release /dev/hidraw0

    replace `/dev/hidraw0` with the path to your mikro mk2. you may need to tweak
    your udev permissions to have it accessible from your normal user account.

    while running, you'll have an ALSA MIDI out port which will send MIDI events
    (note on, note off, poly aftertouch) generated by playing the pads. also,
    the pads will light up while being played. it's all quite fancy.

    more devices and APIs (including some OSC for the buttons and screen) coming
    soon enough. more OS support coming probably not (but hey, be my guest).

    questions, comments, and/or poetry to 

 
Comments
  • Screen support.

    Screen support.

    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 ?

    opened by Mylab6 6
  • Unable to compile

    Unable to compile

    Hey,

    I'm trying to compile your work on Ubuntu 18.04. I've installed the following package : build-essential caro rustc. I've run cargo build --release and here is what i got :

    jugu@jugu-T450:~/maschine.rs$ cargo build --release
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Updating git repository `https://github.com/wrl/tinyosc`                    
       Compiling byteorder v0.5.3                                                   
       Compiling bitflags v0.1.1
       Compiling bytes v0.2.11
       Compiling libc v0.1.12
       Compiling rand_core v0.2.1
       Compiling winapi v0.2.8
       Compiling num-integer v0.1.39
       Compiling num-rational v0.2.1
       Compiling bitflags v1.0.3
       Compiling cfg-if v0.1.4
       Compiling winapi-build v0.1.1
       Compiling libc v0.2.42
       Compiling num-traits v0.2.5
       Compiling slab v0.1.3
       Compiling utf8-ranges v0.1.3
       Compiling num-iter v0.1.37
       Compiling pkg-config v0.3.12
       Compiling num-complex v0.2.0
       Compiling rustc-serialize v0.3.24
       Compiling num-bigint v0.2.0
       Compiling void v1.0.2
       Compiling nix v0.11.0
       Compiling regex-syntax v0.3.9
       Compiling tinyosc v0.0.3 (https://github.com/wrl/tinyosc#357bc16a)
       Compiling nix v0.3.10
       Compiling log v0.4.3
       Compiling kernel32-sys v0.2.2                                                                                                    
       Compiling memchr v0.1.11                                                                                                         
       Compiling rand v0.4.2                                                                                                            
       Compiling rand v0.5.4                                                                                                            
       Compiling time v0.1.40                                                                                                           
       Compiling alsa-sys v0.1.2                                                                                                        
       Compiling log v0.3.9                                                                                                             
       Compiling aho-corasick v0.5.3                                                                                                    
       Compiling mio v0.3.7                                                                                                             
       Compiling rand v0.3.22                                                                                                           
    error[E0277]: the trait bound `M: std::marker::Send` is not satisfied                                                               
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:57:9                                       
       |                                                                                                                                
    57 | impl<M> fmt::Debug for Notify<M> {                                                                                             
       |         ^^^^^^^^^^ `M` cannot be sent between threads safely                                                                   
       |                                                                                                                                
       = help: the trait `std::marker::Send` is not implemented for `M`                                                                 
       = help: consider adding a `where M: std::marker::Send` bound                                                                     
    note: required by `notify::Notify`                                                                                                  
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:16:1                                       
       |                                                                                                                                
    16 | pub struct Notify<M: Send> {                                                                                                   
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                     
                                                                                                                                        
    error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied                                                           
     --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:8:5
      |
    8 | /     fn readable(&mut self, event_loop: &mut EventLoop<Self>, token: Token, hint: ReadHint) {
    9 | |     }
      | |_____^ `Self` does not have a constant size known at compile-time
      |
      = help: the trait `std::marker::Sized` is not implemented for `Self`
      = help: consider adding a `where Self: std::marker::Sized` bound
    note: required by `event_loop::EventLoop`
     --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
      |
    37| pub struct EventLoop<H: Handler> {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:11:5
       |
    11 | /     fn writable(&mut self, event_loop: &mut EventLoop<Self>, token: Token) {
    12 | |     }
       | |_____^ `Self` does not have a constant size known at compile-time
       |
       = help: the trait `std::marker::Sized` is not implemented for `Self`
       = help: consider adding a `where Self: std::marker::Sized` bound
    note: required by `event_loop::EventLoop`
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
       |
    37 | pub struct EventLoop<H: Handler> {
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:14:5
       |
    14 | /     fn notify(&mut self, event_loop: &mut EventLoop<Self>, msg: Self::Message) {
    15 | |     }
       | |_____^ `Self` does not have a constant size known at compile-time
       |
       = help: the trait `std::marker::Sized` is not implemented for `Self`
       = help: consider adding a `where Self: std::marker::Sized` bound
    note: required by `event_loop::EventLoop`
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
       |
    37 | pub struct EventLoop<H: Handler> {
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:17:5
       |
    17 | /     fn timeout(&mut self, event_loop: &mut EventLoop<Self>, timeout: Self::Timeout) {
    18 | |     }
       | |_____^ `Self` does not have a constant size known at compile-time
       |
       = help: the trait `std::marker::Sized` is not implemented for `Self`
       = help: consider adding a `where Self: std::marker::Sized` bound
    note: required by `event_loop::EventLoop`
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
       |
    37 | pub struct EventLoop<H: Handler> {
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:20:5
       |
    20 | /     fn interrupted(&mut self, event_loop: &mut EventLoop<Self>) {
    21 | |     }
       | |_____^ `Self` does not have a constant size known at compile-time
       |
       = help: the trait `std::marker::Sized` is not implemented for `Self`
       = help: consider adding a `where Self: std::marker::Sized` bound
    note: required by `event_loop::EventLoop`
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
       |
    37 | pub struct EventLoop<H: Handler> {
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/nonblock.rs:67:5
       |
    67 |     fn into_non_block(self) -> Result<NonBlock<Self>>;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Self` does not have a constant size known at compile-time
       |
       = help: the trait `std::marker::Sized` is not implemented for `Self`
       = help: consider adding a `where Self: std::marker::Sized` bound
    note: required by `nonblock::NonBlock`
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/nonblock.rs:7:1
       |
    7  | pub struct NonBlock<T> {
       | ^^^^^^^^^^^^^^^^^^^^^^
    
    error[E0277]: the trait bound `M: std::marker::Send` is not satisfied
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:58:5
       |
    58 | /     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
    59 | |         write!(fmt, "Notify<?>")
    60 | |     }
       | |_____^ `M` cannot be sent between threads safely
       |
       = help: the trait `std::marker::Send` is not implemented for `M`
       = help: consider adding a `where M: std::marker::Send` bound
    note: required by `notify::Notify`
      --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:16:1
       |
    16 | pub struct Notify<M: Send> {
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    error: aborting due to 8 previous errors
    
    error: Could not compile `mio`.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    

    Could you help me ?

    opened by Jugulaire 6
  • maschine: midi_note_base can be set via OSC API

    maschine: midi_note_base can be set via OSC API

    This commit introduces the concept of a MIDI base note, to allow applications to set the lowest MIDI note that will be sent for the pads.

    This is useful if an application expects a specific "octave" to be selected, and avoids users having to manually select it.

    Documentation updated, section for midi_note_base added.

    Signed-off-by: Harry van Haaren [email protected]

    opened by harryhaaren 0
  • doc/osc_api.md: initial writeup of basic OSC API

    doc/osc_api.md: initial writeup of basic OSC API

    This commit adds a file that documents the basics of using the OSC API for lighting buttons on the Maschine hardware. Examples are provided using the LibLO "oscsend" tool.

    Signed-off-by: Harry van Haaren [email protected]

    opened by harryhaaren 0
  • Update handle.rs to work on latest Raspbian

    Update handle.rs to work on latest Raspbian

    Thank you for all of your help, to get this to build on the latest Raspbian , I had to update the following type.

    I'm not a Rust dev, so feel free to offer an alternative solution.

    Tested against Rasberry Pi OS Lite(32 bit) Released 2021-10-30.

    opened by Mylab6 0
  • Unable to get any midi events from the device

    Unable to get any midi events from the device

    I have a Maschine Mikro MK2 R2 WHT HW. I'm using Debian testing, fully updated as of today, have compiled the code and run it with the device connected to /dev/hidraw2 set with perms 0666. Once the program runs, the display on the device goes blank and all the pads turn orange. At this point I was hoping amidi -l would show the device, but it doesn't. Since I use jack, I run qjackctl, which is setup to run a2jmidid once it starts jack. Once these are running, the device appears in qjackctl's midi tab. I open kmidimon and connect it to the device, but hitting pads does not send midi events nor do the pads change color or brightness.

    I've confirmed the device functions in windows. It was quite a struggle getting the driver and software installed, but ultimately I was able to run Controller Editor, their software for managing the device, and there I can fully interact with it, e.g. set pad colors, assign CC codes to pads, etc.. I found that for it to function as a midi control surface that it has to be placed into "midi mode" by hitting shift+f1 on the device. When I do this, the board lights up and I can view events using midiview, a freeware windows midi inspection tool, as well as see that hitting keys cause the lights to react by increasing the brightness of the pad that was hit.

    My goal is to simply use this device as a midi control surface for the Ardour DAW in Linux. Ideally, it'd work the same way it did in windows in midi mode, with all the colorful interactions and stuff.

    One item of note was that when I ran the firmware updater for the device in windows, it reported it was on firmware version 9, yet 8 was listed as the latest by this program.

    Any thoughts? Thanks!

    opened by DanielCeregatti 3
  • Maschine mk2 (not mikro) support

    Maschine mk2 (not mikro) support

    Trying to use this with a regular maschine mk2. It kind of works, but I have to tweak the code a bit and a lot of buttons aren't supported.

    I'm thinking of extending the lib to add support, should I just add a device in the devices module or is this ground that has already been walked?

    opened by monomadic 2
Owner
william light
[audio dsp gui] dev in [c rust python]
william light
A cross-platform serial port library in Rust. Provides a blocking I/O interface and port enumeration including USB device information.

Note: This is a fork of the original serialport-rs project on GitLab. Please note there have been some changes to both the supported targets and which

Serialport 128 Jan 4, 2023
Rust usb-device support for ATmega chips

atmega-usbd usb_device support for ATmega microcontrollers. NOTE: This is an experimental library, and certainly not production-ready. Expect bugs, an

Adam Gausmann 20 Jan 8, 2023
Open Source terraform provider registry

Terustry Simple configurable proxy that implement terraform provider registry protocol, to build your own terraform provider private registry. How it

Open-Source by Veepee 53 Nov 24, 2022
Ector is an open source async, no-alloc actor framework for embedded devices

Ector is an open source async, no-alloc actor framework for embedded devices. Ector is an open source async, no-alloc actor framework for embedded dev

Drogue IoT 11 Dec 15, 2022
Free and open-source reimplementation of Native Mouse Lock (display_mouse_lock) in rust.

dml-rs display_mouse_lock in rust. Free, open-source reimplementation of display_mouse_lock (Native Mouse Lock) in Rust. Written because I felt like i

Tomat 4 Feb 12, 2023
An open-source Windows client for Twitch.tv

TwitchBox is a lightweight Windows client created to enhance the Twitch.tv experience. The app uses the Tauri framework, which includes a combination

Sandun Wiratunga 3 Apr 28, 2023
Open-source Rewind.ai clone written in Rust and Vue running 100% locally with whisper.cpp

mind-overflow Open-source Rewind.AI clone built with Tauri and Vue. Leverages whisper.cpp for Speech-to-Text and (wip: llama.cpp for Text generation a

Maxime Dolores 4 Aug 9, 2023
Open-source Rust Runtime for the VEX V5 Platform

vexide Work in progress high level bindings for the V5 Brain VEX SDK. Unlike other libraries for the V5 Brain, vexide doesn't use an RTOS. Instead, ve

vexide 10 May 6, 2024
A Rust crate for handling URNs.

URN A Rust crate for handling URNs. Parsing and comparison is done according to the spec (meaning only part of the URN is used for equality checks). S

null 7 Jun 25, 2022
A simple program for handling Ethiopian calendar dates.

Mek’ut’erīya A simple program for handling Ethiopian calendar dates. Installation cargo install --git https://github.com/frectonz/mek-ut-er-ya If you

Fraol Lemecha 15 Dec 20, 2022
A simple, efficient Rust library for handling asynchronous job processing and task queuing.

job_queue Setup cargo add job_queue Usage Create a job use job_queue::{Error, Job, typetag, async_trait, serde}; #[derive(Debug, serde::Deserialize,

Georges KABBOUCHI 3 Nov 30, 2023
🌲 Open the current remote repository in your browser

gitweb Some of the flags and options are subject to change in the future. Ideas are welcome. Ideas are bulletproof (V). gitweb is a command line inter

Yoann Fleury 26 Dec 17, 2022
Extracting react native app source code from apk file.

extract-myreact Extracting React Native app source code from apk file.

Aan 3 Oct 5, 2022
Rust library to scan files and expand multi-file crates source code as a single tree

syn-file-expand This library allows you to load full source code of multi-file crates into a single syn::File. Features: Based on syn crate. Handling

Vitaly Shukela 11 Jul 27, 2022
A cargo subcommand that displays the assembly generated for Rust source code

cargo-show-asm A cargo subcommand that displays the assembly generated for Rust source code.

null 193 Dec 29, 2022
Ruplacer - Find and replace text in source files

Ruplacer - Find and replace text in source files

Dimitri Merejkowsky 331 Dec 28, 2022
Source to relay.fedi.buzz: the customizable ActivityPub relay

buzzrelay A follow-only ActivityPub relay that connects to Mastodon's Streaming API. You don't need to run this yourself, just use the instance at rel

Astro 7 Jan 23, 2023
Rust stdlib-less internal base for source engine games

source-base Rust stdlib-less and msvcrt-less internal base for source engine games Info Build with cargo build -Zbuild-std If cargo can't find link.ex

null 12 Jan 23, 2023
Demo provider, source code for the Provider tutorial.

Fiberplane "Catnip" (tutorial) provider This repository contains the final code of the provider built within the "Create a Provider" tutorial. It reli

Fiberplane 4 Feb 15, 2023