You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
711 lines
9.0 KiB
711 lines
9.0 KiB
/*
|
|
MicroDexed
|
|
|
|
MicroDexed is a port of the Dexed sound engine
|
|
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
|
|
|
|
(c)2018-2021 H. Wirtz <wirtz@parasitstudio.de>
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
*/
|
|
|
|
#include <Arduino.h>
|
|
#include "config.h"
|
|
#include "drumset.h"
|
|
|
|
#ifndef _DRUMS_H
|
|
#define _DRUMS_H
|
|
|
|
typedef struct drum_config_s {
|
|
uint8_t drum_class; // Type of drum
|
|
uint8_t midinote; // Triggered by note
|
|
char name[DRUM_NAME_LEN];
|
|
const unsigned int* drum_data;
|
|
char shortname[2]; // 1 char name for sequencer
|
|
uint32_t len; // number of elements in drum_data
|
|
float32_t pitch; //
|
|
float32_t pan; // Panorama (-1.0 - +1.0)
|
|
float32_t vol_max; // max. Volume (0.0 - 1.0)
|
|
float32_t vol_min; // min. Volume (0.0 - 1.0, should be <= vol_max)
|
|
float32_t reverb_send; // how much signal to send to the reverb (0.0 - 1.0)
|
|
} drum_config_t;
|
|
|
|
enum {DRUM_NONE, DRUM_BASS, DRUM_SNARE, DRUM_HIHAT, DRUM_HANDCLAP, DRUM_RIDE, DRUM_CHRASH, DRUM_LOWTOM, DRUM_MIDTOM, DRUM_HIGHTOM, DRUM_PERCUSSION};
|
|
|
|
// DEFAULT MIDI CHANNEL FOR SAMPLEDRUMS
|
|
uint8_t drum_midi_channel = 10;
|
|
|
|
drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
|
|
{
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_A2,
|
|
"Xrhitom",
|
|
AudioSampleXrhitom,
|
|
"B",
|
|
6785,
|
|
0.0,
|
|
0.0,
|
|
0.8,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_AIS2,
|
|
"Vl1lbeep",
|
|
AudioSampleVl1lbeepw,
|
|
"B",
|
|
769,
|
|
0.0,
|
|
0.0,
|
|
0.8,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_B2,
|
|
"Vl1hbeep",
|
|
AudioSampleVl1hbeepw,
|
|
"B",
|
|
513,
|
|
0.0,
|
|
0.0,
|
|
0.8,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_C3,
|
|
"bd01",
|
|
AudioSampleBd01,
|
|
"B",
|
|
3617,
|
|
0.0,
|
|
0.0,
|
|
0.8,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_HANDCLAP,
|
|
MIDI_CIS3,
|
|
"cp02l",
|
|
AudioSampleCp02,
|
|
"C",
|
|
4961,
|
|
0.0,
|
|
-1.0,
|
|
0.6,
|
|
0.0,
|
|
0.1
|
|
},
|
|
{
|
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
|
DRUM_RIDE,
|
|
MIDI_DIS4,
|
|
"rd02",
|
|
AudioSampleRd02,
|
|
"R",
|
|
7681,
|
|
0.0,
|
|
-0.6,
|
|
0.3,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_B4,
|
|
"808Kick",
|
|
AudioSample808Kick,
|
|
"B",
|
|
13377,
|
|
0.0,
|
|
0.0,
|
|
0.8,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_C5,
|
|
"phkick1",
|
|
AudioSamplePhkick1,
|
|
"B",
|
|
2433,
|
|
0.0,
|
|
0.0,
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_SNARE,
|
|
MIDI_CIS5,
|
|
"rims1",
|
|
AudioSampleRims1wav,
|
|
"R",
|
|
385,
|
|
0.0,
|
|
-0.2,
|
|
0.7,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_SNARE,
|
|
MIDI_D5,
|
|
"Shaker",
|
|
Shaker,
|
|
"R",
|
|
897,
|
|
0.0,
|
|
-0.2,
|
|
0.5,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_SNARE,
|
|
MIDI_E5,
|
|
"LNsnare1",
|
|
AudioSampleLnsnare1,
|
|
"S",
|
|
5313,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_HANDCLAP,
|
|
MIDI_DIS5,
|
|
"LNclap1",
|
|
AudioSampleLnclap,
|
|
"C",
|
|
3521,
|
|
0.0,
|
|
0.1,
|
|
0.9,
|
|
0.0,
|
|
0.1
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_F5,
|
|
"Bdtrancy",
|
|
AudioSampleBdtrancy,
|
|
"B",
|
|
3969,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_HIHAT,
|
|
MIDI_FIS5,
|
|
"hhcl1",
|
|
AudioSampleHhcl1wav,
|
|
"H",
|
|
3137,
|
|
0.0,
|
|
1.0,
|
|
0.6,
|
|
0.0,
|
|
0.0
|
|
},
|
|
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_G5,
|
|
"Belltree",
|
|
AudioSampleBelltree,
|
|
"B",
|
|
60737,
|
|
0.0,
|
|
0.0,
|
|
0.7,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_GIS5,
|
|
"Bongo16",
|
|
AudioSampleBongo16,
|
|
"B",
|
|
1633,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_A5,
|
|
"Bongo27",
|
|
AudioSampleBongo27,
|
|
"B",
|
|
5889,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_AIS5,
|
|
"Casta",
|
|
AudioSampleCasta,
|
|
"B",
|
|
513,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_B5,
|
|
"Cr78kick",
|
|
AudioSampleCr78kick,
|
|
"B",
|
|
5057,
|
|
0.0,
|
|
0.0,
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
},
|
|
|
|
{
|
|
DRUM_HIHAT,
|
|
MIDI_C6,
|
|
"Cr78tmb1",
|
|
AudioSampleCr78tmb1,
|
|
"B",
|
|
3777,
|
|
0.0,
|
|
0.0,
|
|
0.8,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_HIHAT,
|
|
MIDI_CIS6,
|
|
"Cr78tmb2",
|
|
AudioSampleCr78tmb2,
|
|
"B",
|
|
5441,
|
|
0.0,
|
|
0.0,
|
|
0.8,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_D6,
|
|
"Crash1",
|
|
AudioSampleCrash1,
|
|
"B",
|
|
36417,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_DIS6,
|
|
"Dmpop",
|
|
AudioSampleDmpop,
|
|
"B",
|
|
1953,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_E6,
|
|
"Electr1",
|
|
AudioSampleElectr1,
|
|
"B",
|
|
737,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_BASS,
|
|
MIDI_F6,
|
|
"Excow",
|
|
AudioSampleExcow,
|
|
"B",
|
|
5057,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_FIS6,
|
|
"Tamb",
|
|
AudioSampleTamb,
|
|
"T",
|
|
4097,
|
|
0.0,
|
|
-0.2,
|
|
0.6,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_GIS6,
|
|
"Cowbell",
|
|
AudioSampleCowbell,
|
|
"S",
|
|
1825,
|
|
0.0,
|
|
0.2,
|
|
0.6,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_HIHAT,
|
|
MIDI_G6,
|
|
"660HatC1",
|
|
AudioSampleHatc1,
|
|
"T",
|
|
3009,
|
|
0.0,
|
|
0.0,
|
|
0.6,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_HIHAT,
|
|
MIDI_A6,
|
|
"Hhopen1",
|
|
AudioSampleHhopen1,
|
|
"S",
|
|
5633,
|
|
0.0,
|
|
0.0,
|
|
0.6,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_AIS6,
|
|
"Histicks",
|
|
AudioSampleHisticks,
|
|
"S",
|
|
609,
|
|
0.0,
|
|
0.0,
|
|
0.6,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_B6,
|
|
"Hr16snr2",
|
|
AudioSampleHr16snr2,
|
|
"S",
|
|
7617,
|
|
0.0,
|
|
0.0,
|
|
0.6,
|
|
0.0,
|
|
0.0
|
|
},
|
|
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_CIS7,
|
|
"Tick1",
|
|
AudioSampleTick1,
|
|
"S",
|
|
321,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_D7,
|
|
"M118w",
|
|
AudioSampleM118w,
|
|
"S",
|
|
1153,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_DIS7,
|
|
"Md16_clp",
|
|
AudioSampleMd16_clp,
|
|
"S",
|
|
6657,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_HIHAT,
|
|
MIDI_E7,
|
|
"Ohhwav",
|
|
AudioSampleOhhwav,
|
|
"S",
|
|
11777,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_F7,
|
|
"Quijada",
|
|
AudioSampleQuijada,
|
|
"S",
|
|
18049,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_FIS7,
|
|
"tabla1",
|
|
AudioSampleR8tabla1,
|
|
"S",
|
|
7745,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_GIS7,
|
|
"Ridewav",
|
|
AudioSampleRidewav,
|
|
"S",
|
|
10881,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_A7,
|
|
"Scratch1",
|
|
AudioSampleScratch1,
|
|
"S",
|
|
1473,
|
|
0.0,
|
|
0.0,
|
|
0.7,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_B7,
|
|
"Tomlow",
|
|
AudioSampleTomlow,
|
|
"S",
|
|
7681,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_PERCUSSION,
|
|
MIDI_C8,
|
|
"Tomwav",
|
|
AudioSampleTomwav,
|
|
"S",
|
|
3137,
|
|
0.0,
|
|
0.0,
|
|
0.9,
|
|
0.0,
|
|
0.0
|
|
},
|
|
{
|
|
DRUM_NONE,
|
|
0,
|
|
"EMPTY",
|
|
NULL,
|
|
"-",
|
|
0,
|
|
0.0,
|
|
0.0,
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
}
|
|
};
|
|
|
|
#endif
|
|
|