Creating custom waveforms

tejas

Member
Hello!

I am trying to create a waveform that resembles the recorded sound of an organ. I see two options for doing that.

1. Using arbitraryWaveform(): I would open the recorded sound in audacity and export one wavelength as text data. This is between -1 and +1. I have three questions in this approach.
- The wavelength exported by audacity may not be exactly 256 samples. Should I make them 256? If so, how could I do that?
- What scaling should I use to convert the -1 to +1 range to something suitable for this function?
- The function says that for frequencies higher than 172Hz, one should 'bandwidth limit your waveform data'. How could I do that?

2. Using AudioSynthWavetable: This option uses the SoundFont2 files to load waveforms. However, the software mentioned in the help video
uses https://github.com/TeensyAudio/Wavetable-Synthesis which is quite old and doesn't seem to work properly in newer operating systems.
- Do you have a recommendation for a software that can convert audio to SoundFont2?
- Is there some other way to use AudioSynthWavetable?

Other than these two options, are there other ways to recreate the sound of an organ?

Thank you in advance!
 
1. Using arbitraryWaveform(): I would open the recorded sound in audacity and export one wavelength as text data. This is between -1 and +1. I have three questions in this approach.
- The wavelength exported by audacity may not be exactly 256 samples. Should I make them 256? If so, how could I do that?
It's called rate conversion, but its important to get it accurate to avoid artifacts, which means accurately measuring the sampled frequency.
- What scaling should I use to convert the -1 to +1 range to something suitable for this function?
- The function says that for frequencies higher than 172Hz, one should 'bandwidth limit your waveform data'. How could I do that?
Hopefully whatever software you use for the rate conversion also has this as an option. Basically you need a brick-wall low-pass filter applied before rate conversion to keep everything below the Nyquist frequency in the output.
 
https://www.polyphone-soundfonts.com/
Can be used to create soundfont files

Then I have updated/fixed the soundfont decoder
https://github.com/manicken/SoundFontDecoder

If you want runtime loading there is also
https://forum.pjrc.com/index.php?threads/soundfont-sf2-runtime-loader.74749/
note that the runtime loader is currently using the SD.open function and I don't know if that also includes spi connected sd cards
but either way I can make some changes to also include spi sd connected sd cards if you want to use this option.
 
Last edited:
Back
Top