Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

launchpad-midi-converter

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

launchpad-midi-converter

Helps to convert MIDI notes from a layout to any other layout on a Launchpad.

  • 0.1.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Installation

CDN
The easiest way is to link the launchpad-midi-converter library from the jsDelivr CDN. To retrieve the latest version, just add this to your HTML page:

<script src="https://cdn.jsdelivr.net/npm/launchpad-midi-converter"></script>

If you want to target a specific version, you might prefer:

<script src="https://cdn.jsdelivr.net/npm/launchpad-midi-converter@0.1.0"></script>

Manual
You can download the latest release of launchpad-midi-converter, uncompress it, grab the LPMidiConverter.min.js file and copy it to your project. So you can link it to your HTML page.

NPM
Might be the best way if you want to use it with Node
npm install launchpad-midi-converter
You can link it to your HTML page like this:

<script src="node_modules/launchpad-midi-converter/LPMidiConverter.min.js"></script>

Usage

Node

const launchpad = require("launchpad-midi-converter")

HTML

<script>
    const launchpad = new LPMidiConverter();
</script>

Documentation

Modes or Layouts availables...

  • Live Mode (Green) => live
  • Programmer Mode (Orange) => programmer

.layout(mode)

Where mode is the layout we want. (See Mode or Layouts availables...). Returns an array of every notes in the right order. Example:

>>> launchpad.layout("programmer")
[
  [81, 82, 83, 84, 85, 86, 87, 88],
  [71, 72, 73, 74, 75, 76, 77, 78],
  [...]
]

Take note that CC notes aren't included in the layouts. Currently working on it...

.convert(note, from, to)

Where note is the note we want to convert (eg.: 11), from is the layout where the note comes from (eg.: 11 comes from the programmer layout) and to is the final layout (eg.: live layout).

>>> launchpad.convert(11, "programmer", "live")
36

Explanations: We take the programmer layout and we search where the note, so 11, is placed in the layout. Now we take the live layout and we read the note where 11 was placed in the programmer layout, so 36 here. (Needs to be explaned well, my english is so bad).

.color(velocity)

Where velocity is between 0 and 127. It returns the HEX color value of the velocity given. Based on default Novation Launchpad color palette.

>>> launchpad.color(1)
"1c1c1c"

Don't forget to add the # before the value, (eg.: #1c1c1c).
This function isn't optimised, it's just hardcoded... If theres a better way to do it, please contribute !

Want to help ?

Just clone this repo and everything is in src/LPMidiConverter.js ! Minified file is made with minify (npm i -g minify). Just go in your working directory and type npm run minify and it will overwrite LPMidiConverter.min.js. Hope I explained well !

Keywords

FAQs

Package last updated on 28 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc