# ngx-launchpad

> A simple module / service for communication with a Novation Launchpad

Latest version **1.0.2** (published 2019-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-launchpad
pnpm add ngx-launchpad
yarn add ngx-launchpad
bun add ngx-launchpad
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-09-26 |
| First published | 2019-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 227.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dominic 'XeroxDev' Ris |
| Maintainers | xeroxdev |
| Keywords | angular, angular 8, launchpad, novation |

## Links

- npm: https://www.npmjs.com/package/ngx-launchpad
- Repository: https://github.com/XeroxDev/ngx-launchpad
- Issues: https://github.com/XeroxDev/ngx-launchpad/issues
- npm.io page: https://npm.io/package/ngx-launchpad

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0
- [launchpad-webmidi](https://npm.io/package/launchpad-webmidi.md) ^1.0.0

## Recent versions

- 1.0.2 (latest) — 2019-09-26

## README

# NGXLaunchpad
A small library for [angular 8](http://angular.io) to communicate with a Novation Launchpad. 

This library uses the [Launchpad WebMIDI](https://github.com/LostInBrittany/launchpad-webmidi) library. Shoutout to
 [LostInBrittany](https://github.com/LostInBrittany) for his really nice work! Without his work, my work would be
  even harder ;) Don't forget to give him a star
  ♥.

## Installation

- Install via [`npm`](https://www.npmjs.com/):

```bash
npm install --save ngx-launchpad
```

## Usage
Implement the ``NgxLaunchpadModule`` into your module like this:
```typescript
import {NgxLaunchpadModule} from '../../../ngx-launchpad/src/lib/ngx-launchpad.module';

@NgModule({
  declarations: [MyComponent],
  imports: [
    BrowserModule,
    NgxLaunchpadModule // <-- include it in your app module
  ],
  bootstrap: [MyComponent]
})
```
and then, you can import the ``NgxLaunchpadService`` into every component like this:
```typescript
constructor(private launchpadService: NgxLaunchpadService) {
}
```

### Small overview
#### Important or interesting functions
```typescript
pad.connect(); // <-- Connecting with Launchpad
pad.disconnect() // <-- Disconnection from Launchpad
pad.onConnect().subscribe(() => console.log('connected')); // <-- Listen to the connect event
pad.onDisconnect().subscribe(() => console.log('disconnected')); // <-- Listen to the disconnect event
pad.onKey().subscribe(key => console.log( `Key ${key.x},${key.y} down: ${key.pressed}`)); // <-- Listen to the key
 pressed / released event
pad.col(pad.Colors.red, [0, 0]); // <-- Color a key
```
#### Colors
```
pad.Colors.red;
pad.Colors.green;
pad.Colors.yellow;
pad.Colors.amber;
pad.Colors.off;
pad.Colors.red.medium;
pad.Colors.red.low;
pad.Colors.red.full; // Default strength
```
And much, much more

## License

[MIT License](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/ngx-launchpad · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
