#ifndef soundconfig_HEADER_ #define soundconfig_HEADER_ #include #include // Provides PATH_MAX. #include "const.h" // A SoundConfig struct represents the configuration for a single sampled // sound. It contains the path to the files, the sound effects (pre and post), // global sound effects, and standard configuration. typedef struct { // This is a glob spec for the files to use. All files should end in // -XXX-YYY.flac where XXX is the velocity level and YYY is the variation. char path[PATH_MAX]; char fx_pre[MAX_FX][MAX_FX_LINE]; char fx_post[MAX_FX][MAX_FX_LINE]; char global_fx_pre[MAX_FX][MAX_FX_LINE]; char global_fx_post[MAX_FX][MAX_FX_LINE]; // The amplitude of the sample as a function of velocity. For a normalized // velocity between 0 and 1, the amplitude of the output will scale like // velocity^gamma_amp. double gamma_amp; // Similar to gamma_amp, but used when choosing the velocity layer. double gamma_layer; // If non-zero, this is the fade out time-constant (e-folding time) when a // sound is released (key-up event). double tau_off; // If non-zero, this is the fade-out time-constant (e-folding time) when a // sound is cut by another sound. The cut time constant will override // tau_off. double tau_cut; // If true, trigger two layers with proportional amplitudes when velocity // lands between them. bool mix_layers; } SoundConfig; void soundconfig_load_defaults(SoundConfig *conf); void soundconfig_copy_globals(SoundConfig *to, SoundConfig *from); void soundconfig_proc_fx(SoundConfig *conf, const char *line, bool pre); double proc_raw_tau_value(double value); #endif