parent
7f136b1e72
commit
b59931b868
@ -0,0 +1,297 @@ |
||||
/*
|
||||
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 "sampleset.h" |
||||
|
||||
#ifndef _SAMPLER_H |
||||
#define _SAMPLER_H |
||||
|
||||
typedef struct sampler_config_s { |
||||
uint8_t sampler_class; // Type of sample
|
||||
uint8_t midinote; // Triggered by note
|
||||
char name[SAMPLER_NAME_LEN]; |
||||
const unsigned int* sample_data; |
||||
char shortname[2]; // 1 char name for sequencer
|
||||
float32_t pitch; // play 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)
|
||||
} sampler_config_t; |
||||
|
||||
enum {SAMPLER_NONE, SAMPLER_BASS, SAMPLER_SNARE, SAMPLER_HIHAT, SAMPLER_HANDCLAP, SAMPLER_RIDE, SAMPLER_CHRASH, SAMPLER_LOWTOM, SAMPLER_MIDTOM, SAMPLER_HIGHTOM, SAMPLER_PERCUSSION, SAMPLER_MONOPHONE, SAMPLER_POLYPHONE}; |
||||
|
||||
// DEFAULT MIDI CHANNEL FOR SAMPLER
|
||||
uint8_t sampler_midi_channel = 10; |
||||
|
||||
sampler_config_t sampler_config[NUM_SAMPLESET_CONFIG] = |
||||
{ |
||||
{ |
||||
SAMPLER_BASS, |
||||
MIDI_C3, |
||||
"bd01", |
||||
AudioSampleBd01, |
||||
"B", |
||||
0.0, |
||||
0.0, |
||||
0.8, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_HANDCLAP, |
||||
MIDI_CIS3, |
||||
"cp02l", |
||||
AudioSampleCp02, |
||||
"C", |
||||
0.0, |
||||
-1.0, |
||||
0.6, |
||||
0.0, |
||||
0.1 |
||||
}, |
||||
{ |
||||
SAMPLER_HANDCLAP, |
||||
MIDI_DIS3, |
||||
"cp02r", |
||||
AudioSampleCp02, |
||||
"C", |
||||
0.0, |
||||
1.0, |
||||
0.6, |
||||
0.0, |
||||
0.2 |
||||
}, |
||||
{ |
||||
SAMPLER_SNARE, |
||||
MIDI_D3, |
||||
"sd15", |
||||
AudioSampleSd15, |
||||
"S", |
||||
0.0, |
||||
0.2, |
||||
0.6, |
||||
0.2, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_HIHAT, |
||||
MIDI_FIS3, |
||||
"hh01", |
||||
AudioSampleHh01, |
||||
"h", |
||||
0.0, |
||||
0.8, |
||||
0.8, |
||||
0.3, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_HIHAT, |
||||
MIDI_GIS3, |
||||
"hh02", |
||||
AudioSampleHh02, |
||||
"h", |
||||
0.0, |
||||
0.8, |
||||
0.8, |
||||
0.3, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_HIHAT, |
||||
MIDI_AIS3, |
||||
"oh02", |
||||
AudioSampleOh02, |
||||
"H", |
||||
0.0, |
||||
0.8, |
||||
0.8, |
||||
0.3, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_LOWTOM, |
||||
MIDI_G3, |
||||
"lt01", |
||||
AudioSampleLt01, |
||||
"T", |
||||
0.0, |
||||
-0.7, |
||||
0.8, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_HIGHTOM, |
||||
MIDI_A3, |
||||
"ht01", |
||||
AudioSampleHt01, |
||||
"T", |
||||
0.0, |
||||
-0.5, |
||||
0.8, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_RIDE, |
||||
MIDI_CIS4, |
||||
"rd01", |
||||
AudioSampleRd01, |
||||
"R", |
||||
0.0, |
||||
-0.6, |
||||
0.3, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_RIDE, |
||||
MIDI_DIS4, |
||||
"rd02", |
||||
AudioSampleRd02, |
||||
"R", |
||||
0.0, |
||||
-0.6, |
||||
0.3, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_BASS, |
||||
MIDI_B4, |
||||
"808Kick", |
||||
AudioSample808Kick, |
||||
"B", |
||||
0.0, |
||||
0.0, |
||||
0.8, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_BASS, |
||||
MIDI_C5, |
||||
"phkick1", |
||||
AudioSamplePhkick1, |
||||
"B", |
||||
0.0, |
||||
0.0, |
||||
0.9, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_SNARE, |
||||
MIDI_E5, |
||||
"LNsnare1", |
||||
AudioSampleLnsnare1, |
||||
"S", |
||||
0.0, |
||||
0.0, |
||||
0.5, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_HANDCLAP, |
||||
MIDI_DIS5, |
||||
"LNclap1", |
||||
AudioSampleLnclap, |
||||
"C", |
||||
0.0, |
||||
0.1, |
||||
0.5, |
||||
0.0, |
||||
0.1 |
||||
}, |
||||
{ |
||||
SAMPLER_SNARE, |
||||
MIDI_CIS5, |
||||
"rims1", |
||||
AudioSampleRims1wav, |
||||
"R", |
||||
0.0, |
||||
-0.2, |
||||
0.5, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_HIHAT, |
||||
MIDI_FIS5, |
||||
"hhcl1", |
||||
AudioSampleHhcl1wav, |
||||
"H", |
||||
0.0, |
||||
1.0, |
||||
0.6, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_PERCUSSION, |
||||
MIDI_FIS6, |
||||
"Tamb", |
||||
AudioSampleTamb, |
||||
"T", |
||||
0.0, |
||||
-0.2, |
||||
0.6, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_PERCUSSION, |
||||
MIDI_GIS6, |
||||
"Cowbell", |
||||
AudioSampleCowbell, |
||||
"S", |
||||
0.0, |
||||
0.2, |
||||
0.6, |
||||
0.0, |
||||
0.0 |
||||
}, |
||||
{ |
||||
SAMPLER_NONE, |
||||
0, |
||||
"EMPTY", |
||||
NULL, |
||||
"-", |
||||
0.0, |
||||
0.0, |
||||
0.0, |
||||
0.0, |
||||
0.0 |
||||
} |
||||
}; |
||||
|
||||
#endif |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@ |
||||
Subproject commit 4bdf02125cfbe27a3489d0157317270073d152f0 |
Loading…
Reference in new issue