Commit 7d99e6b
authored
BREAKING: Re-port MIDI, faster, lower memory, ESP32 support (earlephilhower#790)
* Pull untouched upstream TinySoundFont
Start from the upstream TinySoundFont by @schellingb at
https://github.com/schellingb/TinySoundFont and rearchitect the MIDI
processing.
* Convert to PROGMEM-based SoundFont structures.
This makes it much faster to access the SoundFont and also removes all the
static RAM usage. The samples, the regions, the instruments are all now
in ROM. Only the dynamic voices and related info takes up RAM. No caching.
* (Re)convert to fixed point math.
TSF upstream is built for systems with real floating point units (and
produces great sound with it!), but processors like the Pico, ESP8266,
and several models of ESP32 don't have one so emulate FP in *extremely*
slow SW. Use fixed point (integer) representations for the inner loop
and wherever possible to avoid `float` math.
For processors like the Pico 2 or original ESP32 with hardware FPUs this
still increases performance since integer is still much faster.
* Redo the example and add default SF2s
Rewrite the MIDI examples to use PROGMEM for both SF2 and MID file.
It simplifies life for the casual user and me.
* Breaking change
The MIDI object now has a `midi::SetSoundFont(tsf *)` instead of a
`midi::SetSoundfont(AudioFileSource *)`. It no longer supports reading
SF2 from LittleFS or SD.1 parent 3e099fe commit 7d99e6b
File tree
31 files changed
+64533
-2836
lines changed- .github/workflows
- examples
- PlayMIDIFromLittleFS
- PlayMIDIFromROM
- PlayMIDIFromSPIFFS
- data
- lib
- midi-sources
- src
- libtinysoundfont
- tests
- host
31 files changed
+64533
-2836
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
Binary file not shown.
Binary file not shown.
0 commit comments