Dateien hochladen nach „“

pull/50/head
positionhigh 4 years ago
parent af8426da31
commit f20c2a457d
  1. 2
      MicroDexed.ino
  2. 80
      UI.hpp
  3. 58
      drums.h

@ -774,7 +774,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
if (inNumber == drum_config[d].midinote) if (inNumber == drum_config[d].midinote)
{ {
uint8_t slot = drum_get_slot(drum_config[d].type); 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_mono2stereo[slot]->panorama(drum_config[d].pan);
Drum[slot]->play(drum_config[d].filename); Drum[slot]->play(drum_config[d].filename);
break; break;

@ -3533,18 +3533,39 @@ void UI_handle_OP(uint8_t param)
} }
} }
char const * seq_find_shortname(uint8_t seqstep)
{
char const * shortname = " ";
bool foundsound = false;
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++)
{
if (seqdata[active_seq_track][seqstep] == drum_config[d].midinote)
{
shortname = drum_config[d].shortname;
foundsound = true;
break;
}
}
if (foundsound == false) shortname="-";
return shortname;
}
void UI_func_sequencer(uint8_t param) void UI_func_sequencer(uint8_t param)
{ {
bool foundsound = false; bool foundsound = false;
String displayname = String(8); char displayname[9];
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
seq_button_r = false; seq_button_r = false;
// setup function // setup function
lcd.setCursor(1, 0); lcd.setCursor(1, 0);
displayname = drum_config[activesample].filename; strncpy(displayname, drum_config[activesample].filename + 5, 6);
lcd.print(displayname.substring(5, 11) ); lcd.print(displayname);
lcd.setCursor(8, 0); lcd.setCursor(8, 0);
lcd.print("["); lcd.print("[");
lcd.setCursor(9, 0); lcd.setCursor(9, 0);
@ -3647,8 +3668,8 @@ void UI_func_sequencer(uint8_t param)
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print("["); lcd.print("[");
lcd.setCursor(1, 0); lcd.setCursor(1, 0);
displayname = drum_config[activesample].filename; strncpy(displayname, drum_config[activesample].filename + 5, 6);
lcd.print(displayname.substring(5, 11) ); lcd.print(displayname);
lcd.setCursor(7, 0); lcd.setCursor(7, 0);
lcd.print("]"); lcd.print("]");
} }
@ -3688,17 +3709,7 @@ void UI_func_sequencer(uint8_t param)
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
lcd.setCursor(i, 1); lcd.setCursor(i, 1);
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) lcd.print(seq_find_shortname(i) );
{
if (seqdata[active_seq_track][i] == drum_config[d].midinote)
{
lcd.print(drum_config[d].shortname ); //one letter name of Category
foundsound = true;
break;
}
}
if (foundsound == false)lcd.print("-");
foundsound = false;
} }
} }
if (seq_menu == 3) { if (seq_menu == 3) {
@ -3709,45 +3720,16 @@ void UI_func_sequencer(uint8_t param)
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print("x"); lcd.print("x");
lcd.setCursor(1, 1); lcd.setCursor(1, 1);
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) lcd.print(seq_find_shortname(1) );
{
if (seqdata[active_seq_track][1] == drum_config[d].midinote)
{
lcd.print(drum_config[d].shortname ); //one letter name of Category
foundsound = true;
break;
}
}
if (foundsound == false) lcd.print("-");
foundsound = false;
} }
if (seq_menu > 3) { if (seq_menu > 3) {
lcd.setCursor(seq_menu - 3, 1); lcd.setCursor(seq_menu - 3, 1);
lcd.print("x"); lcd.print("x");
lcd.setCursor(seq_menu - 4, 1); lcd.setCursor(seq_menu - 4, 1);
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) lcd.print(seq_find_shortname(seq_menu - 4) );
{
if (seqdata[active_seq_track][seq_menu - 4] == drum_config[d].midinote)
{
lcd.print(drum_config[d].shortname ); //one letter name of Category
foundsound = true;
break;
}
}
if (foundsound == false) lcd.print("-");
foundsound = false;
lcd.setCursor(seq_menu - 2, 1); lcd.setCursor(seq_menu - 2, 1);
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) lcd.print(seq_find_shortname(seq_menu - 2) );
{
if (seqdata[active_seq_track][seq_menu - 2] == drum_config[d].midinote)
{
lcd.print(drum_config[d].shortname ); //one letter name of Category
foundsound = true;
break;
}
}
if (foundsound == false) lcd.print("-");
foundsound = false;
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********

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

Loading…
Cancel
Save