If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

These numbers are just the result of an analog to digital conversion of the waveform. It's a simple array of 257 numbers - no magic.

To create new waveforms, you might either write these samples by hand, number for number, if you have a Fourier synthesis mind and imagination. You might also generate the array with mathematics, as long as you are able to define a function which describes exactly the waveform. Or you might record a waveform digitally, cut off exactly one period and then export the result.

The wav file format is well documented on the web. You'd have to write some simple code, which could be done in the language you are most used to (for example Python, or even php) to read the file byte per byte, identify and analyse the header data block, check it for byte order, sampling rate and depth first, and then read and re-assemble the audio data until you get exactly one period of the waveform. Then, you'll most probably have to do some upsampling/downsampling/interpolation to squeeze it into exactly 257 samples, write these out as an array and you are done. Nothing complicated.

If your goal is to play sample-based instrument sounds (difficult to understand your desires from the limited text you wrote), perhaps look at this newer, much more complete wavetable synthesis project.

If your goal really is just creating specific waveforms, you've got some work to do. The arb waveform feature is very spartan. It's not a complete solution, only 1 piece of a larger puzzle. For higher frequency output, it requires you to pre-filter your data to avoid Nyquist aliasing, as well as the ability to deal with getting data converted to the array it requires. If you're not familiar with how to do these sorts of things, I'm afraid the usability of this particular feature probably just isn't easy enough in its current state.

tensian wrote........ Now I want my own wavetables, but I do not know how to get this kind of data from a WAV,

If it is just the wave table you want.....the easiest way is play the WAV file in Audacity, if stereo tracks, merge it it mono track in audacity, Zoom in to expand the waveform until you can see the waveform shape and pick what looks like 1 cycle that repeats itself. Set the display measurement to samples and note or count the number of samples for 1 cycle. Example if playing WAV of note A=440 Hz or you have generated a tone of 440 Hz in Audacity, zoom in and select 1 cycle, press Z to get the Zero crossings and you should have 100 samples if your samplerate is 44100, edit copy the selection, close the track and set samplerate to 257/100=2.57 times 44100 = 113337, open a new mono track and paste your cilpboard to the start of the track. Zoom to fill screen width and you should see one cycle of the waveform but now 257 samples. You can play it in Audacity using shift cilck play to hear it. Using Audacity Sample Data Export this out as text Linear, give it a name and you should have a text file of the amplitude of each sample in the cycle. It will be a big long single column list but that is OK for teensy. Now using Excel or any spreadsheet paste this into a single column, multiply each cell to give a max value of 30000. Insert a line graph of this column of data and you should see your waveform. Check that there are 257 items in the list and make the first and last the same value. Append a comma to the end of each cell and copy and past this as text into a text file called anyname.h. You need to add these bits as well to make it and array.....const int16_t AKWF_cello_0001[257] = { } etc It does not need to be in 10 columns wide and save it in the same folder as your sketch and put a #include anyname.h in the top of the sketch. and it should all work....but it is only a few miliseconds of a sound that will be repeated over and over as teensy plays it.........so its OK for constant tones and can be played at various frequencies. ...any more than that you need to use envelope and filters etc to create realistic sounds