A script for converting raw 8 bit sound data files to wavetables for Mozzi. More...
Go to the source code of this file.
A script for converting raw 8 bit sound data files to wavetables for Mozzi.
Usage: >>>char2mozzi.py <infile outfile tablename samplerate>
infile | The file to convert, RAW(headerless) Signed 8 bit PCM. |
outfile | The file to save as output, a .h file containing a table for Mozzi. |
tablename | The name to give the table of converted data in the new file. |
samplerate | The samplerate the sound was recorded at. Choose what make sense for you, if it's not a normal recorded sample. |
For generated waveforms like sine or sawtooth, set the project rate to the size of the wavetable you wish to create, which must be a power of two (eg. 8192), and set the selection format (beneath the editing window) to samples. Then you can generate and save 1 second of a waveform and it will fit your table length.
For a recorded audio sample, set the project rate to the MOZZI_AUDIO_RATE (16384 in the current version). Samples can be any length, as long as they fit in your Arduino.
Save by exporting with the format set to "Other uncompressed formats", "Header: RAW(headerless)" and "Encoding: Signed 8 bit PCM".
Now use the file you just exported, as the "infile" to convert.
Definition in file char2mozzi.py.
Functions | |
def | char2mozzi.char2mozzi (infile, outfile, tablename, samplerate) |