Doc & formatting.
This commit is contained in:
parent
deb2d27ee8
commit
b2800e5fdd
24
src/MIDI.h
24
src/MIDI.h
|
|
@ -93,7 +93,6 @@ private:
|
|||
|
||||
#endif // MIDI_BUILD_OUTPUT
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// MIDI Input
|
||||
|
||||
|
|
@ -126,14 +125,12 @@ private:
|
|||
void resetInput();
|
||||
|
||||
private:
|
||||
StatusByte mRunningStatus_RX;
|
||||
Channel mInputChannel;
|
||||
|
||||
byte mPendingMessage[3]; // SysEx are dumped into mMessage directly.
|
||||
unsigned mPendingMessageExpectedLenght;
|
||||
unsigned mPendingMessageIndex; // Extended to unsigned for larger SysEx payloads.
|
||||
Message mMessage;
|
||||
|
||||
StatusByte mRunningStatus_RX;
|
||||
Channel mInputChannel;
|
||||
byte mPendingMessage[3];
|
||||
unsigned mPendingMessageExpectedLenght;
|
||||
unsigned mPendingMessageIndex;
|
||||
Message mMessage;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Input Callbacks
|
||||
|
|
@ -163,7 +160,6 @@ public:
|
|||
inline void disconnectCallbackFromType(MidiType inType);
|
||||
|
||||
private:
|
||||
|
||||
void launchCallback();
|
||||
|
||||
void (*mNoteOffCallback)(byte channel, byte note, byte velocity);
|
||||
|
|
@ -186,10 +182,8 @@ private:
|
|||
void (*mSystemResetCallback)(void);
|
||||
|
||||
#endif // MIDI_USE_CALLBACKS
|
||||
|
||||
#endif // MIDI_BUILD_INPUT
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// MIDI Soft Thru
|
||||
|
||||
|
|
@ -215,11 +209,9 @@ private:
|
|||
|
||||
|
||||
#if MIDI_USE_RUNNING_STATUS
|
||||
|
||||
private:
|
||||
StatusByte mRunningStatus_TX;
|
||||
|
||||
#endif // MIDI_USE_RUNNING_STATUS
|
||||
#endif
|
||||
|
||||
private:
|
||||
SerialPort& mSerial;
|
||||
|
|
@ -236,7 +228,7 @@ END_MIDI_NAMESPACE
|
|||
|
||||
#if MIDI_AUTO_INSTANCIATE && defined(ARDUINO)
|
||||
extern MIDI_NAMESPACE::MidiInterface<MIDI_DEFAULT_SERIAL_CLASS> MIDI;
|
||||
#endif // MIDI_AUTO_INSTANCIATE
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
BEGIN_MIDI_NAMESPACE
|
||||
|
||||
/*! \brief Constructor for MidiInterface. */
|
||||
/// \brief Constructor for MidiInterface.
|
||||
template<class SerialPort>
|
||||
MidiInterface<SerialPort>::MidiInterface(SerialPort& inSerial)
|
||||
: mSerial(inSerial)
|
||||
|
|
@ -1092,9 +1092,9 @@ void MidiInterface<SerialPort>::turnThruOff()
|
|||
|
||||
// This method is called upon reception of a message
|
||||
// and takes care of Thru filtering and sending.
|
||||
// - All system messages (System Exclusive, Common and Real Time) are passed
|
||||
// - All system messages (System Exclusive, Common and Real Time) are passed
|
||||
// to output unless filter is set to Off.
|
||||
// - Channel messages are passed to the output whether their channel
|
||||
// - Channel messages are passed to the output whether their channel
|
||||
// is matching the input channel and the filter setting
|
||||
template<class SerialPort>
|
||||
void MidiInterface<SerialPort>::thruFilter(Channel inChannel)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Project Arduino MIDI Library
|
||||
* @brief MIDI Library for the Arduino - Definitions
|
||||
* @version 4.0
|
||||
* @author Francois Best
|
||||
* @author Francois Best
|
||||
* @date 24/02/11
|
||||
* license GPL Forty Seven Effects - 2011
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ typedef byte FilterMode;
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
/*! Enumeration of MIDI types */
|
||||
enum MidiType
|
||||
enum MidiType
|
||||
{
|
||||
InvalidType = 0x00, ///< For notifying errors
|
||||
NoteOff = 0x80, ///< Note Off
|
||||
|
|
@ -62,7 +62,7 @@ enum MidiType
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
/*! Enumeration of Thru filter modes */
|
||||
enum MidiFilterMode
|
||||
enum MidiFilterMode
|
||||
{
|
||||
Off = 0, ///< Thru disabled (nothing passes through).
|
||||
Full = 1, ///< Fully enabled Thru (every incoming message is sent back).
|
||||
|
|
@ -73,7 +73,7 @@ enum MidiFilterMode
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
/*! \brief Enumeration of Control Change command numbers.
|
||||
See the detailed controllers numbers & description here:
|
||||
See the detailed controllers numbers & description here:
|
||||
http://www.somascape.org/midi/tech/spec.html#ctrlnums
|
||||
*/
|
||||
enum MidiControlChangeNumber
|
||||
|
|
@ -99,7 +99,7 @@ enum MidiControlChangeNumber
|
|||
GeneralPurposeController2 = 17,
|
||||
GeneralPurposeController3 = 18,
|
||||
GeneralPurposeController4 = 19,
|
||||
|
||||
|
||||
// Switches ----------------------------------------------------------------
|
||||
Sustain = 64,
|
||||
Portamento = 65,
|
||||
|
|
@ -107,7 +107,7 @@ enum MidiControlChangeNumber
|
|||
SoftPedal = 67,
|
||||
Legato = 68,
|
||||
Hold = 69,
|
||||
|
||||
|
||||
// Low resolution continuous controllers -----------------------------------
|
||||
SoundController1 = 70, ///< Synth: Sound Variation FX: Exciter On/Off
|
||||
SoundController2 = 71, ///< Synth: Harmonic Content FX: Compressor On/Off
|
||||
|
|
@ -130,7 +130,7 @@ enum MidiControlChangeNumber
|
|||
Effects3 = 93, ///< Chorus send level
|
||||
Effects4 = 94, ///< Celeste depth
|
||||
Effects5 = 95, ///< Phaser depth
|
||||
|
||||
|
||||
// Channel Mode messages ---------------------------------------------------
|
||||
AllSoundOff = 120,
|
||||
ResetAllControllers = 121,
|
||||
|
|
@ -145,45 +145,45 @@ enum MidiControlChangeNumber
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/*! The midimsg structure contains decoded data of a MIDI message
|
||||
/*! The midimsg structure contains decoded data of a MIDI message
|
||||
read from the serial port with read()
|
||||
*/
|
||||
struct Message
|
||||
{
|
||||
|
||||
|
||||
/*! The MIDI channel on which the message was recieved.
|
||||
\n Value goes from 1 to 16.
|
||||
\n Value goes from 1 to 16.
|
||||
*/
|
||||
Channel channel;
|
||||
|
||||
/*! The type of the message
|
||||
Channel channel;
|
||||
|
||||
/*! The type of the message
|
||||
(see the MidiType enum for types reference)
|
||||
*/
|
||||
MidiType type;
|
||||
|
||||
|
||||
/*! The first data byte.
|
||||
\n Value goes from 0 to 127.
|
||||
*/
|
||||
DataByte data1;
|
||||
|
||||
/*! The second data byte.
|
||||
|
||||
/*! The second data byte.
|
||||
If the message is only 2 bytes long, this one is null.
|
||||
\n Value goes from 0 to 127.
|
||||
*/
|
||||
DataByte data2;
|
||||
|
||||
|
||||
/*! System Exclusive dedicated byte array.
|
||||
\n Array length is stocked on 16 bits,
|
||||
\n Array length is stocked on 16 bits,
|
||||
in data1 (LSB) and data2 (MSB)
|
||||
*/
|
||||
DataByte sysexArray[MIDI_SYSEX_ARRAY_SIZE];
|
||||
|
||||
|
||||
/*! This boolean indicates if the message is valid or not.
|
||||
There is no channel consideration here,
|
||||
There is no channel consideration here,
|
||||
validity means the message respects the MIDI norm.
|
||||
*/
|
||||
bool valid;
|
||||
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -195,7 +195,7 @@ struct Message
|
|||
midi::MidiInterface<Type> Name((Type&)SerialPort);
|
||||
|
||||
/*! \brief Shortcut for MIDI Interface class with template argument.
|
||||
The class name for a MIDI object using the hardware UART would be
|
||||
The class name for a MIDI object using the hardware UART would be
|
||||
midi::MidiInterface<HardwareSerial>, when the macro is MIDI_CLASS(HardwareSerial).
|
||||
*/
|
||||
#define MIDI_CLASS(Type) \
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Project Arduino MIDI Library
|
||||
* @brief MIDI Library for the Arduino - Namespace declaration
|
||||
* @version 4.0
|
||||
* @author Francois Best
|
||||
* @author Francois Best
|
||||
* @date 24/02/11
|
||||
* license GPL Forty Seven Effects - 2011
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Project Arduino MIDI Library
|
||||
* @brief MIDI Library for the Arduino - Settings
|
||||
* @version 4.0
|
||||
* @author Francois Best
|
||||
* @author Francois Best
|
||||
* @date 24/02/11
|
||||
* license GPL Forty Seven Effects - 2011
|
||||
*/
|
||||
|
|
@ -34,8 +34,6 @@
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Create a MIDI object automatically on the port defined with MIDI_SERIAL_PORT.
|
||||
// You can turn this off by adding #define MIDI_AUTO_INSTANCIATE 0 just before
|
||||
// including <MIDI.h> in your sketch.
|
||||
#ifndef MIDI_AUTO_INSTANCIATE
|
||||
# ifdef ARDUINO
|
||||
# define MIDI_AUTO_INSTANCIATE 1
|
||||
|
|
@ -72,7 +70,7 @@
|
|||
#define MIDI_USE_RUNNING_STATUS 1
|
||||
|
||||
// Setting this to 1 will make MIDI.read parse only one byte of data for each
|
||||
// call when data is available. This can speed up your application if receiving
|
||||
// call when data is available. This can speed up your application if receiving
|
||||
// a lot of traffic, but might induce MIDI Thru and treatment latency.
|
||||
#define MIDI_USE_1BYTE_PARSING 1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue