Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Macros | |
#define | FREQ_HZ(whole) (((whole) & 0xFFFFu) << 16) |
#define | FREQ_HZ_FRAC(flhz) ((((uint32_t)(flhz)) << 16) | ((uint32_t)(((flhz) - ((float)((uint32_t)(flhz)))) * 65536.0))) |
#define | TOM(idx, len, noiseVol, sineVol, freq, done) |
#define | DONUT_SAMPLE_RATE_HZ 8192 |
#define | SAMPLE_FACTOR (DAC_SAMPLE_RATE_HZ / DONUT_SAMPLE_RATE_HZ) |
Functions | |
int8_t | defaultDrumkitFunc (percussionNote_t drum, uint32_t idx, bool *done, uint32_t scratch[4], void *data) |
Produces sounds for a standard drumkit according to the General MIDI standard. | |
int8_t | donutDrumkitFunc (percussionNote_t drum, uint32_t idx, bool *done, uint32_t scratch[4], void *data) |
Produces sounds for the drumkit that was included on the King Donut synth swadge. | |
#define FREQ_HZ | ( | whole | ) | (((whole) & 0xFFFFu) << 16) |
#define FREQ_HZ_FRAC | ( | flhz | ) | ((((uint32_t)(flhz)) << 16) | ((uint32_t)(((flhz) - ((float)((uint32_t)(flhz)))) * 65536.0))) |
#define TOM | ( | idx, | |
len, | |||
noiseVol, | |||
sineVol, | |||
freq, | |||
done ) |
#define DONUT_SAMPLE_RATE_HZ 8192 |
#define SAMPLE_FACTOR (DAC_SAMPLE_RATE_HZ / DONUT_SAMPLE_RATE_HZ) |
int8_t defaultDrumkitFunc | ( | percussionNote_t | drum, |
uint32_t | idx, | ||
bool * | done, | ||
uint32_t | scratch[4], | ||
void * | data ) |
Produces sounds for a standard drumkit according to the General MIDI standard.
drum | The MIDI note corresponding to the drum to play |
idx | The sample index, which should start at 0 for each note and increase by one every sample |
done | A pointer to a boolean which will be set to true when the drum is finished sounding |
scratch | Not used by this drumkit |
data | Not used by this drumkit |
int8_t donutDrumkitFunc | ( | percussionNote_t | drum, |
uint32_t | idx, | ||
bool * | done, | ||
uint32_t | scratch[4], | ||
void * | data ) |
Produces sounds for the drumkit that was included on the King Donut synth swadge.
This drumkit does not use the General MIDI drum note numbers
drum | The drum index, between ACOUSTIC_BASS_DRUM_OR_LOW_BASS_DRUM and HIGH_BONGO, inclusive |
idx | The sample index |
done | A pointer to a boolean which will be set to true when the drum is finished sounding |
scratch | Scratch space which is used to faithfully reproduce the drum sounds |
data | Not used by this drumkit |