Commit Graph

377 Commits

Author SHA1 Message Date
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 bc4e940701 strong typing Channel in the callbacks 2020-03-17 23:44:24 +01:00
lathoub 8fc25fa8f9 DefaultPlatform for Arduino 2020-03-17 09:22:24 +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 e7588b906d return a *pointer* (not a ref) to the transport layer 2020-03-15 01:59:12 +01:00
lathoub 4da4538cd3 return reference to Transport layer 2020-03-15 01:46:13 +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 08ab5b93de added namespace reference 2020-03-07 10:26:47 +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 771f923223 active sensing defaults to false, to avoid spamming devices 2020-03-07 08:37:04 +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
lathoub a1bff07a1e Update midi_Defs.h 2019-08-18 11:40:00 +02:00
lathoub fabf4293f9 stuff to ignore list 2019-08-18 11:38:46 +02:00
Francois Best 96b7fd4537 chore: Config file update 2018-11-07 12:09:47 +01:00
Francois Best b3ab309781 doc: Update Readme
Fix typos, add USB support
2018-11-07 12:09:37 +01:00
Francois Best faa7bade0b cleanup: Dedupe RingBuffer implementation in mocks 2018-11-07 12:08:12 +01:00
Francois Best a9e0db5b73 fix: Test examples in CI 2018-11-06 16:58:05 +01:00
Francois Best 39d13e8ac4 feat: Add MIDI USB test sketches 2018-11-06 16:55:51 +01:00
Francois Best 5835806832 fix: Constify 2018-11-06 16:55:08 +01:00
Francois Best 347b67a877 fix: Point back to original MIDIUSB repo
Now that arduino-libraries/MIDIUSB#47 has been merged.
2018-11-06 12:47:26 +01:00
Francois Best 0e9e505543 doc: Note the importance of Running Status being disabled for USB 2018-11-04 14:17:30 +01:00
Francois Best 67a13be6c6 fix: Use USB packet interface in the transport layer 2018-11-04 14:17:07 +01:00
Francois Best 5ccf0159a2 feat: Serialise USB MIDI packets into the serial RX buffer 2018-11-04 10:07:21 +01:00
Francois Best 1ccd7c3ce8 feat: Add SysEx support for USB MIDI 2018-11-03 21:47:37 +01:00
Francois Best 5b96487362 feat: Compose TX USB MIDI packets from serial buffer 2018-11-03 18:59:20 +01:00
Francois Best 3f15b733e4 feat: Get CIN from status byte
Removed unused implementation of UsbMidiEventPacket
2018-11-03 18:58:45 +01:00
Francois Best a34087c92c feat: Add peek and pop methods 2018-11-03 18:56:42 +01:00
Francois Best 9a0907ea7f chore: Point MIDI-USB submodule to own fork for unit testing 2018-11-03 18:56:11 +01:00
Francois Best b9397337d2 doc: Update links
[skip ci]
2018-10-11 11:45:46 +02:00
Francois Best db0f65a46e fix: Unnamed namespace macro is not available here 2018-10-11 11:37:40 +02:00
Francois Best 42b98a78cf refactor: Avoid redundant call 2018-10-11 10:33:07 +02:00
Francois Best 04ae12d9ad chore: Add VSCode config files & editor settings 2018-10-11 10:32:26 +02:00
Francois Best 83ad031ee6 fix: Add tests and fix RingBuffer implementation 2018-10-11 10:31:23 +02:00
Francois Best ba6e16442b Merge master into feat/4.4.0 2018-03-10 18:51:47 +01:00
Francois Best 1cd638361e chore: Update VSCode C++ helper file 2018-03-10 18:43:15 +01:00
Francois Best 561def7c06
Merge pull request #81 from LnnrtS/fixedWarnings
fix: Implicit conversion & sign comparison compiler warnings

- Increase warning level for sources
- Fix implicit conversion & sign comparison warnings
2018-03-10 18:41:36 +01:00
Francois Best 33bd77dd13 fix: Fix more sign / implicit type conversion warnings 2018-03-10 17:59:17 +01:00
Francois Best c5833214a1 feat: Increase warning level for sources
Don't do it globally as externals may have warnings we can't do much about.
2018-03-10 17:44:16 +01:00
Francois Best d9cad6034f chore: Upgrade Google Test to release-1.8.0 2018-03-10 17:10:47 +01:00