Giter VIP home page Giter VIP logo

launchpad's Introduction

launchpad

<img src=“https://travis-ci.org/thomasjachmann/launchpad.png?branch=master” alt=“Build Status” />

This gem provides a ruby interface to access novation’s launchpad programmatically. LEDs can be lighted and button presses can be responded to. Internally, launchpad’s MIDI input/output is used to accomplish this.

The interfaces should be rather stable now (sorry, I changed quite a bit since the last release), so experiment with them and comment on their usability. This still is work in progress. If you need anything or think the interfaces could be improved in any way, please contact me.

Sometimes, the launchpad won’t react to anything or react to/light up the wrong LEDs. Don’t despair, just dis- and reconnect the thing. It seems that some (unexpected) MIDI signals make it hickup.

More Info

If you don’t know what launchpad is, visit:

If you’re into other languages or want to know what goes on behind the scenes MIDI wise, have a look at:

Requirements

Compatibility

The gem is known to be compatible with the following ruby versions:

  • MRI 1.8.7

  • MRI 1.9.3

  • MRI 2.0.0

Installation

The gem is hosted on RubyGems, so in order to use it, you’re gonna gem install it:

gem install launchpad

Usage

There are two main entry points:

  • require ‘launchpad/device’, providing Launchpad::Device, which handles all the basic input/output stuff

  • require ‘launchpad/interaction’ or just ‘launchpad’, additionally providing Launchpad::Interaction, which lets you respond to actions (button presses/releases)

This is a simple example (only requiring the device for output) that switches on all LEDs (for testing), resets the launchpad again and then lights the grid button at position 4/4 (from top left).

require 'launchpad/device'

device = Launchpad::Device.new
device.test_leds
sleep 1
device.reset
sleep 1
device.change :grid, :x => 4, :y => 4, :red => :high, :green => :low

This is an interaction example lighting all grid buttons in red when pressed and keeping them lit.

require 'launchpad'

interaction = Launchpad::Interaction.new
interaction.response_to(:grid, :down) do |interaction, action|
  interaction.device.change(:grid, action.merge(:red => :high))
end
interaction.response_to(:mixer, :down) do |interaction, action|
  interaction.stop
end

interaction.start

For more details, see the examples. examples/color_picker.rb is the most complex example with interaction.

Future plans

  • bitmap rendering

  • internal tracking of LED states for both buffers

Changelog

v.0.3.0

  • logging

  • reworked multi threading for action handling

  • compatibility with ruby 1.8.7 and 2.0.0

  • interaction responses for presses on single grid buttons/button areas/columns/rows

v.0.2.2

  • single threading fix: prevent ThreadError when Launchpad::Interaction#stop is called within an action response

v.0.2.1

  • Launchpad::Interaction#close now properly stops interaction first

  • multi threading: Launchpad::Interaction#start method can be called with :detached => true to allow calling thread to continue

v.0.2.0

  • double buffering (see Launchpad::Device#buffering_mode)

  • don’t update grid button 0,0 before change_all (in order to reset rapid update pointer), use MIDI message without visual effect

  • (at least) doubled the speed of change_all by not sending each message individually but sending them in one go (as an array)

v0.1.1

v0.1.0

  • first feature complete version with kinda stable API

Copyright © 2009 Thomas Jachmann. See LICENSE for details.

launchpad's People

Contributors

thomasjachmann avatar dianelooney avatar dgoodlad avatar rixth avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.