Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ For yarn:
yarn add launchpadcore
```

When running in a browser, the library automatically calls
`navigator.requestMIDIAccess()` to request access to the Web MIDI API.

## Supported devices
Launchpad Core offers a driver system to adapt to the different existing models of Novation Launchpad.
### MK1
Expand Down Expand Up @@ -48,9 +51,9 @@ Launchpad Core offers a driver system to adapt to the different existing models
Here is a typical example of what can be done with this module.

```javascript
import { LaunchpadCore } from "launchpadcore"
import { createLaunchpadCore } from "launchpadcore";

const App = new LaunchpadCore("LaunchpadX");
const App = createLaunchpadCore("LaunchpadX");

App.on("onEnabled", (instance, driver) => {
instance.out.send(driver.textScrolling(15, "Welcome!"))
Expand Down
21 changes: 19 additions & 2 deletions demo/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import { LaunchpadCore } from "../src"
import { createLaunchpadCore } from "../src/";

const App = new LaunchpadCore("LaunchpadX");
const App = createLaunchpadCore("LaunchpadX");

App.on("onConnected", (instance, driver) => {
console.log(instance.out.info());
//instance.out.send(driver.textScrolling(15, "Welcome!"))
instance.out.send(driver.programmerToggle(true))
instance.out.noteOn(0, 11, 25) // Pad 11 to color 25
})

App.on("onMidiIn", (data) => {
console.log(data)
})

App.on("onDisabled", (instance, driver) => {
instance.out.send(driver.textScrolling(15, "Goodbye!"))
instance.out.send(driver.programmerToggle(false))
console.log("Shutdown...")
})
Loading