Skip to content

Commit af4c7bd

Browse files
authored
Update README.md
1 parent 183545d commit af4c7bd

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

README.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,15 @@ More usages in the [examples](https://github.com/lathoub/Arduino-AppleMIDI-Libra
7575
* Teensy WIZ820io W5200
7676
* Teensy 4.1 with [Ethernet Kit](https://www.pjrc.com/store/ethernet_kit.html)
7777
78-
## Arduino Memory usage
79-
Out of the box, this library has been setup to use a 'medium' amount of memory (read below how to reduce the memory footprint). Extended callbacks are not enabled by default, and can be anabled by `#USE_EXT_CALLBACKS`. See the callback examples.
80-
81-
This library is **not using any dynamic memory** allocation methods - all buffers have a fixed size, set in the `AppleMIDI_Settings.h` file, avoiding potential memory leaks and memory fragmentation (also, no usage of the String() class).
82-
83-
The minimum buffer size (`MaxBufferSize`) should be set to 64 bytes (also the default). Setting it to a higher value will make sending larger SysEx messages more efficiant (large SysEx messages are chopped in pieces, the larger the buffer, the less pieces needed), at the price of a bigger memory footprint.
84-
85-
`MaxNumberOfParticipants` is another way to cut memory - each session particpant uses approx 300 bytes. Default number of participants is 2 (each using 2 sockets).
86-
Beware: the number of sockets on the Arduino is limited. The W5100 support 4 (hance default number of participants is 2), the W5200 and W5500 based IP chips can use 8 sockets. (Base port can be set in `APPLEMIDI_CREATE_DEFAULT_INSTANCE`)
87-
88-
Reduce the memory footprint by a further wopping 500 bytes by `#define NO_SESSION_NAME` before `#include <AppleMIDI.h>`. This will leave out all the code to manage the optional session name. The RtpMIDI service client will show the name as (manually) defined in the directory.
89-
90-
Even further reduce the memory footprint by `#define ONE_PARTICIPANT` limiting the number of particpants to just 1.
91-
On an UNO the absolute minimum memory footprint is 21966 bytes (68%) and 945 global variables (46%). For a Leonardo that is 24906 bytes (86%) and 1111 bytes (43%) of global variables.
92-
9378
## Notes
9479
9580
### Session names
9681
9782
Session names can get really long on Macs (eg 'Macbook Pro of Johann Gambolputty .. von Hautkopft of Ulm') and will be trunctated to the `MaxSessionNameLen` (as set in the settings file).
9883
84+
### memory footprint
85+
The memory footprint of the library can be lowered significantly, read the [wiki](https://github.com/lathoub/Arduino-AppleMIDI-Library/wiki/Memory-footprint)
86+
9987
### Ethernet buffer size
10088
It's highly recommended to modify the [Ethernet library](https://github.com/arduino-libraries/Ethernet) or use the [Ethernet3 library](https://github.com/sstaub/Ethernet3) to avoid buffer overruns - [learn more](https://github.com/lathoub/Arduino-AppleMIDI-Library/wiki/Enlarge-Ethernet-buffer-size-to-avoid-dropping-UDP-packages)
10189

0 commit comments

Comments
 (0)