proof of concept

This commit is contained in:
lathoub 2018-10-23 22:04:00 +02:00
parent c34c20e946
commit f5ac29968e
9 changed files with 195 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#include "BleMidi.h"
BLEMIDI_CREATE_INSTANCE(BLEMIDI);
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void setup()
{
// Serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.print(F("Getting IP address..."));
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void loop()
{
}

49
keywords.txt Normal file
View File

@ -0,0 +1,49 @@
#######################################
# Syntax Coloring Map for AppleMIDI
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
BLEMIDI KEYWORD1
BLEMIDI.h KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
run KEYWORD2
noteOn KEYWORD2
noteOff KEYWORD2
afterTouchPoly KEYWORD2
controlChange KEYWORD2
programChange KEYWORD2
afterTouchChannel KEYWORD2
pitchBend KEYWORD2
systemExclusive KEYWORD2
timeCodeQuarterFrame KEYWORD2
songPosition KEYWORD2
songSelect KEYWORD2
tuneRequest KEYWORD2
clock KEYWORD2
start KEYWORD2
Continue KEYWORD2
stop KEYWORD2
activeSensing KEYWORD2
systemReset KEYWORD2
timeCodeQuarterFrame KEYWORD2
sysEx KEYWORD2
afterTouch KEYWORD2
polyPressure KEYWORD2
tick KEYWORD2
#######################################
# Instances (KEYWORD3)
#######################################
#######################################
# Constants (LITERAL1)
#######################################
# Namespace, considering it as a literal
blemidi LITERAL1

10
library.properties Normal file
View File

@ -0,0 +1,10 @@
name=BLE-MIDI
version=0.0.1
author=lathoub
maintainer=lathoub <lathoub@gmail.com>
sentence=MIDI over Bluetooth Low Energy (BLE-MIDI) 1.0 for Arduino
paragraph=MIDI over Bluetooth Low Energy
category=Communication
url=https://github.com/lathoub/Arduino-BLE-MIDI
architectures=*
includes=BLEMIDI.h

1
src/BleMidi.cpp Normal file
View File

@ -0,0 +1 @@
#include "BleMidi.h"

27
src/BleMidi.h Normal file
View File

@ -0,0 +1,27 @@
/*!
* @file BleMidi.h
*/
#pragma once
#include "utility/BleMidi_Defs.h"
BEGIN_BLEMIDI_NAMESPACE
/*! \brief The main class for AppleMidiInterface handling.\n
See member descriptions to know how to use it,
or check out the examples supplied with the library.
*/
class BleMidiInterface
{
public:
// Constructor and Destructor
inline BleMidiInterface();
inline ~BleMidiInterface();
};
END_BLEMIDI_NAMESPACE
// -----------------------------------------------------------------------------
#include "BleMidi.hpp"

16
src/BleMidi.hpp Normal file
View File

@ -0,0 +1,16 @@
BEGIN_BLEMIDI_NAMESPACE
/*! \brief Default constructor for MIDI_Class. */
inline BleMidiInterface::BleMidiInterface()
{
}
/*! \brief Default destructor for MIDI_Class.
This is not really useful for the Arduino, as it is never called...
*/
inline BleMidiInterface::~BleMidiInterface()
{
}
END_BLEMIDI_NAMESPACE

View File

@ -0,0 +1,27 @@
#pragma once
#include "BleMidi_Namespace.h"
#if ARDUINO
#include <Arduino.h>
#else
#include <inttypes.h>
typedef uint8_t byte;
#endif
BEGIN_BLEMIDI_NAMESPACE
// -----------------------------------------------------------------------------
/*! \brief Create an instance of the library
*/
#define BLEMIDI_CREATE_INSTANCE(Name) \
BLEMIDI_NAMESPACE::BleMidiInterface Name;
/*! \brief Create an instance of the library with EnternetUDP.
*/
#define BLEMIDI_CREATE_DEFAULT_INSTANCE() \
BLEMIDI_CREATE_INSTANCE(BleMIDI);
END_BLEMIDI_NAMESPACE

View File

@ -0,0 +1,11 @@
#pragma once
#define BLEMIDI_NAMESPACE bleMidi
#define BEGIN_BLEMIDI_NAMESPACE namespace BLEMIDI_NAMESPACE {
#define END_BLEMIDI_NAMESPACE }
#define USING_NAMESPACE_BLEMIDI using namespace BLEMIDI_NAMESPACE;
BEGIN_BLEMIDI_NAMESPACE
END_BLEMIDI_NAMESPACE

View File

@ -0,0 +1,29 @@
#pragma once
#include "utility/BleMidi_Namespace.h"
//#define DEBUG
#define RELEASE
#if defined(RELEASE)
#define RELEASE_BUILD
#undef DEBUG_BUILD
#endif
#if defined(DEBUG)
#define DEBUG_BUILD
#undef RELEASE_BUILD
#endif
#if defined(RELEASE_BUILD)
#undef BLEMIDI_DEBUG
#undef BLEMIDI_DEBUG_VERBOSE
#endif
#if defined(DEBUG_BUILD)
#define BLEMIDI_DEBUG 1
#undef BLEMIDI_DEBUG_VERBOSE
#define BLEMIDI_DEBUG_PARSING
#endif