Fix for multi using a sampel with different pitches.

pull/98/head
Holger Wirtz 3 years ago
parent 907ba61c4b
commit efeb605811
  1. 0
      addon/tools/wav2c.cfg
  2. 15
      addon/tools/wav2c.sh

@ -138,6 +138,8 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
{
EOF
declare -A converted_files
while IFS= read -r l
do
declare -A sample
@ -151,6 +153,7 @@ do
sample['class']=`echo "${samplecfg[0]}" | xargs`
sample['midinote']=`echo "${samplecfg[1]}" | xargs`
sample['name']=`echo "${samplecfg[2]}" | xargs`
sample['data_name']="${sample['name']}"
sample['shortname']=`echo "${samplecfg[3]}" | xargs`
sample['pitch']=`echo "${samplecfg[4]}" | xargs`
sample['pan']=`echo "${samplecfg[5]}" | xargs`
@ -166,6 +169,8 @@ do
then
# Generate drumset.h
if [ -z "${converted_files[${sample['filename']}]}" ]
then
basename=`echo "${sample['filename']}" | cut -d'.' -f1`
sox "${WAV_DIR}/${sample['filename']}" -c 1 -b 16 -L "${TMP}/${basename}.raw"
xxd -i "${TMP}/${basename}.raw" > "${TMP}/${basename}.h"
@ -196,7 +201,13 @@ do
fi
done
fi
echo "};" >> /tmp/b
echo "};" >> "${DRUMSET_H}"
converted_files["${sample['filename']}"]="${sample['name']},${sample['len']}"
else
sample['data_name']=`echo ${converted_files[${sample['filename']}]} | cut -d"," -f1`
sample['len']=`echo ${converted_files[${sample['filename']}]} | cut -d"," -f2`
fi
# Generate drums.h
cat >> "${DRUMS_H}" << EOF
@ -204,7 +215,7 @@ do
${sample[class]},
${sample[midinote]},
"${sample[name]}",
${sample[name]},
${sample[data_name]},
"${sample[shortname]}",
${sample[len]},
${sample[pitch]},

Loading…
Cancel
Save