npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lokua/launchpad

v0.0.4

Published

Node.js program to control a Novation Launchpad MIDI controller. Attach handlers to react when buttons are pressed and set their colors according to your program's logic.

Downloads

3

Readme

launchpad

Node.js program to control a Novation Launchpad MIDI controller. Attach handlers to react when buttons are pressed and set their colors according to your program's logic.

See ./example.js for a basic usage example.

Install

launchpad has been developed on [email protected] and [email protected], though should work with any node installation that supports arrow functions, const, let, object property shorthand, destructuring.

npm i @lokua/launchpad --save
# or
yarn add @lokua/launchpad --save

API

Launchpad(portName, options)

Class constructor.

Params:
  • portName: An exact string or regexp. Defaults to /^Launchpad/

  • options:

    • ignore0Velocity = true: Causes all registered handlers to ignore when a button is released. This is useful if you are using your Launchpad as a sequencer rather than a push & hold style instrument. For more fine grained control you can set this false and check the value parameter in any of the on* methods.
    • normalize = true The Launchpad by default has some pretty odd numbering. For example, the first grid row runs from [0, 7] (as expected), but the second row runs from [16, 23]. This is not at all intuitive when it comes to mapping buttons to parameters in software etc, where one would expect the 64th button to be 63. Likewise, the top meta row sends CCs from [104, 111]. With normalize = true, the top meta row/column sends a normalized [0, 7] range, and the grid runs from [0, 63].
Launchpad.colors: object
  • off
  • redLow
  • red
  • amberLow
  • amber
  • yellow
  • greenLow
  • green
#onPage(fn)

Fired when a button in the top "special" row (buttons labeled 1-8) is pressed. fn is called with (note, value).

#onScene(fn)

Fired when a button in the right-most column (labelled A-H) is pressed. fn is called with (note, value).

#onGrid(fn)

Fired when a button in the grid is pressed. fn is called with (note, value).

#closePorts()

Close the internal ports used to communicate with Launchpad. This only needs to be called if you wish to kill connections while your program is still running, otherwise the library will handle that automatically on process termination.

#allOff()

Turn all buttons on the Launchpad off

#setPage(number, color)

Set the color of a button in the top row

#setScene(number, color)

Set the color of a button in the right column

#setGrid(number, color)

Set the color of a button in the grid

License

MIT