Giter VIP home page Giter VIP logo

arduino-usbmidi's Introduction

Arduino USB-MIDI Transport

arduino-library-badge

This library implements the USB-MIDI transport layer for the FortySevenEffects Arduino MIDI Library and uses the underlying Arduino MIDIUSB library (so only devices working with MIDIUSB, will work here).

Alternative library: see also Adafruit's TinyUSB Library for Arduino for ESP32, mbed_rp2040, ArduinoCore-samd and Pico

Installation

Screenshot 2020-04-25 at 09 42 19

This library depends on the Arduino MIDI Library and Arduino's MIDIUSB.

When installing this library from the Arduino IDE, both will be downloaded and installed in the same directory as this library. (Thanks to the depends clause in library.properties)

When manually installing this library, you have to manually download Arduino MIDI Library and MIDIUSB from github and install it in the same directory as this library - without these additional installs, this library will not be able to compile.

Usage

Basic / Default

#include <USB-MIDI.h>
...
USBMIDI_CREATE_DEFAULT_INSTANCE();
...
void setup()
{
   MIDI.begin(1);
...
void loop()
{
   MIDI.read();

will create a instance named MIDI (transport instance named __usbMIDI) and is by default connected to cable number 0 - and listens to incoming MIDI on channel 1.

Modified

#include <USB-MIDI.h>
...
USBMIDI_CREATE_INSTANCE(4);

will create a instance named MIDI (transport instance named __usbMIDI) and is connected to cable number 4.

Advanced

#include <USB-MIDI.h>
...
USBMIDI_NAMESPACE::usbMidiTransport usbMIDI2(5);
MIDI_NAMESPACE::MidiInterface<USBMIDI_NAMESPACE::usbMidiTransport> MIDI2((USBMIDI_NAMESPACE::usbMidiTransport&)usbMIDI2);

will create a instance named usbMIDI2 (and underlaying MIDI object MIDI2) and is by default connected to cable number 5.

Tested boards / modules

  • Arduino Leonardo
  • Teensy 4.1 (incl MIDI, MIDIx4 and MIDIx16)

Boards / modules in development (help needed)

  • Arduino NANO 33 BLE
  • nRF52832 Bluefruit Feather

Memory usage

The library does not add additional buffers and is extremely efficient and has a small memory footprint.

Other Transport protocols:

The libraries below the same calling mechanism (API), making it easy to interchange the transport layer.

arduino-usbmidi's People

Contributors

frensing avatar lathoub avatar levicole avatar yuuichiakagawa 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.