Struct launchy::launchpad_mini::Output[][src]

pub struct Output { /* fields omitted */ }
Expand description

The Launchpad Mini output connection handler.

Implementations

Set a button to a certain color.

For example to set the leftmost control button to yellow:


let button = Button::ControlButton { index: 0 };
let color = Color::YELLOW;
output.set_button(button, color, DoubleBufferingBehavior::Copy)?;

In order to make maximum use of the original Launchpad’s slow midi speeds, a rapid LED lighting mode was invented which allows the lighting of two leds in just a single message. To use this mode, simply start sending these message and the Launchpad will update the 8x8 grid in left-to-right, top-to-bottom order, then the eight scene launch buttons in top-to-bottom order, and finally the eight Automap/Live buttons in left-to-right order (these are otherwise inaccessible using note-on messages). Overflowing data will be ignored.

To leave the mode, simply send any other message. Sending another kind of message and then re-sending this message will reset the cursor to the top left of the grid.

Turns on all LEDs to a certain brightness, dictated by the brightness parameter. According to the Launchpad documentation, sending this command resets various configuration settings - see reset() for more information. However, in my experience, that only sometimes happens. Weird.

This function is primarily intended as a diagnostics tool to verify that the library and the device is working correctly.

Launchpad controls the brightness of its LEDs by continually switching them on and off faster than the eye can see: a technique known as multiplexing. This command provides a way of altering the proportion of time for which the LEDs are on while they are in low- and medium-brightness modes. This proportion is known as the duty cycle.

Manipulating this is useful for fade effects, for adjusting contrast, and for creating custom palettes.

The default duty cycle is 1/5 meaning that low-brightness LEDs are on for only every fifth multiplex pass, and medium-brightness LEDs are on for two passes in every five. Generally, lower duty cycles (numbers closer to zero) will increase contrast between different brightness settings but will also increase flicker; higher ones will eliminate flicker, but will also reduce contrast. Note that using less simple ratios (such as 3/17 or 2/11) can also increase perceived flicker.

If you are particularly sensitive to strobing lights, please use this command with care when working with large areas of low-brightness LEDs: in particular, avoid duty cycles of 1/8 or less.

This method controls the double buffering mode on the Launchpad. See the module documentation for an explanation on double buffering.

The default state is no flashing; the first buffer is both the update and the displayed buffer: In this mode, any LED data written to Launchpad is displayed instantly. Sending this message also resets the flash timer, so it can be used to resynchronise the flash rates of all the Launchpads connected to a system.

  • If copy is set, copy the LED states from the new displayed buffer to the new updating buffer.
  • If flash is set, continually flip displayed buffers to make selected LEDs flash.
  • updated: the new updated buffer
  • displayed: the new displayed buffer

All LEDs are turned off, and the mapping mode, buffer settings, and duty cycle are reset to their default values.

Trait Implementations

Initiate from an existing midir connection.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.