Now drum-volume can be controlled by velocity.

Small fixes for sequencer.
pull/52/head
Holger Wirtz 3 years ago
parent e4ff2aa59b
commit d309fbf2cf
  1. 6
      MicroDexed.ino
  2. 11
      UI.hpp
  3. 2
      config.h
  4. 48
      drums.h

@ -316,6 +316,10 @@ extern uint8_t drum_type[NUM_DRUMS];
extern drum_config_t drum_config[NUM_DRUMCONFIG];
#endif
uint8_t seqdata[3][16];
uint8_t seqsteptimer;
bool seq_running;
#ifdef ENABLE_LCD_UI
extern LCDMenuLib2 LCDML;
#endif
@ -742,7 +746,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
if (inNumber == drum_config[d].midinote)
{
uint8_t slot = drum_get_slot(drum_config[d].type);
drum_volume[slot]->gain(drum_config[d].vol);
drum_volume[slot]->gain(pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max)));
drum_mono2stereo[slot]->panorama(drum_config[d].pan);
Drum[slot]->play(drum_config[d].filename);
break;

@ -3536,15 +3536,16 @@ void UI_handle_OP(uint8_t param)
void UI_func_sequencer(uint8_t param)
{
bool foundsound = false;
String displayname = String(8);
char displayname[9];
if (LCDML.FUNC_setup()) // ****** SETUP *********
{
encoderDir[ENC_R].reset();
seq_button_r = false;
// setup function
lcd.setCursor(1, 0);
displayname = drum_config[activesample].filename;
lcd.print(displayname.substring(5, 11) );
strcpy(displayname, drum_config[activesample].filename);
lcd.print(*displayname + 5);
lcd.setCursor(8, 0);
lcd.print("[");
lcd.setCursor(9, 0);
@ -3647,8 +3648,8 @@ void UI_func_sequencer(uint8_t param)
lcd.setCursor(0, 0);
lcd.print("[");
lcd.setCursor(1, 0);
displayname = drum_config[activesample].filename;
lcd.print(displayname.substring(5, 11) );
strcpy(displayname, drum_config[activesample].filename);
lcd.print(*displayname + 5);
lcd.setCursor(7, 0);
lcd.print("]");
}

@ -99,7 +99,7 @@
//* DEXED AND EFFECTS SETTINGS
//*************************************************************************************************
// Number of Dexed instances
#if defined(TEENSY3_6) && NUM_DEXED > 1
#if defined(TEENSY3_6)
#warning >>> Sorry, only one instance possible for Teensy-3.6
#define NUM_DEXED 1 // 1 or 2 - nothing else!
#else

@ -34,7 +34,8 @@ typedef struct drum_config_s {
char filename[18]; // 44.1kHz mono LSB raw-sample to play
char shortname[2]; // 1 char name for sequencer
float32_t pan; // Panorama (-1.0 - +1.0)
float32_t vol; // Volume (0.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)
} drum_config_t;
#define NUM_DRUMCONFIG 15
@ -45,7 +46,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/bd01.raw",
"B",
0.0,
0.8
0.8,
0.0
},
{
DRUM_HANDCLAP,
@ -53,7 +55,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/cp02.raw",
"C",
-0.4,
0.6
0.6,
0.0
},
{
DRUM_SNARE,
@ -61,7 +64,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/sd15.raw",
"S",
0.2,
0.8
0.6,
0.2
},
{
DRUM_HIHAT,
@ -69,7 +73,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/hh01.raw",
"h",
0.8,
0.2
0.2,
0.0
},
{
DRUM_HIHAT,
@ -77,7 +82,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/hh02.raw",
"h",
0.8,
0.2
0.2,
0.0
},
{
DRUM_HIHAT,
@ -85,7 +91,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/oh02.raw",
"H",
0.8,
0.2
0.2,
0.0
},
{
DRUM_LOWTOM,
@ -93,7 +100,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/lt01.raw",
"T",
-0.7,
0.8
0.8,
0.0
},
{
DRUM_HIGHTOM,
@ -101,21 +109,26 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/ht01.raw",
"T",
-0.5,
0.8
0.8,
0.0
},
{
DRUM_RIDE,
MIDI_CIS4,
"/drm/rd01.raw",
"R",
-0.6,
0.3
0.3,
0.0
},
{
DRUM_RIDE,
MIDI_DIS4,
"/drm/rd02.raw",
"R",
-0.6,
0.3
0.3,
0.0
},
{
DRUM_BASS,
@ -123,7 +136,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/PHKick1.raw",
"B",
0.0,
0.9
0.9,
0.0
},
{
DRUM_HANDCLAP,
@ -131,7 +145,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/808Clap1.raw",
"C",
0.0,
0.9
0.9,
0.0
},
{
DRUM_SNARE,
@ -139,7 +154,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/808RimS1.raw",
"R",
-0.3,
0.5
0.5,
0.0
},
{
DRUM_HIHAT,
@ -147,7 +163,8 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/808HHCL1.raw",
"H",
0.4,
0.6
0.6,
0.0
},
{
DRUM_SNARE,
@ -155,6 +172,7 @@ drum_config_t drum_config[NUM_DRUMCONFIG] = {
"/drm/EMPTY ",
"-",
0.0,
0.0,
0.0
}
};

Loading…
Cancel
Save