Velocity in the MIDI format goes from 1...127, so scale the volume of
the note generator by /128 instead of /256. Increases volume of all
notes by 2x linearly (3dB).
Found by Marc Madaule
* Fix hanging sound on WAV stop for ESP32
* Fix hanging sound on AAC stop for ESP32
* Fix hanging sound on MIDI stop for ESP32
* Fix hanging sound on MOD stop for ESP32
* Fix hanging sound on MP3a stop for ESP32
* Fix hanging sound on RTTTL stop for ESP32
All objects can have a metadata and/or status report callback once created.
They will call the source program with the parsed ID3 tag, ICY StreamTitle,
or text and numeric error ID of any interesting event. It is up to the end
application to figure out what to do with this. Normally, you'd just print
it to the LCD or Serial port. But it is possible to detect, say, a buffer
overflow and then switch to a lower bitrate stream for example.
Forgot to save the passed in *AudioFileSource, since it was not needed
in the MIDI playback engine (it's encapsulated in a buffered object). Now
with ::loop in every object, it's needed and we were calling a garbage
object causing a random crash.
Adds a virtual loop() method to the file input and audio output objects.
By default does nothing, but it can be used to prefill buffers/etc. in the
case of a buffered input, or to update a volume meter on an output, etc.
The AudioGenerators all now call it as part of their own loop()s, so there
is no user intervention required to make it work.
Thanks to @armSeb for the idea with his SPI RAM code.
AudioGeneratorMIDI plays a .MID file using any Soundfont2 wavetable
synthesis file. This is a highly hacked combination of TinySoundFont
and MIDITONES, and requires the FastROMFS to run at real-time in most
cases.