-
Notifications
You must be signed in to change notification settings - Fork 2
Performance
It is critical that you can generate all the needed samples within the indicated sample rate! The speed is also driving the polyphonic performance of the instrument. If it takes longer to generate all samples then to play them, the instrument can not be used for life playing!
I was measuring the speed of the different instruments on an different microcontrollers.
Time to generate 10 sec music at 44100 samples per second
Instrument | ESP32 | STM32 Backpill | ESP32-C3 | RP2040 | Unit |
BeeThree | 1.573 | 3.712 | 21.879 | 23.163 | sec |
BlowHole | 1.835 | 4.128 | 21.535 | 23.083 | sec |
Bowed | 3.165 | 6.116 | 58.744 | 30.654 | sec |
Clarinet | 1.3 | 2.479 | 12.136 | 16.276 | sec |
Drummer | 0.121 | n/a | 0.344 | 1.305 | sec |
Flute | 1.49 | 3.08 | 16.677 | 16.9 | sec |
Rhodey | 1.888 | 4.364 | 25.778 | 29.701 | sec |
TubeBell | 1.952 | 4.415 | 26.771 | 29.212 | sec |
Mandolin | 1.117 | 2.484 | 12.492 | 14.021 | sec |
ModalBar | 0.693 | 1.89 | 15.697 | 18.684 | sec |
Moog | 0.983 | 2.208 | 14.303 | 17.808 | sec |
Plucked | 0.252 | 0.607 | 3.866 | 4.591 | sec |
Saxofony | 1.443 | 2.892 | 14.23 | 14.881 | sec |
Shakers | 0.129 | 0.329 | 0.376 | 1.831 | sec |
Sitar | 1.101 | 2.144 | 7.002 | 9.007 | sec |
StifKarp | 0.698 | 1.982 | 18.802 | 19.343 | sec |
TubeBell | 1.952 | 4.415 | 26.77 | 29.212 | sec |
Wurley | 1.88 | 4.353 | 25.657 | 28.033 | sec |
BlowBotl | 1.279 | 2.509 | 17.511 | 16.074 | sec |
Brass | 0.509 | 1.269 | 14.625 | 13.913 | sec |
FMVoices | 6.914 | 13.243 | 39.772 | 47.647 | sec |
PercFlut | 6.74 | 12.902 | 42.242 | 44.649 | sec |
HevyMetl | 6.517 | 12.439 | 41.42 | 39.268 | sec |
Recorder | 30.56 | 24.001 | 125.949 | 100.836 | sec |
Resonate | 0.989 | 1.883 | 5.753 | 6.491 | sec |
Simple | 1.33 | 3.125 | 12.211 | 12.424 | sec |
Whistle | 6.838 | 25.383 | 96.064 | 49.493 | sec |
Many instruments can be used on the ESP32, put we are limited in the number of polyphonic voices.
The ESP32-C3 RISC Processor and the RP2040 are too slow for the selected sample rate! Reducing it down to 16000 should however enable most instruments.
I was disappointed with the performance of the STM32 Blackpill which boasts of having a floating point unit!
The library is compiling on an ESP8266 - however it is too slow and there is not enough memory for most instruments!
The Instrument Performance Sketch can be found on github.