Coder Social home page Coder Social logo

libmonomecpp's Introduction

libMonomeCpp

A C++ wrapper around libmonome (https://github.com/monome/libmonome), hiding some of the complexity of libmonome's C Interface. Offers a C++11, callback-based solution.

The std::function called TouchCallback is called whenever a button is pressed, released, or a long press is detected (default time = 0.5s). In this function is possible to change something in the monome itself, for example enabling the corresponding LED by calling one of the setXXX methods.

The std::function GridRefreshed is called each time the grid is refreshed, that is ~20 ms. It runs on the monome thread. One example of using this callback is readin the MIDI clock of a sequencer, and updating the LEDs accordingly. Note that there's an internal thread that changes all the LEDs every 20 ms, so you are't supposed to do anything that is very time consuming here.

All the SetXXX methods are thread safe, so for example you can call them from an audio or MIDI callback without problems: they use the lock-free TPCircularBuffer implementation. Please see the (few) examples.

Note that multiple calld to SetXXX with the same value (ON, OFF, BLINK) don't afect the performance. So feel free to clear the grid how many times you want.

Always consider the monome as made of two different things:

  • a MxN input matrix of push buttons (you decide what to do when they are pushed, through a callback)
  • a MxN input matrix of LEDs (you decide when to light them up, calling SetXXX from any thread you want)

Building

libmonomec++ requires Cmake to run

First you update the dependency on the awesome TPCircularBuffer

$ git submodule update

then

$ mkdir build && cd build
$ cmake ../

You can pass the agruments to build with your favorite IDE, for example -G Xcode

License

libMonomeCpp is Public license

Uses libmonome (https://github.com/monome/libmonome):

Copyright (c) 2010 William Light [email protected] Copyright (c) 2013 Nedko Arnaudov [email protected]

And TPCircularBuffer Copyright (C) 2012-2013 A Tasty Pixel

See the relevant README and Licenses

Author

Alessandro Saccoia, 2016 (http://www.alsc.co)

libmonomecpp's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.