2024-06-24 07:58:31 +00:00
|
|
|
#if !defined(STFU_CONFIG)
|
|
|
|
#define STFU_CONFIG
|
2024-06-13 11:43:53 +00:00
|
|
|
|
|
|
|
/* Determines output framerate, in times per second. */
|
|
|
|
#define STFU_AUDIO_FRAME_RATE 44100
|
|
|
|
#define STFU_AUDIO_CHANNEL_COUNT 2
|
|
|
|
|
|
|
|
#define STFU_C4_FREQUENCY 261.63f
|
|
|
|
#define STFU_A4_FREQUENCY 440.0f
|
|
|
|
#define STFU_NOTE_UPSCALE_FACTOR 1.059463094f
|
|
|
|
#define STFU_NOTE_DOWNSCALE_FACTOR 0.943874313f
|
|
|
|
|
2024-06-14 08:18:00 +00:00
|
|
|
/* Introduces delayed buffering for purposes of crossfading channels when notes
|
|
|
|
* are retriggered, needed for filtering clicks */
|
2024-06-24 07:58:31 +00:00
|
|
|
#define STFU_CROSSFADE_BUFFER_FRAMES 32
|
2024-06-14 08:18:00 +00:00
|
|
|
|
2024-06-24 07:58:31 +00:00
|
|
|
static const float STFU_SCALE[12] = {
|
|
|
|
STFU_C4_FREQUENCY,
|
|
|
|
STFU_C4_FREQUENCY * STFU_NOTE_UPSCALE_FACTOR,
|
|
|
|
STFU_C4_FREQUENCY * STFU_NOTE_UPSCALE_FACTOR *
|
|
|
|
STFU_NOTE_UPSCALE_FACTOR,
|
|
|
|
STFU_C4_FREQUENCY * STFU_NOTE_UPSCALE_FACTOR *
|
|
|
|
STFU_NOTE_UPSCALE_FACTOR * STFU_NOTE_UPSCALE_FACTOR,
|
|
|
|
STFU_C4_FREQUENCY * STFU_NOTE_UPSCALE_FACTOR *
|
|
|
|
STFU_NOTE_UPSCALE_FACTOR * STFU_NOTE_UPSCALE_FACTOR *
|
|
|
|
STFU_NOTE_UPSCALE_FACTOR,
|
|
|
|
STFU_A4_FREQUENCY * STFU_NOTE_DOWNSCALE_FACTOR *
|
|
|
|
STFU_NOTE_DOWNSCALE_FACTOR * STFU_NOTE_DOWNSCALE_FACTOR *
|
|
|
|
STFU_NOTE_DOWNSCALE_FACTOR,
|
|
|
|
STFU_A4_FREQUENCY * STFU_NOTE_DOWNSCALE_FACTOR *
|
|
|
|
STFU_NOTE_DOWNSCALE_FACTOR * STFU_NOTE_DOWNSCALE_FACTOR,
|
|
|
|
STFU_A4_FREQUENCY * STFU_NOTE_DOWNSCALE_FACTOR *
|
|
|
|
STFU_NOTE_DOWNSCALE_FACTOR,
|
|
|
|
STFU_A4_FREQUENCY * STFU_NOTE_DOWNSCALE_FACTOR,
|
|
|
|
STFU_A4_FREQUENCY,
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|