Lokey

Introduction

Support for MIDI controller-related functionality is provided by the lokey-midi crate.

INFO

The lokey-midi crate currently contains limited functionality. More functionality will be added in the future.

MIDI Message

The MidiMessage type can be sent via an external channel to send MIDI messages to the host. It supports USB and BLE (Bluetooth Low Energy) transports, which can be enabled with the usb and ble crate features, respectively.

Keyboard Actions

The lokey-midi crate provides actions that can be used in keyboard layouts from lokey-keyboard to send MIDI messages. This requires enabling the keyboard-actions crate feature.

Available actions:

  • MidiNote - Sends a MIDI note on/off message

Example:

use lokey_keyboard::layout;
use lokey_midi::action::MidiNote;
use wmidi::{Channel, Note, Velocity};

let layout = layout!(
    // Layer 1
    [
        // Sends a note on message when the key is pressed and a note off
        // message when it is released.
        MidiNote::new(Channel::Ch1, Note::C4, Velocity::MAX),
    ],
);

On this page