ptttl v0.2.0
C implementation of a PTTTL parser. PTTTL is a superset of NOKIA's RTTTL that adds polyphony & vibrato.
|
Converts the output of ptttl_parse() into a WAV file. No dynamic memory allocation, and no loading the entire WAV file in memory. More...
Go to the source code of this file.
Macros | |
#define | PTTTL_WAVFILE_GENERATION_STRATEGY 0 |
Functions | |
int | ptttl_to_wav (ptttl_parser_t *parser, FILE *fp, ptttl_sample_generator_config_t *config, ptttl_waveform_type_e wave_type) |
Converts the output of ptttl_parse() into a WAV file. No dynamic memory allocation, and no loading the entire WAV file in memory.
Requires ptttl_parser.c and ptttl_sample_generator.c
Requires stdint.h, and fopen/fseek/fwrite from stdio.h
See https://github.com/eriknyquist/ptttl for more details about PTTTL.
#define PTTTL_WAVFILE_GENERATION_STRATEGY 0 |
Defines the strategy used by ptttl_to_wav to generate .wav files. The available options make various trade-offs between dynamic memory usage, performance, and composability:
int ptttl_to_wav | ( | ptttl_parser_t * | parser, |
FILE * | fp, | ||
ptttl_sample_generator_config_t * | config, | ||
ptttl_waveform_type_e | wave_type | ||
) |
Convert PTTTL/RTTTL source to .wav file
parser | Pointer to initialized parser object |
fp | File stream that has already been opened for writing. Generated contents of .wav file will be written here. |
config | Pointer to configuration for sample generator. May be NULL. If NULL, a default configuration will be used. |
wave_type | Waveform type to use for all channels |