From 98f7bb8831f553dedc5f534fecbf7dbf9a9deb00 Mon Sep 17 00:00:00 2001 From: Jacek Roszkowski Date: Fri, 22 Jun 2018 20:40:43 +0200 Subject: [PATCH 1/4] Corrected typo: Lenght - Length --- src/MIDI.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MIDI.h b/src/MIDI.h index 5fe356c..90b1dc4 100644 --- a/src/MIDI.h +++ b/src/MIDI.h @@ -234,7 +234,7 @@ private: StatusByte mRunningStatus_RX; StatusByte mRunningStatus_TX; byte mPendingMessage[3]; - unsigned mPendingMessageExpectedLenght; + unsigned mPendingMessageExpectedLength; unsigned mPendingMessageIndex; unsigned mCurrentRpnNumber; unsigned mCurrentNrpnNumber; @@ -250,8 +250,8 @@ private: // ----------------------------------------------------------------------------- -unsigned encodeSysEx(const byte* inData, byte* outSysEx, unsigned inLenght); -unsigned decodeSysEx(const byte* inSysEx, byte* outData, unsigned inLenght); +unsigned encodeSysEx(const byte* inData, byte* outSysEx, unsigned inLength); +unsigned decodeSysEx(const byte* inSysEx, byte* outData, unsigned inLength); END_MIDI_NAMESPACE From 2e8be813c4898e3b6cfc0c15f73f9af21aaebabc Mon Sep 17 00:00:00 2001 From: Jacek Roszkowski Date: Fri, 22 Jun 2018 20:43:21 +0200 Subject: [PATCH 2/4] Corrected typo: Lenght - Length --- src/MIDI.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/MIDI.hpp b/src/MIDI.hpp index fa34533..e5f7ab5 100644 --- a/src/MIDI.hpp +++ b/src/MIDI.hpp @@ -36,7 +36,7 @@ inline MidiInterface::MidiInterface(SerialPort& inSerial) , mInputChannel(0) , mRunningStatus_RX(InvalidType) , mRunningStatus_TX(InvalidType) - , mPendingMessageExpectedLenght(0) + , mPendingMessageExpectedLength(0) , mPendingMessageIndex(0) , mCurrentRpnNumber(0xffff) , mCurrentNrpnNumber(0xffff) @@ -95,7 +95,7 @@ void MidiInterface::begin(Channel inChannel) mRunningStatus_RX = InvalidType; mPendingMessageIndex = 0; - mPendingMessageExpectedLenght = 0; + mPendingMessageExpectedLength = 0; mCurrentRpnNumber = 0xffff; mCurrentNrpnNumber = 0xffff; @@ -746,7 +746,7 @@ bool MidiInterface::parse() // Do not reset all input attributes, Running Status must remain unchanged. // We still need to reset these mPendingMessageIndex = 0; - mPendingMessageExpectedLenght = 0; + mPendingMessageExpectedLength = 0; return true; break; @@ -756,7 +756,7 @@ bool MidiInterface::parse() case AfterTouchChannel: case TimeCodeQuarterFrame: case SongSelect: - mPendingMessageExpectedLenght = 2; + mPendingMessageExpectedLength = 2; break; // 3 bytes messages @@ -766,13 +766,13 @@ bool MidiInterface::parse() case PitchBend: case AfterTouchPoly: case SongPosition: - mPendingMessageExpectedLenght = 3; + mPendingMessageExpectedLength = 3; break; case SystemExclusive: // The message can be any lenght // between 3 and MidiMessage::sSysExMaxSize bytes - mPendingMessageExpectedLenght = MidiMessage::sSysExMaxSize; + mPendingMessageExpectedLength = MidiMessage::sSysExMaxSize; mRunningStatus_RX = InvalidType; mMessage.sysexArray[0] = SystemExclusive; break; @@ -785,7 +785,7 @@ bool MidiInterface::parse() break; } - if (mPendingMessageIndex >= (mPendingMessageExpectedLenght - 1)) + if (mPendingMessageIndex >= (mPendingMessageExpectedLength - 1)) { // Reception complete mMessage.type = getTypeFromStatusByte(mPendingMessage[0]); @@ -794,7 +794,7 @@ bool MidiInterface::parse() mMessage.data2 = 0; // Completed new message has 1 data byte mPendingMessageIndex = 0; - mPendingMessageExpectedLenght = 0; + mPendingMessageExpectedLength = 0; mMessage.valid = true; return true; } @@ -882,7 +882,7 @@ bool MidiInterface::parse() mPendingMessage[mPendingMessageIndex] = extracted; // Now we are going to check if we have reached the end of the message - if (mPendingMessageIndex >= (mPendingMessageExpectedLenght - 1)) + if (mPendingMessageIndex >= (mPendingMessageExpectedLength - 1)) { // "FML" case: fall down here with an overflown SysEx.. // This means we received the last possible data byte that can fit @@ -903,11 +903,11 @@ bool MidiInterface::parse() mMessage.data1 = mPendingMessage[1]; // Save data2 only if applicable - mMessage.data2 = mPendingMessageExpectedLenght == 3 ? mPendingMessage[2] : 0; + mMessage.data2 = mPendingMessageExpectedLength == 3 ? mPendingMessage[2] : 0; // Reset local variables mPendingMessageIndex = 0; - mPendingMessageExpectedLenght = 0; + mPendingMessageExpectedLength = 0; mMessage.valid = true; @@ -996,7 +996,7 @@ template inline void MidiInterface::resetInput() { mPendingMessageIndex = 0; - mPendingMessageExpectedLenght = 0; + mPendingMessageExpectedLength = 0; mRunningStatus_RX = InvalidType; } From 58474673b414b6244dbfb2d400474564be740fcf Mon Sep 17 00:00:00 2001 From: Jacek Roszkowski Date: Fri, 22 Jun 2018 20:44:12 +0200 Subject: [PATCH 3/4] Corrected typo: Lenght - Length --- src/MIDI.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MIDI.cpp b/src/MIDI.cpp index e14a98f..3feb202 100644 --- a/src/MIDI.cpp +++ b/src/MIDI.cpp @@ -37,8 +37,8 @@ BEGIN_MIDI_NAMESPACE data you want to send. \param inData The data to encode. \param outSysEx The output buffer where to store the encoded message. - \param inLength The lenght of the input buffer. - \return The lenght of the encoded output buffer. + \param inLength The length of the input buffer. + \return The length of the encoded output buffer. @see decodeSysEx Code inspired from Ruin & Wesen's SysEx encoder/decoder - http://ruinwesen.com */ @@ -74,8 +74,8 @@ unsigned encodeSysEx(const byte* inData, byte* outSysEx, unsigned inLength) your received message. \param inSysEx The SysEx data received from MIDI in. \param outData The output buffer where to store the decrypted message. - \param inLength The lenght of the input buffer. - \return The lenght of the output buffer. + \param inLength The length of the input buffer. + \return The length of the output buffer. @see encodeSysEx @see getSysExArrayLength Code inspired from Ruin & Wesen's SysEx encoder/decoder - http://ruinwesen.com */ From e486667d8a6e8d1be7b6a6418110ebd27b78a4da Mon Sep 17 00:00:00 2001 From: Jacek Roszkowski Date: Fri, 22 Jun 2018 20:47:13 +0200 Subject: [PATCH 4/4] Corrected typo: Lenght - Length --- src/MIDI.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MIDI.hpp b/src/MIDI.hpp index e5f7ab5..03b9a72 100644 --- a/src/MIDI.hpp +++ b/src/MIDI.hpp @@ -770,7 +770,7 @@ bool MidiInterface::parse() break; case SystemExclusive: - // The message can be any lenght + // The message can be any length // between 3 and MidiMessage::sSysExMaxSize bytes mPendingMessageExpectedLength = MidiMessage::sSysExMaxSize; mRunningStatus_RX = InvalidType; @@ -1047,7 +1047,7 @@ inline const byte* MidiInterface::getSysExArray() const return mMessage.sysexArray; } -/*! \brief Get the lenght of the System Exclusive array. +/*! \brief Get the length of the System Exclusive array. It is coded using data1 as LSB and data2 as MSB. \return The array's length, in bytes.