Struct launchpad::LaunchpadMk2 [] [src]

pub struct LaunchpadMk2 { /* fields omitted */ }

A Launchpad Mark 2 Device. This library requires the PortMidi device used to create the launchpad to have the same lifetime. If we create the PortMidi device ourselves, hold it. Otherwise, trust the implementer to not destroy it (or further calls will fail (sometimes silently?))

Methods

impl LaunchpadMk2
[src]

Attempt to find the first Launchpad Mark 2 by scanning available MIDI ports with matching names

Attempt to find the first Launchpad Mark 2 by scanning available MIDI ports with matching names. Bring your own PortMidi.

Set all LEDs to the same color

Set a single LED to flash. Uses a smaller header than flash_led or flash_leds with a single item

Set a single LED to pulse. Uses a smaller header than pulse_led or pulse_leds with a single item

Set a single LED to a palette color. Use light_single instead, its faster.

Set LEDs to a certain color. Up to 80 LEDs can be set uniquely at once.

Light a column of LEDs to the same color.

Light columns of LEDs to the same color. Each column may be set to a unique color. Up to 9 columns may be set at once.

Light a row of LEDs to the same color.

Light rows of LEDs to the same color. Each row may be set to a unique color. Up to 9 rows may be set at once.

Begin scrolling a message. The screen will be blanked, and the letters will be the same color. If the message is set to loop, it can be cancelled by sending an empty scroll_text command. String should only contain ASCII characters, or the byte value of 1-7 to set the speed (\u{01} to \u{07})

Experimental. Try to set an LED by the color value in a "fast" way by by choosing the nearest neighbor palette color. This is faster because setting an LED using palette colors is a 3 byte message, whereas setting a specific RGB color takes at least 12 bytes.

Retrieve pending MidiEvents