Expanded struct for drums: added id (which represents the line number in the config file) for internal unique usage. So midinote can be dropped as identifier later.

pull/112/head
Holger Wirtz 3 years ago
parent e59ea3636f
commit beacfadbc7
  1. 5
      addon/tools/wav2c.sh
  2. 1
      drums.h
  3. 16500
      drumset.h

@ -124,9 +124,7 @@ do
if [ "${?}" == 0 ] if [ "${?}" == 0 ]
then then
# Generate drumset.h # Generate drumset.h
echo "'${WAV_DIR}/${sample['filename']}' -> '${sample['c_name']}'" echo "'${WAV_DIR}/${sample['filename']}' -> '${sample['c_name']}'"
NUM_DRUMSET_CONFIG=`expr "${NUM_DRUMSET_CONFIG}" + 1`
if [ -z "${converted_files[${sample['filename']}]}" ] if [ -z "${converted_files[${sample['filename']}]}" ]
then then
@ -172,6 +170,7 @@ do
cat >> "${DRUMS_H}" << EOF cat >> "${DRUMS_H}" << EOF
{ {
${sample[class]}, ${sample[class]},
${NUM_DRUMSET_CONFIG},
${sample[midinote]}, ${sample[midinote]},
"${sample[name]}", "${sample[name]}",
${sample[c_name]}, ${sample[c_name]},
@ -185,6 +184,7 @@ do
${sample[reverb_send]} ${sample[reverb_send]}
}, },
EOF EOF
NUM_DRUMSET_CONFIG=`expr "${NUM_DRUMSET_CONFIG}" + 1`
fi fi
else else
echo "File \'${WAV_DIR}/${sample['filename']}\' does not exits." >&2 echo "File \'${WAV_DIR}/${sample['filename']}\' does not exits." >&2
@ -195,6 +195,7 @@ cat >> "${DRUMS_H}" << EOF
{ {
DRUM_NONE, DRUM_NONE,
0, 0,
0,
"EMPTY", "EMPTY",
NULL, NULL,
"-", "-",

@ -32,6 +32,7 @@
typedef struct drum_config_s { typedef struct drum_config_s {
uint8_t drum_class; // Type of drum uint8_t drum_class; // Type of drum
uint8_t id; // ID for reference in sequencer
uint8_t midinote; // Triggered by note uint8_t midinote; // Triggered by note
char name[DRUM_NAME_LEN]; char name[DRUM_NAME_LEN];
const uint8_t* drum_data; const uint8_t* drum_data;

16500
drumset.h

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save