Git Product home page Git Product logo

launchpad's Introduction

launchpad GoDoc

A package allows you to talk to your Novation Launchpad in Go. Light buttons or read your touches.

This library is currently only working with Launchpad S (Green-Red Launchpads) but we are trying to support multiple models and layouts.

go get github.com/rakyll/launchpad

Portmidi is required to use this package.

$ apt-get install libportmidi-dev
# or
$ brew install portmidi

Usage

Initialize a new Launchpad. If there are no currently connected Launchpad device, initialization will fail with an error. You can fake a device by creating an input and output MIDI device and name them as Launchpad.

pad, err = launchpad.Open();
if err != nil {
    log.Fatalf("Error initializing launchpad: %v", err)
}
defer pad.Close()

// turn off all of the lights
pad.Clear()

Coordinate system

The coordinate system is illustrated below.

+--------- arrow keys -----------+  +--- mode keys ---+
{0, 8} {1, 8} {2, 8} {3, 8} {4, 8} {5, 8} {6, 8} {7, 8} | ableton
----------------------------------------------------------------
{0, 0} {1, 0} {2, 0} {3, 0} {4, 0} {5, 0} {6, 0} {7, 0} | {8, 0} vol
----------------------------------------------------------------
{0, 1} {1, 1} {2, 1} {3, 1} {4, 1} {5, 1} {6, 1} {7, 1} | {8, 1} pan
----------------------------------------------------------------
{0, 2} {1, 2} {2, 2} {3, 2} {4, 2} {5, 2} {6, 2} {7, 2} | {8, 2} sndA
----------------------------------------------------------------
{0, 3} {1, 3} {2, 3} {3, 3} {4, 3} {5, 3} {6, 3} {7, 3} | {8, 3} sndB
----------------------------------------------------------------
{0, 4} {1, 4} {2, 4} {3, 4} {4, 4} {5, 4} {6, 4} {7, 4} | {8, 4} stop
----------------------------------------------------------------
{0, 5} {1, 5} {2, 5} {3, 5} {4, 5} {5, 5} {6, 5} {7, 5} | {8, 5} trk on
----------------------------------------------------------------
{0, 6} {1, 6} {2, 6} {3, 6} {4, 6} {5, 6} {6, 6} {7, 6} | {8, 6} solo
----------------------------------------------------------------
{0, 7} {1, 7} {2, 7} {3, 7} {4, 7} {5, 7} {6, 7} {7, 7} | {8, 7} arm
----------------------------------------------------------------

Demo: Light your touchs

A simple program to light every touch:

pad, err := launchpad.Open()
if err != nil {
    log.Fatal(err)
}
defer pad.Close()

pad.Clear()

ch := pad.Listen()
for {
	select {
	case hit := <-ch:
		pad.Light(hit.X, hit.Y, 3, 3)
	}
}

License

Copyright 2013 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

launchpad's People

Contributors

briansorahan avatar dhowlett99 avatar ianlewis avatar lexicality avatar mdlayher avatar rakyll 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

launchpad's Issues

Support RGB LEDs

The new Launchpad comes with RGB LEDs whereas we only support red-green.

Godoc link doesn't display documentaion

I believe this happened with the migration from godoc.org to go.dev. It displays "Documentation not displayed due to license restrictions."

I assume this is because the LICENSE is at the bottom of the README rather than in a separate file, though I'm not familiar enough with go.dev to know that's the issue for sure.

Unable de use lib on windows

Hi,
I don"t succeed using this lib on windows.
I installed msys64 , I installed gcc and libportmidi

And now when i run go build I've got this error

$ go build
# github.com/sguiheux/launchpad
D:\msys64\home\Vv\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Vv\AppData\Local\Temp\go-link-950327387\000006.o : Dans la fonction « _cgo_preinit_init » :
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:28 : référence indéfinie vers « __imp___iob_func »
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:28:(.text+0x37): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp___iob_func
C:\Users\Vv\AppData\Local\Temp\go-link-950327387\000006.o : Dans la fonction « x_cgo_sys_thread_create » :
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:56 : référence indéfinie vers « __imp__beginthread »
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:56:(.text+0xdc): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp__beginthread
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:58 : référence indéfinie vers « __imp__errno »
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:58:(.text+0xee): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp__errno
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:58 : référence indéfinie vers « __imp___iob_func »
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:58:(.text+0xf6): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp___iob_func
C:\Users\Vv\AppData\Local\Temp\go-link-950327387\000006.o : Dans la fonction « x_cgo_notify_runtime_init_done » :
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:99 : référence indéfinie vers « __imp___iob_func »
C:\workdir\go\src\runtime\cgo/gcc_libinit_windows.c:99:(.text+0x225): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp___iob_func
C:\Users\Vv\AppData\Local\Temp\go-link-950327387\000007.o : Dans la fonction « x_cgo_thread_start » :
C:\workdir\go\src\runtime\cgo/gcc_util.c:18 : référence indéfinie vers « __imp___iob_func »
C:\workdir\go\src\runtime\cgo/gcc_util.c:18:(.text+0x3c): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp___iob_func
C:\Users\Vv\AppData\Local\Temp\go-link-950327387\000008.o : Dans la fonction « _cgo_sys_thread_start » :
C:\workdir\go\src\runtime\cgo/gcc_windows_amd64.c:32 : référence indéfinie vers « __imp__beginthread »
C:\workdir\go\src\runtime\cgo/gcc_windows_amd64.c:32:(.text+0xa3): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp__beginthread
C:\workdir\go\src\runtime\cgo/gcc_windows_amd64.c:34 : référence indéfinie vers « __imp__errno »
C:\workdir\go\src\runtime\cgo/gcc_windows_amd64.c:34:(.text+0xb5): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp__errno
C:\workdir\go\src\runtime\cgo/gcc_windows_amd64.c:34 : référence indéfinie vers « __imp___iob_func »
C:\workdir\go\src\runtime\cgo/gcc_windows_amd64.c:34:(.text+0xbd): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini __imp___iob_func
collect2: erreur : ld a retourné 1 code d'état d'exécution

Any ideas?

Regards

Top row no longer working?

There were some changes in the lib recently and now my top rows won't light up. Any idea why that would be?

The keys still work but the lights no longer light up. Noticed they are Y: -1 instead of Y:8 now.

'portmidi.h' file not found

I'm running OSX and get this error. I got portmidi but not exactly sure where it needs portmidi.h.

Have you ran into this issue?

sample: drummachine not starting

The drummachine sample is existing with the following even though a launchpad is connected and visible to the system.

2015/05/15 09:53:02 error while initializing connection to midi out stream
exit status 1

1-8 Keys Not Lighting Up

I have been playing with the step sequencer example code. I increased the grid so I can try to utilize the 1-9 and A-H controls.

I want to control the 1-9 keys along the top, so I can use them to control tick speed and pages. I can use A-H without trouble.

I have not been able to use the pad.Light(0, 8, 4, 0) (and I also tried pad(0, 9, 4, 0)) which should light up 1 but I can do pad.Light(9, 0, 4, 0) which is H.

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.