Commit Graph

74 Commits

Author SHA1 Message Date
lathoub 9a0f2dcf21 LCOV_EXCL_LINE in sendCommon 2020-03-23 21:54:23 +01:00
lathoub 240082c0fb Removed Undefined_F9 (Tick) as an invalid token (so it valid now) 2020-03-23 13:56:35 +01:00
lathoub 050e9c9160 added Tick (0xF9) 2020-03-22 23:03:39 +01:00
lathoub ef878344cd moved code to avoid doc clash 2020-03-22 21:29:39 +01:00
lathoub 8f492ec456 shorter syntax using iif 2020-03-22 21:24:57 +01:00
lathoub c7195d9522 updating authors 2020-03-22 17:33:18 +01:00
lathoub c43d92d649 use #defined value, not the literal 2020-03-22 17:23:08 +01:00
lathoub d4b692ab76 UseSenderActiveSensing & UseReceiverActiveSensing to enable/disable Active Sensing
UseSenderActiveSensing & UseReceiverActiveSensing in Settings are global switches to turn on/off ActiveSensing (and save memory)
2020-03-22 17:19:15 +01:00
lathoub 8730ae0bde added SendCommon, consistent with SendRealTime
including:

sendClock, sendStart, sendStop, sendContinue, sendActiveSensing, sendSystemReset
2020-03-22 15:39:21 +01:00
lathoub d6ac0f6b82 + receiver ActiveSensing, + error Callback
1) Active Sensing:
Once an ActiveSensing message is received, the system checks for timeouts: if no message is received within the specified 300ms (see in _Defs), an error is set and the checks for timeout stop.

2) added a callback for errors. 2 errors are defined: parse error and ActiveSensing timeout
2020-03-22 15:33:42 +01:00
lathoub 874b44e6f3 Fixed "FML" case: fall down here with an overflown SysEx..
Splitting larger incoming messages into smaller SysEx packets - using an RrtpMidi trick:
            //   first:  0xF0 .... 0xF0
            //   midlle: 0xF7 .... 0xF0
            //   last:   0xF7 .... 0xF7

see: https://tools.ietf.org/html/rfc4695#section-3.2

(Understanding this is not part of the original MIDI spec, but does allow for receiving very very large SysEx messages on a small footprint (does require some 'handy' parsing))

SysExMaxSize in Settings can be reduced significatly (16bytes works fine - pending use case)
2020-03-21 19:51:53 +01:00
lathoub e4ad19d40e cleanup setHandleMessage
unfortunately, not using aliases yet (too complex)
2020-03-18 07:06:02 +01:00
lathoub c09c8e8148 aliasing for callbacks (and default initializers 2020-03-18 06:55:45 +01:00
lathoub 2734894485 mPendingMessageExpectedLength as before
mMessage.length is reset to 0 before the callback, so bring back mPendingMessageExpectedLength as before, and set mMessage.length (and not reset it)
2020-03-15 16:57:01 +01:00
lathoub ee4e7b3942 changed based on Franky47's feedback
- send: pass the message as a const ref, to avoid copies
- add mSerial.begin (with Baudrate - added Settings)
- ThruActivated defaults to true
- class name serialMIDI => SerialMIDI
2020-03-11 22:46:06 +01:00
lathoub 8893642b27 added send(MidiMessage), added (untested) bridge example
added send(MidiMessage) for Bridge application (that convert MIDI transport x into MIDI transport y), avoiding parsing entry a stream, setting up all callback - whilst this allows for passing the content, without to much processing/parsing.

Had to move mPendingMessageExpectedLenght into MidiMessage to avoid parsing the data again, just to know the size

Added Bridge example (untested)
2020-03-09 23:05:44 +01:00
lathoub 8905d36c0e added callback for Message
before the specific callback are called, a generic mMessage callback can be fired to inform the user that 'a' message has been received.
2020-03-09 09:40:44 +01:00
lathoub 7bb64074e1 renamed Encoder -> Transport, added MidiType to beginTransmission in serialMIDI 2020-03-09 09:00:17 +01:00
lathoub 35d1d6216a set ActiveSensing Periodicity in ms
Gives more control over the bool value. Typical value is 300 (ms) - an Active Sensing command is send every 300ms; or 0 (zero) to disable sending ActiveSensing
2020-03-07 10:15:59 +01:00
lathoub 1b6a755c58 add MidiType to beginTransmission
Avoids reparsing of the stream in the transport layer, in order to get the MidiType
2020-03-07 08:25:16 +01:00
lathoub 1325c23329 added Platform class to abstract millis() 2020-03-05 19:58:49 +01:00
lathoub fc752bc834 lift and shift of the Serial code into a seperate class, allowing for other serializers
lift and shift of the Serial code into a seperate class, allowing for other serializers as AppleMIDI, USBMIDI, ipMIDI, BLE-MIDI
2020-03-04 19:49:27 +01:00
lathoub 0d596066b4 added support for receiving SysEx command segments
Very long SysEx mesaages are cut in to multiple command segments
Where a normal SysEx starts with F0 and ends with F7, the first segment will start with F0 and end with F0, the middle section (optional) start with F7 and ends with F7 - the last segments starts with F7 and ends with F0
2020-02-10 15:04:45 +01:00
lathoub 5fab6b3fc3 replaced ActiveSensing with Sender Active Sensing
Receiver active Sensing is not implemented (yet)
2020-02-04 10:46:14 +01:00
lathoub 7f9934b1aa added support for ActiveSensing
From: https://www.midi.org/specifications/item/table-1-summary-of-midi-message

Active Sensing. This message is intended to be sent repeatedly to tell the receiver that a connection is alive. Use of this message is optional. When initially received, the receiver will expect to receive another Active Sensing message each 300ms (max), and if it does not then it will assume that the connection has been terminated. At termination, the receiver will turn off all voices and return to normal (non- active sensing) operation.
2020-01-26 11:05:10 +01:00
Francois Best 42b98a78cf refactor: Avoid redundant call 2018-10-11 10:33:07 +02:00
Francois Best 33bd77dd13 fix: Fix more sign / implicit type conversion warnings 2018-03-10 17:59:17 +01:00
Lennart 3396ec9429 fixed some warnings when compiling with -Wconversion and -Wsign-conversion 2017-07-18 10:37:49 +02:00
Francois Best 3a31a366e4 Changed def to match updates to cake library (FortySevenEffects/cake) 2017-01-07 14:40:27 +01:00
Francois Best 82f5dca265 Bumped version to 4.3.1, fixing Arduino lib file.
Removed redundant version mentions in sources.
2016-11-04 10:53:18 +01:00
Francois Best 437d5ebce0 Bump version in sources. 2016-10-30 09:50:01 +01:00
Francois Best 4eee744b35 More unreacheable code hunt. 2016-10-29 16:21:06 +02:00
Francois Best 4ab8728c67 Removed unreacheable code, inlined stuff. 2016-10-29 16:09:04 +02:00
Francois Best 597a75e638 Keep running status when not sending anything.
Fixes #61
2016-10-29 09:42:47 +02:00
Francois Best 5d3cbd1f9f #54: added overload of sendAfterTouch for poly. Deprecates sendPolyPressure. 2016-10-28 09:13:06 +02:00
Francois Best f1f0ef41ce Using new definitions for Thru. 2016-10-27 08:11:29 +02:00
Francois Best 8ebd4f9161 Cleanup & init'd thru. 2016-10-20 10:08:00 +02:00
Francois Best 5f7fa5d083 Fix #58. 2016-10-15 13:41:50 +02:00
Francois Best 300cb139e9 #54: Deprecated sending of TuneRequests with sendRealTime. 2016-10-10 14:23:50 +02:00
Francois Best 34b37f75e8 Fixed order of DataEntry bytes (MSB first). 2016-10-07 09:50:37 +02:00
Francois Best bc0308223c Initialise new attributes. 2016-10-07 00:58:35 +02:00
Francois Best 489b49b862 Fix thruFilter bug from #45. 2016-10-07 00:49:50 +02:00
Francois Best 96374a1fa1 Added RPN/NRPN sending facilities.
Needs doc, closes #37.
2016-10-07 00:38:27 +02:00
Francois Best c29dfd84d7 Added more tests & fixed #53 (sendPitchBend range). 2016-10-06 20:49:38 +02:00
Francois Best 6705d0ed81 Initialize attributes with default values. 2016-10-04 18:55:47 -07:00
Francois Best 55f91d54aa Fix float pitch bend. 2016-08-19 14:58:39 +02:00
Francois Best 219797524d Fixed MIDI.read with input channel parameter. 2016-04-03 17:58:00 +02:00
Francois Best fb693e7245 Changed license to MIT. 2015-08-13 09:03:17 +02:00
Francois Best e31d0a1910 Doc. 2014-06-11 09:33:32 +02:00
Francois Best 3dc0f30e16 Removed compile flags and last preprocessor settings. 2014-06-11 09:14:03 +02:00