Before I write anything about my long-term plans, I want to be absolutely clear that I'm currently working on 2 hardware projects and slowly working though a long list of issues to investigate, as well as the usual day-to-day answering of questions and solving immediate issues. I do indeed plan to do a LOT more with the audio library, but it will be sometime next year.
I know a lot of people want wavetable synthesis. I want to do it. But I want to do it well, with a good solution that will really give a lot of capability to everyone.
Already a lot of the raw components are in place inside the library. For example,
AudioSynthWaveform has an arbitrary waveform feature. In theory, you could bandwidth limit your repeating waveform and use that to play it at different speeds. You can use the sample player to play an attack waveform, if needed, and you can use the multiplier or filter and waveform objects to apply effects like vibrato. But even if you put all these pieces together, there's still the issue of composing samples.
My long term plan involves SoundFont. That plan may change, but so far, I've looked at a LOT of audio stuff and the SoundFont format seems to have by far the most good quality wavetable sound libraries published. At least a few very good, completely free SoundFont libraries exist covering all the general MIDI sounds. If there are other formats used to publish wavetable synthesis sounds, I'm certainly willing to consider them. However, I'm not willing to consider legacy formats, so if any reading this has a lot of nostalgia for Amiga, please know I'm not considering MOD format (but I wouldn't be opposed to accepting a contribution to play MOD...)
Of course, you're not going to load a SoundFile file directly into Teensy's flash memory, or even the SPI Flash chip. Some sort of conversion utility will load the SoundFile file and let you choose which voice you wish to use. It'll need to have some GUI controls to let you trade-off size vs quality in a variety of ways. Then it'll output raw data, optimized for the library, which you can copy into your sketch, or (someday) put onto the SPI Flash.
SoundFont is complex, but at least it's an open and (fairly) well documented file format. I'll attach the spec.
Chapter 9 is probably the most interesting part to read first. The diagram on page 48 shows most of the components needed. The "Oscillator" part actually plays an attack sample, followed by looping a waveform sample. Both are resampled to the desired note.
Resampling is done over only limited ranges, so separate samples can be used for different ranges of notes, different ranges of velocity, and so on. There's a lot of info (and jargon) in the document about how to associate different samples and parameters to note, velocity and control changes.
I've read this spec several times, and still quite a number of things aren't entirely clear to me. It's probably going to take some digging through actual SoundFont data and experimenting to really nail down details. I'm also imagining a bottom-up approach implementing the algorithms in the library meeting a top-down requirement from the spec, with the GUI tool bridging the gap to convert actual SoundFont data into something optimized to efficiently play by the library.
So, unless someone like Adrian Freed come in with some great advice about DSP and music stuff or knows of a better format than SoundFont (which actually has a lot of high quality material already published), this is roughly my plan.
If you do work on this, I hope you'll at least use the SoundFont synthesis model as a guideline. It's an open, widely used, and well proven way of doing wavetable synthesis. Hopefully, if you and others who take any of this on use SoundFont as a guideline, all our efforts can eventually converge to a wonderful future where you can import SoundFont to a web-based GUI, adjust stuff, and export to data that the library can play as high-quality wavetable synthesis.