Git Product home page Git Product logo

rocketry's Introduction

Rocketry - JavaScript Launchpad Interface

npm organization: @rocketry build status license documentation

Description

Rocketry is an interface for the Novation Launchpad product line written in JavaScript. Its goal is to take care of the quirks of the commands exposed by the device so you can write integrations at a higher level quickly. Rocketry is still in its early stages and should be considered a beta. I'm open to any suggestions on the process or project big or small.

Features

Design

  • Multi-platform
  • Automatic and manual detection of devices
  • Support for the Launchpad MK2
  • Planned support for Launchpad Mini and Launchpad Pro
  • Querying for buttons by name, coordinates, etc.
    • Query for many buttons at once by group as well
  • Shims for commands that aren't supported by the device
    • For instance, light the whole device with an RGB color
  • Unit tests and manual integration tests

Interaction

  • Events for press and release of buttons
  • Light, flash, or pulse buttons
  • Scroll ASCII characters across the device
  • Arrays of buttons can run commands for each button
    • You can use less for loops
    • Events trigger an array when any button inside fires
    • Lighting of buttons is quicker in a group
  • Inquire for information about the device
  • And more...

Installation

npm install @rocketry/core

See Documentation > Installation for more information.


Getting Started

  1. Plug in your Launchpad
  2. Make sure your computer installed the drivers or install them manually
  3. Install Rocketry
  4. Try the "Getting Started" example
  5. Create a new .js file
  6. require() or import the package
  7. Browse the documentation

Example

// Require Rocketry
const rocketry = require("@rocketry/core");

// Make a new device instance
// This method will automatically pick a supported device and its class
const launchpad = new rocketry();

// Get a button instance on the Launchpad at bottom-left button
// There are many other ways to get buttons like column, row, quadrant, etc.
const button = launchpad.query.by.coordinates(0, 0);

// Set its color to pink
// Rocketry supports standard RGB, full RGB, and bi-color values or their names
button.light("pink");

// Log to console on press of the bottom-left button
// Rocketry passes helpful values into your function, but let's not use them now
button.on("press", function() {
    console.log("3... 2... 1... Blast off!");
});

// Reset the device and close connection on release of the button named "mixer"
launchpad.query.by.name("mixer").on("release", function() {
    console.log("Launch aborted!");

    // You can use `this.device` instead of `launchpad` inside of this, but let's use our own reference
    // Reset the Launchpad to defaults (lights, layout, etc)
    launchpad.reset();
    // Close MIDI ports and cleanup
    launchpad.close();
});

Supported Devices

  • Launchpad MK2

Currently only the Launchpad MK2 is supported, but and support for the Launchpad Mini and Launchpad Pro are planned. Hopefully the module is also structured in such a way that other Novation devices could be added in the future with a minimal amount of breaking changes. If you're interested in expanding the support to your device, contact me or check out a related issue.

Why?

I think @TaranVH sums up my intentions the best. And his keyboards don't light up and control, say for instance, the Toggl API.

Contributing

If you find any bugs or would like to suggest features, make an issue for it being as descriptive as possible and I'll do my best to address it.

If you have a device that's not supported, have ideas for new features, or just want to fix it up a bit; pull requests are highly appreciated.

License

Copyright Evelyn Hathaway, MIT License

rocketry's People

Contributors

dependabot[bot] avatar evelynhathaway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cryptomitch

rocketry's Issues

Export API Types

Device Plugin Layer

MIDI Plugin Layer

  • MidiLayerAPI
  • MessageType
  • MIDIOptions
  • PortsType

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.