Merge pull request 'missing sequencer.h, some more samples' (#70) from positionhigh/MicroDexed:dev into dev

Reviewed-on: https://codeberg.org/dcoredump/MicroDexed/pulls/70
pull/76/head
Holger Wirtz 3 years ago
commit a0d5dcc428
  1. 1
      UI.hpp
  2. 62
      drums.h
  3. 2495
      drumset.h
  4. 67
      sequencer.cpp
  5. 45
      sequencer.h

@ -5134,6 +5134,7 @@ void UI_func_seq_pattern_save(uint8_t param)
{
char tmp[FILENAME_LEN];
yesno = false;
temp_int=0;
mode = 0;
encoderDir[ENC_R].reset();
lcd.setCursor(0, 0);

@ -46,7 +46,7 @@ typedef struct drum_config_s {
enum {DRUM_NONE, DRUM_BASS, DRUM_SNARE, DRUM_HIHAT, DRUM_HANDCLAP, DRUM_RIDE, DRUM_CHRASH, DRUM_LOWTOM, DRUM_MIDTOM, DRUM_HIGHTOM, DRUM_PERCUSSION};
#define NUM_DRUMSET_CONFIG 16
#define NUM_DRUMSET_CONFIG 20
drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
{
{
@ -69,7 +69,7 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
-1.0,
0.6,
0.0,
0.4
0.1
},
{
DRUM_HANDCLAP,
@ -80,7 +80,7 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
1.0,
0.6,
0.0,
0.4
0.2
},
{
DRUM_SNARE,
@ -169,6 +169,17 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
0.3,
0.0,
0.0
},
{
DRUM_BASS,
MIDI_B4,
"808Kick",
AudioSample808Kick,
"B",
0.0,
0.8,
0.0,
0.0
},
{
DRUM_BASS,
@ -181,24 +192,35 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
0.0,
0.0
},
{
DRUM_SNARE,
MIDI_E5,
"LNsnare1",
AudioSampleLnsnare1,
"S",
0.0,
0.5,
0.0,
0.0
},
{
DRUM_HANDCLAP,
MIDI_DIS5,
"clap1",
AudioSampleClap1wav,
"LNclap1",
AudioSampleLnclap,
"C",
1.0,
0.9,
0.1,
0.5,
0.0,
0.1
},
{
{
DRUM_SNARE,
MIDI_CIS5,
"rims1",
AudioSampleRims1wav,
"R",
-0.3,
-0.2,
0.5,
0.0,
0.0
@ -213,6 +235,28 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
0.6,
0.0,
0.0
},
{
DRUM_PERCUSSION,
MIDI_FIS6,
"Tamb",
AudioSampleTamb,
"T",
-0.2,
0.6,
0.0,
0.0
},
{
DRUM_PERCUSSION,
MIDI_GIS6,
"Cowbell",
AudioSampleCowbell,
"S",
0.2,
0.6,
0.0,
0.0
},
{
DRUM_NONE,

File diff suppressed because it is too large Load Diff

@ -63,26 +63,61 @@ void sequencer(void)
else {
if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0 && seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0) // instrument track
{
handleNoteOn(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]);
if (seq_track_type[d] == 1 || seq_track_type[d] == 3 )
{
handleNoteOn(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]);
}
seq_prev_note[d] = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose;
seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step];
if (seq_track_type[d] == 2) {
if (seq_track_type[d] == 2) { //Chords
if (seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 199)
{
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][0], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][1], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][2], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][3], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][0], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][1], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][2], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][3], seq_chord_velocity);
}
}
else if (seq_track_type[d] == 3) { //Arp
arp_step = 0;
arp_note = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose;
arp_chord = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step];
}
}
}
if (seq_track_type[d] == 3)
{ //Arp
if (arp_step == 0 ) {
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note+ arp_octave * 12 , seq_chord_velocity);
arp_note_prev = arp_note+arp_octave * 12;
}
else
{
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord - 200][arp_step - 1] + arp_octave * 12, seq_chord_velocity);
arp_note_prev = arp_note + seq_chords[arp_chord - 200][arp_step - 1] + arp_octave * 12;
}
}
seq_noteoffsent[d] = false;
}
seq_step++;
arp_step++;
if (arp_step > 3) {
arp_step = 0;
arp_octave++;
if (arp_octave > 1) arp_octave = 0;
}
if (seq_step > 15) {
seq_step = 0;
if (seq_chain_lenght > 0) {
seq_chain_active_step++;
@ -100,17 +135,27 @@ void sequencer(void)
if ( seq_noteoffsent[d] == false) {
if ( seq_prev_note[d] > 0 && seq_track_type[d] > 0) //test instrument sequencer Instance=0
{
handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[d] , 0);
if (seq_track_type[d] == 2) {
if (seq_track_type[d] == 2) { //Chords
if ( seq_prev_vel[d] > 199) {
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][0], 0);
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][1] , 0);
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][2] , 0);
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][3] , 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][0], 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][1] , 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][2] , 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][3] , 0);
}
}
else if (seq_track_type[d] == 3)
{ //Arp
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note_prev, 0);
}
}
}
seq_noteoffsent[d] = true;

@ -11,6 +11,16 @@ bool seq_recording = false;
uint8_t seq_note_in;
uint8_t seq_note_in_velocity;
int seq_transpose;
uint8_t seq_inst_dexed[4] = { 1, 1, 1, 1 };
uint8_t seq_chord_dexed_inst = 0;
uint8_t seq_chord_velocity = 50;
uint8_t seq_chords[6][4] = { 4, 7, 12, 0, //major
3, 7, 12, 0, //minor
4, 7, 10, 12, //seventh
4, 8, 12, 0, //augmented
3, 6, 12, 0, //dim
4, 7, 11 , 0 //maj7,
};
int seq_tempo_ms = 147;
int seq_bpm = 102;
uint8_t seq_temp_select_menu;
@ -19,34 +29,41 @@ uint8_t seq_chain_active_chainstep;
uint8_t seq_chain_lenght = 3; // 0=16 steps, 1=32 Steps, 2=46 Steps, 3=64 Steps
uint8_t seq_chain_active_step = 0;
uint8_t seq_prev_note[4]; // note_offs for every (instr.) track
uint8_t seq_prev_vel[4];
uint8_t arp_step;
uint8_t arp_note;
uint8_t arp_chord;
uint8_t arp_note_prev;
uint8_t arp_octave;
uint8_t arp_prev_oct;
uint8_t seq_data[10][16] = {72 , 0 , 0 , 0 , 72 , 0 , 0 , 0 , 72 , 0 , 0 , 0 , 72 , 0 , 0 , 0 ,
78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 , 78 ,
72 , 0 , 0 , 0 , 72 , 0 , 0 , 0 , 72 , 0 , 0 , 75 , 72 , 0 , 0 , 0 ,
60 , 61 , 62 , 63 ,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0 , 0 , 0 , 0 , 0 ,
98 , 120 , 0 , 88 , 120 , 0 , 127 , 120 , 0 , 0 , 125 , 120 , 0 , 0 ,
0 , 0 , 124 , 120 , 0 , 115 , 0 , 0 , 126 , 120 , 0 , 120 , 127 , 120 , 0 , 0 ,
0 , 0 , 123 , 120 , 0 , 110 , 120 , 0 , 90 , 120 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
uint8_t seq_vel[10][16] = {120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0,
105, 80, 105, 70, 106, 98, 106, 70, 126, 97, 106, 70, 106, 99, 90, 65,
120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 120, 50, 120, 120, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200,
200, 200, 200, 200, 200, 200, 201, 0, 0, 0, 0, 0, 0, 0, 0, 200,
201, 200, 200, 200, 200, 200, 200, 200, 0, 0, 0, 0, 0, 0, 0, 0,
98, 120, 0, 88, 120, 0, 127, 120, 0, 0, 125, 120, 0, 0, 0, 0,
124, 120, 0, 115, 0, 0, 126, 120, 0, 120, 127, 120, 0, 0, 0, 0,
123, 120, 0, 110, 120, 0, 90, 120, 0, 0, 0, 0, 0, 0, 0, 0
};
uint8_t seq_patternchain[4][4] = { 0 , 1 , 6 , 9 , 0 , 1 , 5 , 8 , 0 , 1 , 6 , 9 , 2 , 1 , 5 , 7
};
uint8_t seq_content_type[10] = { 0, 0, 0, 0 , 1, 1, 1 , 1 , 1 , 1 }; // 0 = track is Drumtrack, 1= Instrumenttrack
uint8_t seq_track_type[4] = { 0, 0, 1, 1 }; // 0 = track is Drumtrack, 1= Instrumenttrack
uint8_t seq_content_type[10] = { 0, 0, 0, 0 , 1, 2, 2 , 1 , 1 , 1 }; // 0 = track is Drumtrack, 1= Instrumenttrack, 2= Chord, 3= Arpeggio
uint8_t seq_track_type[4] = { 0, 0, 3, 1 }; // 0 = track is Drumtrack, 1= Instrumenttrack, 2= Chord, 3=Arp, 4=Chord+Arp
//uint8_t seq_reverb[4][16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0,

Loading…
Cancel
Save