Using the wavetable
From BuzzWiki
The basic steps
- Get a sample. (your parameter should be of type "wave" to ensure its always within range of the wavetable slot-count)
- If it doesnt exist, stop.
- Get a level for a specific pitch with GetNearestWaveLevel() (this is an important step. Multisamples are rare, but users -might- use separate samples for different keys on the keyboard.)
- If it doesnt exist, stop.
- Check the sample-format.
- Cast/convert to the format you need, making sure you dont go past the end of the bufferlength stored in the level.
Notes on using samples from the wavetable
- ALWAYS check in mi::work() to see if the sample-layer you are using still exists! The user might have unloaded/reloaded a waveform! There is no notification to the plugin of this at the moment.
