HOWTO: Convert Adventurekid .wav samples for use with arbitraryWaveform

Status
Not open for further replies.

quarterturn

Well-known member
Here's my method of converting the samples found in http://www.adventurekid.se/AKRTfiles/AKWF/AKWF.zip or the github https://github.com/KristofferKarlAxelEkstrand/AKWF-FREE

These are single-cycle 600 sample wavetables. To use arbitraryWaveform with an AudioSynthWaveform instance we need 256 sample wavetable. Here's how I converted them:

You will need:
- sox
- hexdump
- sed
- Audacity for your OS version

Note this is a Unix/Linux-oriented how-to. You may have to find a substitute for sed on Windows but the pipe and redirect commands should work in Windows.

1. Launch Audacity and navigate to a sample folder, eg. "AKWF_bw_saw"
2. Open one of the .wav files. I'm not sure if there's a list of what they are, but basically they are all variations on the folder theme. Pick one and see.
3. To see how the sample sounds, hold <shift> and click the "Play" button.
4. Click in the sample window and press <ctrl><a> to select the whole sample.
5. Choose "Effect"->"Change Speed..." from the menubar.
6. Set the "Speed Multiplier" to "2.343" and click <OK>. This will shrink the WAV to exactly 256 samples.
7. Choose "File"->"Export"->"Export as WAV" and save the file someplace.
8. In a shell, run the following command:

Code:
sox -V <path to wav>/<filename>.wav -t raw -e signed - | hexdump -v -e '2/2 " %5d "' | sed 's/  */ /g' > <path to output>/<filename>.txt


9. Use a text editor to clean up the file a bit so it is easy to make it an array. I used 'vi' and do the following:
- delete the first space
- :%s/ /,/g
to replace all the spaces with commas

10. Copy the edited text file to go inside the { } of your array declaration.

That's it. You now have a new wavetable!

Note that single-cycle waveforms work best when they are simple. For more complex waveforms, our ears pick up changes in timbre caused by changing playback speed and the sample will sound 'off' as you move away from the C4 on either side. Hence the use of multi-samples on modern synths. However, if you keep it simple, this is a good way to get more sounds without having to stack saw or pulse waveforms.
 
Status
Not open for further replies.
Back
Top