Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
drums.h File Reference

Go to the source code of this file.

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.
 

Function Documentation

◆ defaultDrumkitFunc()

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.

Parameters
drumThe MIDI note corresponding to the drum to play
idxThe sample index, which should start at 0 for each note and increase by one every sample
doneA pointer to a boolean which will be set to true when the drum is finished sounding
scratchNot used by this drumkit
dataNot used by this drumkit
Returns
int8_t The signed 8-bit sample generated for this tick of the drumkit

◆ donutDrumkitFunc()

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

Parameters
drumThe drum index, between ACOUSTIC_BASS_DRUM_OR_LOW_BASS_DRUM and HIGH_BONGO, inclusive
idxThe sample index
doneA pointer to a boolean which will be set to true when the drum is finished sounding
scratchScratch space which is used to faithfully reproduce the drum sounds
dataNot used by this drumkit
Returns
int8_t The signed 8-bit sample generated for this tick of the drumkit