diff --git a/MicroDexed.ino b/MicroDexed.ino index 30966a5..bc0d09d 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -406,11 +406,9 @@ int16_t* ep_delayline_l; #endif #if NUM_DRUMS > 0 -extern sequencer_t seq; extern drum_config_t drum_config[NUM_DRUMSET_CONFIG]; uint8_t drum_counter; uint8_t drum_type[NUM_DRUMS]; -extern void sequencer(void); uint8_t drum_midi_channel = DRUM_MIDI_CHANNEL; custom_midi_map_t custom_midi_map[NUM_CUSTOM_MIDI_MAPPINGS]; #endif @@ -421,9 +419,6 @@ extern LCDMenuLib2 LCDML; extern void getNoteName(char* noteName, uint8_t noteNumber); -#ifdef USE_SEQUENCER -PeriodicTimer sequencer_timer; -#endif /*********************************************************************** SETUP @@ -679,11 +674,6 @@ void setup() } } -#ifdef USE_SEQUENCER - // Start timer (to avoid a crash when loading the performance data) - sequencer_timer.begin(sequencer, seq.tempo_ms / 2, false); -#endif - // Load initial Performance or the last used one initial_values(false); @@ -735,7 +725,7 @@ void setup() #if NUM_DRUMS > 0 master_mixer_r.gain(MASTER_MIX_CH_DRUMS, VOL_MAX_FLOAT); master_mixer_l.gain(MASTER_MIX_CH_DRUMS, VOL_MAX_FLOAT); - seq.drums_volume = VOL_MAX_FLOAT; + configuration.drums.vol = VOL_MAX_FLOAT; #else master_mixer_r.gain(MASTER_MIX_CH_DRUMS, 0.0); master_mixer_l.gain(MASTER_MIX_CH_DRUMS, 0.0); @@ -767,7 +757,7 @@ void setup() //ep_modchorus.set_bypass(true); - strcpy(seq.name, "INIT Perf"); + strcpy(configuration.performance.name, "INIT Perf"); LCDML.OTHER_jumpToFunc(UI_func_voice_select); } @@ -784,38 +774,6 @@ void loop() LCDML.loop(); #endif - if (seq.running) - { - if (seq.step != seq_UI_last_step) - { - seq_UI_last_step = seq.step; - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor)) //is in UI of Sequencer - { - display.setCursor(seq.step, 1); - display.write(124); - if (seq.step == 0) - { - display.setCursor(15, 1); - display.print(seq_find_shortname(15)[0]); - } - else - { - display.setCursor(seq.step - 1, 1); - display.print(seq_find_shortname(seq.step - 1)[0]); - } - - } - else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_arpeggio)) //is in UI of Arpeggiator - { - display.setCursor(7, 0); - display.print( seq.chord_names[seq.arp_chord][0]); - display.print( seq.chord_names[seq.arp_chord][1]); - display.print( seq.chord_names[seq.arp_chord][2]); - display.print( seq.chord_names[seq.arp_chord][3]); - } - } - } - // CONTROL-RATE-EVENT-HANDLING if (control_rate > CONTROL_RATE_MS) { @@ -976,54 +934,6 @@ void learn_key(byte inChannel, byte inNumber) ; // can not be mapped, no empty slot left } } - seq.midi_learn_active = false; - //update_midi_learn_button(); - print_custom_mappings(); -} - -void learn_cc(byte inChannel, byte inNumber) -{ - uint8_t found = 199; - for (uint8_t c = 0; c < NUM_CUSTOM_MIDI_MAPPINGS; c++) - { - if (inNumber == custom_midi_map[c].in && custom_midi_map[c].type == 2) - { - found = c; - break; - } - } - if (found != 199) //remap to new destination if it was already mapped before - { - custom_midi_map[found].in = inNumber; - custom_midi_map[found].out = cc_dest_values[seq.temp_select_menu]; - custom_midi_map[found].type = 2; - custom_midi_map[found].channel = configuration.dexed[selected_instance_id].midi_channel; - } - else - { - found = 199; - for (uint8_t c = 0; c < NUM_CUSTOM_MIDI_MAPPINGS; c++) - { - if (custom_midi_map[c].in == 0) - { - found = c; - break; - } - } - if (found != 199) // else map to next empty slot if it was not mapped before - { - custom_midi_map[found].in = inNumber; - custom_midi_map[found].out = cc_dest_values[seq.temp_select_menu]; - custom_midi_map[found].type = 2; - custom_midi_map[found].channel = configuration.dexed[selected_instance_id].midi_channel; - } - else - ; // can not be mapped, no empty slot left - } - - seq.midi_learn_active = false; - //update_midi_learn_button(); - print_custom_mappings(); } /****************************************************************************** @@ -1031,172 +941,133 @@ void learn_cc(byte inChannel, byte inNumber) ******************************************************************************/ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { - if (seq.midi_learn_active && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_custom_mappings) ) - learn_key(inChannel, inNumber); - else + // Check for MicroDexed + for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { - // - // Drum Sampler - // -#if NUM_DRUMS > 0 - if (activesample < 6 && seq.running == false && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor) ) // live play pitched sample - { - if (drum_counter >= NUM_DRUMS) - drum_counter = 0; - uint8_t slot = drum_get_slot(drum_config[activesample].drum_class); - float pan = mapfloat(drum_config[activesample].pan, -1.0, 1.0, 0.0, 1.0); - drum_mixer_r.gain(slot, (1.0 - pan) * drum_config[activesample].vol_max); - drum_mixer_l.gain(slot, pan * drum_config[activesample].vol_max); -#ifdef USE_FX - drum_reverb_send_mixer_r.gain(slot, (1.0 - pan) * volume_transform(drum_config[activesample].reverb_send)); - drum_reverb_send_mixer_l.gain(slot, pan * volume_transform(drum_config[activesample].reverb_send)); -#endif - if (drum_config[activesample].drum_data != NULL && drum_config[activesample].len > 0) - { - Drum[slot]->enableInterpolation(true); - Drum[slot]->setPlaybackRate( (float)pow (2, (inNumber - 72) / 12.00) * drum_config[activesample].p_offset ); - Drum[slot]->playRaw((int16_t*)drum_config[activesample].drum_data, drum_config[activesample].len, 1); - } - } - else + if (checkMidiChannel(inChannel, instance_id)) { -#endif - //Ignore the note when playing & recording the same note into the sequencer - if (seq.recording == false || (seq.recording && inNumber != seq.note_in )) + if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note) { - // Check for MicroDexed - for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - { - if (checkMidiChannel(inChannel, instance_id)) - { - if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note) - { - if (configuration.dexed[instance_id].polyphony > 0) - MicroDexed[instance_id]->keydown(inNumber, uint8_t(float(configuration.dexed[instance_id].velocity_level / 127.0)*inVelocity + 0.5)); + if (configuration.dexed[instance_id].polyphony > 0) + MicroDexed[instance_id]->keydown(inNumber, uint8_t(float(configuration.dexed[instance_id].velocity_level / 127.0)*inVelocity + 0.5)); - midi_voices[instance_id]++; + midi_voices[instance_id]++; #if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) - { - midi_decay_timer = 0; - midi_decay[instance_id] = min(inVelocity / 5, 7); - } + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) + { + midi_decay_timer = 0; + midi_decay[instance_id] = min(inVelocity / 5, 7); + } #endif #ifdef DEBUG - char note_name[4]; - getNoteName(note_name, inNumber); - Serial.print(F("KeyDown ")); - Serial.print(note_name); - Serial.print(F(" instance ")); - Serial.print(instance_id, DEC); - Serial.print(F(" MIDI-channel ")); - Serial.print(inChannel, DEC); - Serial.println(); + char note_name[4]; + getNoteName(note_name, inNumber); + Serial.print(F("KeyDown ")); + Serial.print(note_name); + Serial.print(F(" instance ")); + Serial.print(instance_id, DEC); + Serial.print(F(" MIDI-channel ")); + Serial.print(inChannel, DEC); + Serial.println(); #endif - //return; - } - } - } + } + } + } #if NUM_DRUMS > 0 - // Check for Drum - if (inChannel == drum_midi_channel || drum_midi_channel == MIDI_CHANNEL_OMNI) - { - if (drum_counter >= NUM_DRUMS) - drum_counter = 0; + // Check for Drum + if (inChannel == drum_midi_channel || drum_midi_channel == MIDI_CHANNEL_OMNI) + { + if (drum_counter >= NUM_DRUMS) + drum_counter = 0; - //check custom midi mapping - for (uint8_t c = 0; c < NUM_CUSTOM_MIDI_MAPPINGS; c++) - { - if (inNumber == custom_midi_map[c].in && custom_midi_map[c].type == 1) - { - inNumber = custom_midi_map[c].out; - break; - } - } + //check custom midi mapping + for (uint8_t c = 0; c < NUM_CUSTOM_MIDI_MAPPINGS; c++) + { + if (inNumber == custom_midi_map[c].in && custom_midi_map[c].type == 1) + { + inNumber = custom_midi_map[c].out; + break; + } + } #ifdef DEBUG - char note_name[4]; - getNoteName(note_name, inNumber); - Serial.print(F("=> Drum[")); - Serial.print(drum_counter, DEC); - Serial.print(F("]: ")); - Serial.println(note_name); + char note_name[4]; + getNoteName(note_name, inNumber); + Serial.print(F("=> Drum[")); + Serial.print(drum_counter, DEC); + Serial.print(F("]: ")); + Serial.println(note_name); #endif - for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG; d++) - { - if (inNumber == drum_config[d].midinote) - { - uint8_t slot = drum_get_slot(drum_config[d].drum_class); - float pan = mapfloat(drum_config[d].pan, -1.0, 1.0, 0.0, 1.0); + for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG; d++) + { + if (inNumber == drum_config[d].midinote) + { + uint8_t slot = drum_get_slot(drum_config[d].drum_class); + float pan = mapfloat(drum_config[d].pan, -1.0, 1.0, 0.0, 1.0); - drum_mixer_r.gain(slot, (1.0 - pan) * volume_transform(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max))); - drum_mixer_l.gain(slot, pan * volume_transform(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max))); + drum_mixer_r.gain(slot, (1.0 - pan) * volume_transform(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max))); + drum_mixer_l.gain(slot, pan * volume_transform(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max))); #ifdef USE_FX - drum_reverb_send_mixer_r.gain(slot, (1.0 - pan) * volume_transform(drum_config[d].reverb_send)); - drum_reverb_send_mixer_l.gain(slot, pan * volume_transform(drum_config[d].reverb_send)); + drum_reverb_send_mixer_r.gain(slot, (1.0 - pan) * volume_transform(drum_config[d].reverb_send)); + drum_reverb_send_mixer_l.gain(slot, pan * volume_transform(drum_config[d].reverb_send)); #endif - if (drum_config[d].drum_data != NULL && drum_config[d].len > 0) - { - //Drum[slot]->play(drum_config[d].drum_data); - if (drum_config[d].pitch != 0.0) - { - Drum[slot]->enableInterpolation(true); - Drum[slot]->setPlaybackRate(drum_config[d].pitch); - } - Drum[slot]->playRaw((int16_t*)drum_config[d].drum_data, drum_config[d].len, 1); - } - -#ifdef DEBUG - Serial.print(F("Drum ")); - Serial.print(drum_config[d].shortname); - Serial.print(F(" [")); - Serial.print(drum_config[d].name); - Serial.print(F("], Slot ")); - Serial.print(slot); - Serial.print(F(": V")); - Serial.print(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max), 2); - Serial.print(F(" P")); - Serial.print(drum_config[d].pan, 2); - Serial.print(F(" PAN")); - Serial.print(pan, 2); - Serial.print(F(" RS")); - Serial.println(drum_config[d].reverb_send, 2); -#endif - break; - } + if (drum_config[d].drum_data != NULL && drum_config[d].len > 0) + { + //Drum[slot]->play(drum_config[d].drum_data); + if (drum_config[d].pitch != 0.0) + { + Drum[slot]->enableInterpolation(true); + Drum[slot]->setPlaybackRate(drum_config[d].pitch); } + Drum[slot]->playRaw((int16_t*)drum_config[d].drum_data, drum_config[d].len, 1); } + +#ifdef DEBUG + Serial.print(F("Drum ")); + Serial.print(drum_config[d].shortname); + Serial.print(F(" [")); + Serial.print(drum_config[d].name); + Serial.print(F("], Slot ")); + Serial.print(slot); + Serial.print(F(": V")); + Serial.print(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max), 2); + Serial.print(F(" P")); + Serial.print(drum_config[d].pan, 2); + Serial.print(F(" PAN")); + Serial.print(pan, 2); + Serial.print(F(" RS")); + Serial.println(drum_config[d].reverb_send, 2); #endif -#if NUM_DRUMS > 0 + break; } -#endif } + } +#endif - // - // E-Piano - // + // + // E-Piano + // #if defined(USE_EPIANO) - if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) + if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) + { + if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) { - if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) - { - ep.noteOn(inNumber + configuration.epiano.transpose - 24, inVelocity); + ep.noteOn(inNumber + configuration.epiano.transpose - 24, inVelocity); #ifdef DEBUG - char note_name[4]; - getNoteName(note_name, inNumber); - Serial.print(F("KeyDown ")); - Serial.print(note_name); - Serial.print(F(" EPIANO ")); - Serial.print(F(" MIDI-channel ")); - Serial.print(inChannel, DEC); - Serial.println(); + char note_name[4]; + getNoteName(note_name, inNumber); + Serial.print(F("KeyDown ")); + Serial.print(note_name); + Serial.print(F(" EPIANO ")); + Serial.print(F(" MIDI-channel ")); + Serial.print(inChannel, DEC); + Serial.println(); #endif - } } -#endif } +#endif } #if NUM_DRUMS > 0 @@ -1263,6 +1134,7 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) } } + #if defined(USE_EPIANO) if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) { @@ -1289,254 +1161,218 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) inCtrl = constrain(inCtrl, 0, 127); inValue = constrain(inValue, 0, 127); - if (seq.midi_learn_active && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_cc_mappings) ) - learn_cc(inChannel, inCtrl); - else + for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { - - //check custom midi mapping - for (uint8_t c = 0; c < NUM_CUSTOM_MIDI_MAPPINGS; c++) - { - if (inCtrl == custom_midi_map[c].in && custom_midi_map[c].type == 2) - { - inCtrl = custom_midi_map[c].out; - inChannel = custom_midi_map[c].channel; - break; - } - } - for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) + if (checkMidiChannel(inChannel, instance_id)) { - if (checkMidiChannel(inChannel, instance_id)) - { #ifdef DEBUG - Serial.print(F("INSTANCE ")); - Serial.print(instance_id, DEC); - Serial.print(F(": CC#")); - Serial.print(inCtrl, DEC); - Serial.print(F(":")); - Serial.println(inValue, DEC); + Serial.print(F("INSTANCE ")); + Serial.print(instance_id, DEC); + Serial.print(F(": CC#")); + Serial.print(inCtrl, DEC); + Serial.print(F(":")); + Serial.println(inValue, DEC); #endif - switch (inCtrl) { - case 0: // BankSelect MSB + switch (inCtrl) { + case 0: // BankSelect MSB #ifdef DEBUG - Serial.println(F("BANK-SELECT MSB CC")); + Serial.println(F("BANK-SELECT MSB CC")); #endif - configuration.dexed[instance_id].bank = constrain((inValue << 7)&configuration.dexed[instance_id].bank, 0, MAX_BANKS - 1); - /* load_sd_voice(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } */ - break; - case 1: + configuration.dexed[instance_id].bank = constrain((inValue << 7)&configuration.dexed[instance_id].bank, 0, MAX_BANKS - 1); + /* load_sd_voice(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } */ + break; + case 1: #ifdef DEBUG - Serial.println(F("MODWHEEL CC")); + Serial.println(F("MODWHEEL CC")); #endif - MicroDexed[instance_id]->setModWheel(inValue); - MicroDexed[instance_id]->ControllersRefresh(); - break; - case 2: + MicroDexed[instance_id]->setModWheel(inValue); + MicroDexed[instance_id]->ControllersRefresh(); + break; + case 2: #ifdef DEBUG - Serial.println(F("BREATH CC")); + Serial.println(F("BREATH CC")); #endif - MicroDexed[instance_id]->setBreathController(inValue); - MicroDexed[instance_id]->ControllersRefresh(); - break; - case 4: + MicroDexed[instance_id]->setBreathController(inValue); + MicroDexed[instance_id]->ControllersRefresh(); + break; + case 4: #ifdef DEBUG - Serial.println(F("FOOT CC")); + Serial.println(F("FOOT CC")); #endif - MicroDexed[instance_id]->setFootController(inValue); - MicroDexed[instance_id]->ControllersRefresh(); - break; - case 5: // Portamento time - configuration.dexed[instance_id].portamento_time = inValue; - MicroDexed[instance_id]->setPortamentoTime(configuration.dexed[instance_id].portamento_time); - break; - case 7: // Instance Volume + MicroDexed[instance_id]->setFootController(inValue); + MicroDexed[instance_id]->ControllersRefresh(); + break; + case 5: // Portamento time + configuration.dexed[instance_id].portamento_time = inValue; + MicroDexed[instance_id]->setPortamentoTime(configuration.dexed[instance_id].portamento_time); + break; + case 7: // Instance Volume #ifdef DEBUG - Serial.println(F("VOLUME CC")); + Serial.println(F("VOLUME CC")); #endif - configuration.dexed[instance_id].sound_intensity = map(inValue, 0, 127, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); - MicroDexed[instance_id]->setGain(midi_volume_transform(map(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0, 127))); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sound_intensity)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; - case 10: // Pan + configuration.dexed[instance_id].sound_intensity = map(inValue, 0, 127, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); + MicroDexed[instance_id]->setGain(midi_volume_transform(map(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0, 127))); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sound_intensity)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 10: // Pan #ifdef DEBUG - Serial.println(F("PANORAMA CC")); + Serial.println(F("PANORAMA CC")); #endif - configuration.dexed[instance_id].pan = map(inValue, 0, 0x7f, PANORAMA_MIN, PANORAMA_MAX); - mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_panorama)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; - case 32: // BankSelect LSB + configuration.dexed[instance_id].pan = map(inValue, 0, 0x7f, PANORAMA_MIN, PANORAMA_MAX); + mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_panorama)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 32: // BankSelect LSB #ifdef DEBUG - Serial.println(F("BANK-SELECT LSB CC")); + Serial.println(F("BANK-SELECT LSB CC")); #endif - configuration.dexed[instance_id].bank = constrain(inValue, 0, MAX_BANKS - 1); - /*load_sd_voice(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - }*/ - break; - case 64: - MicroDexed[instance_id]->setSustain(inValue > 63); - /* - if (!MicroDexed[instance_id]->getSustain()) - { - for (uint8_t note = 0; note < MicroDexed[instance_id]->getMaxNotes(); note++) - { - if (MicroDexed[instance_id]->voices[note].sustained && !MicroDexed[instance_id]->voices[note].keydown) - { - MicroDexed[instance_id]->voices[note].dx7_note->keyup(); - MicroDexed[instance_id]->voices[note].sustained = false; - } - } - } - */ - break; - case 65: - MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_portamento_mode)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; - case 94: // CC 94: (de)tune - configuration.dexed[selected_instance_id].tune = map(inValue, 0, 0x7f, TUNE_MIN, TUNE_MAX); - MicroDexed[selected_instance_id]->setMasterTune((int((configuration.dexed[selected_instance_id].tune - 100) / 100.0 * 0x4000) << 11) * (1.0 / 12)); - MicroDexed[selected_instance_id]->doRefreshVoice(); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_tune)) + configuration.dexed[instance_id].bank = constrain(inValue, 0, MAX_BANKS - 1); + /*load_sd_voice(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; -#if defined(USE_FX) - case 91: // CC 91: reverb send - configuration.fx.reverb_send[selected_instance_id] = map(inValue, 0, 0x7f, REVERB_SEND_MIN, REVERB_SEND_MAX); - reverb_mixer_r.gain(selected_instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[selected_instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); - reverb_mixer_l.gain(selected_instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[selected_instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_reverb_send)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; - case 93: // CC 93: chorus level - configuration.fx.chorus_level[selected_instance_id] = map(inValue, 0, 0x7f, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); - chorus_mixer[selected_instance_id]->gain(1, volume_transform(mapfloat(configuration.fx.chorus_level[selected_instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 0.5))); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_chorus_level)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; - case 103: // CC 103: filter resonance - configuration.fx.filter_resonance[instance_id] = map(inValue, 0, 0x7f, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); - MicroDexed[instance_id]->setFilterResonance(mapfloat(configuration.fx.filter_resonance[instance_id], FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0)); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_resonance)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; - case 104: // CC 104: filter cutoff - configuration.fx.filter_cutoff[instance_id] = map(inValue, 0, 0x7f, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); - MicroDexed[instance_id]->setFilterCutoff(mapfloat(configuration.fx.filter_cutoff[instance_id], FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0));; - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_cutoff)) + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + }*/ + break; + case 64: + MicroDexed[instance_id]->setSustain(inValue > 63); + /* + if (!MicroDexed[instance_id]->getSustain()) { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; - case 105: // CC 105: delay time - configuration.fx.delay_time[instance_id] = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); - delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id] * 10, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10)); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_time)) + for (uint8_t note = 0; note < MicroDexed[instance_id]->getMaxNotes(); note++) { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); + if (MicroDexed[instance_id]->voices[note].sustained && !MicroDexed[instance_id]->voices[note].keydown) + { + MicroDexed[instance_id]->voices[note].dx7_note->keyup(); + MicroDexed[instance_id]->voices[note].sustained = false; + } } - break; - case 106: // CC 106: delay feedback - configuration.fx.delay_feedback[instance_id] = map(inValue, 0, 0x7f, DELAY_FEEDBACK_MIN , DELAY_FEEDBACK_MAX); - delay_fb_mixer[instance_id]->gain(1, midi_volume_transform(map(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0, 127))); // amount of feedback - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_feedback)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); } - break; - case 107: // CC 107: delay volume - configuration.fx.delay_level[instance_id] = map(inValue, 0, 0x7f, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); - delay_mixer[instance_id]->gain(1, midi_volume_transform(map(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0, 127))); - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_level)) - { - LCDML.OTHER_updateFunc(); - LCDML.loop_menu(); - } - break; -#endif - case 120: - MicroDexed[instance_id]->panic(); - break; - case 121: - MicroDexed[instance_id]->resetControllers(); - break; - case 123: - MicroDexed[instance_id]->notesOff(); - break; - case 126: - if (inValue > 0) - MicroDexed[instance_id]->setMonoMode(true); - else - MicroDexed[instance_id]->setMonoMode(false); - break; - case 127: - if (inValue > 0) - MicroDexed[instance_id]->setMonoMode(true); - else - MicroDexed[instance_id]->setMonoMode(false); - break; - case 200: // CC 200: seq start/stop - if (!seq.running) - handleStart(); - else - handleStop(); - break; - case 201: // CC 201: seq stop - if (seq.running) - handleStop(); - break; - case 202: // CC 202: seq record - if (seq.running) - seq.running = true; - seq.recording = true; - seq.note_in = 0; - break; - case 203: // CC 203: dexed panic - MicroDexed[0]->panic(); -#if NUM_DEXED > 1 - MicroDexed[1]->panic(); + */ + break; + case 65: + MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_portamento_mode)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 94: // CC 94: (de)tune + configuration.dexed[selected_instance_id].tune = map(inValue, 0, 0x7f, TUNE_MIN, TUNE_MAX); + MicroDexed[selected_instance_id]->setMasterTune((int((configuration.dexed[selected_instance_id].tune - 100) / 100.0 * 0x4000) << 11) * (1.0 / 12)); + MicroDexed[selected_instance_id]->doRefreshVoice(); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_tune)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; +#if defined(USE_FX) + case 91: // CC 91: reverb send + configuration.fx.reverb_send[selected_instance_id] = map(inValue, 0, 0x7f, REVERB_SEND_MIN, REVERB_SEND_MAX); + reverb_mixer_r.gain(selected_instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[selected_instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); + reverb_mixer_l.gain(selected_instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[selected_instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_reverb_send)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 93: // CC 93: chorus level + configuration.fx.chorus_level[selected_instance_id] = map(inValue, 0, 0x7f, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); + chorus_mixer[selected_instance_id]->gain(1, volume_transform(mapfloat(configuration.fx.chorus_level[selected_instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 0.5))); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_chorus_level)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 103: // CC 103: filter resonance + configuration.fx.filter_resonance[instance_id] = map(inValue, 0, 0x7f, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); + MicroDexed[instance_id]->setFilterResonance(mapfloat(configuration.fx.filter_resonance[instance_id], FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0)); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_resonance)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 104: // CC 104: filter cutoff + configuration.fx.filter_cutoff[instance_id] = map(inValue, 0, 0x7f, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); + MicroDexed[instance_id]->setFilterCutoff(mapfloat(configuration.fx.filter_cutoff[instance_id], FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0));; + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_cutoff)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 105: // CC 105: delay time + configuration.fx.delay_time[instance_id] = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); + delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id] * 10, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10)); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_time)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 106: // CC 106: delay feedback + configuration.fx.delay_feedback[instance_id] = map(inValue, 0, 0x7f, DELAY_FEEDBACK_MIN , DELAY_FEEDBACK_MAX); + delay_fb_mixer[instance_id]->gain(1, midi_volume_transform(map(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0, 127))); // amount of feedback + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_feedback)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; + case 107: // CC 107: delay volume + configuration.fx.delay_level[instance_id] = map(inValue, 0, 0x7f, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); + delay_mixer[instance_id]->gain(1, midi_volume_transform(map(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0, 127))); + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_level)) + { + LCDML.OTHER_updateFunc(); + LCDML.loop_menu(); + } + break; #endif - } + case 120: + MicroDexed[instance_id]->panic(); + break; + case 121: + MicroDexed[instance_id]->resetControllers(); + break; + case 123: + MicroDexed[instance_id]->notesOff(); + break; + case 126: + if (inValue > 0) + MicroDexed[instance_id]->setMonoMode(true); + else + MicroDexed[instance_id]->setMonoMode(false); + break; + case 127: + if (inValue > 0) + MicroDexed[instance_id]->setMonoMode(true); + else + MicroDexed[instance_id]->setMonoMode(false); + break; } } } + #if defined(USE_EPIANO) if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) ep.processMidiController(inCtrl, inValue); @@ -1584,7 +1420,7 @@ void handleProgramChange(byte inChannel, byte inProgram) } } -void handleSystemExclusive(byte* sysex, unsigned int len) +void handleSystemExclusive(byte * sysex, unsigned int len) { int16_t sysex_return; @@ -2015,13 +1851,6 @@ void handleStart(void) midi_bpm_timer = 0; midi_bpm_counter = 0; _midi_bpm = -1; - seq.step = 0; - seq.chain_active_step = 0; - seq.running = true; -#ifdef USE_SEQUENCER - sequencer_timer.start(); -#endif - } void handleContinue(void) @@ -2031,15 +1860,6 @@ void handleContinue(void) void handleStop(void) { -#ifdef USE_SEQUENCER - sequencer_timer.stop(); -#endif - seq.running = false; - seq.recording = false; - seq.note_in = 0; - seq.step = 0; - seq.chain_active_step = 0; - MicroDexed[0]->panic(); #if NUM_DEXED > 1 MicroDexed[1]->panic(); @@ -2591,7 +2411,7 @@ void set_fx_params(void) delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX) * 10); if (configuration.fx.delay_sync[instance_id] > 0) { - uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / seq.bpm); + uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / midi_bpm); delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); } diff --git a/UI.hpp b/UI.hpp index a50b232..0de12f3 100644 --- a/UI.hpp +++ b/UI.hpp @@ -40,7 +40,6 @@ #endif #include #include "drumset.h" -#include "sequencer.h" #if defined (USE_EPIANO) #include "synth_mda_epiano.h" #include @@ -56,10 +55,6 @@ #endif #define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar -#ifdef USE_SEQUENCER -extern PeriodicTimer sequencer_timer; -#endif -extern void sequencer(void); extern bool check_sd_performance_exists(uint8_t number); extern config_t configuration; @@ -80,8 +75,6 @@ extern void get_sd_performance_name_json(uint8_t number); extern bool save_sd_performance_json(uint8_t p); extern uint8_t drum_midi_channel; extern drum_config_t drum_config[NUM_DRUMSET_CONFIG]; -extern sequencer_t seq; -uint8_t seq_active_function = 99; uint8_t activesample; extern custom_midi_map_t custom_midi_map[NUM_CUSTOM_MIDI_MAPPINGS]; #endif @@ -169,21 +162,8 @@ uint8_t active_perform_page = 1; uint8_t orig_attack_values[2][7]; uint8_t orig_release_values[2][7]; int temp_int; -bool menu_select_toggle; float temp_float; -const char cc_names[8][12] = { "Volume ", - "Panorama ", - "Bank Select", - "Reverb Send", - "Seq. Start ", - "Seq. Stop ", - "Seq. RECORD", - "Panic Dexed" - }; - -const uint8_t cc_dest_values[8] = { 7, 10, 32, 91, 200, 201, 202, 203 }; - #ifdef I2C_DISPLAY #include Disp_Plus display(LCD_I2C_ADDRESS, _LCDML_DISP_cols, _LCDML_DISP_rows); @@ -307,19 +287,6 @@ void UI_func_portamento_glissando(uint8_t param); void UI_func_portamento_time(uint8_t param); void UI_handle_OP(uint8_t param); void UI_func_information(uint8_t param); -void UI_func_seq_pattern_editor(uint8_t param); -void UI_func_seq_vel_editor(uint8_t param); -void UI_func_seq_live_transpose_oct(uint8_t param); -void UI_func_arp_shift(uint8_t param); -void UI_func_seq_chord_keys_ammount(uint8_t param); -void UI_func_seq_lenght(uint8_t param); -void UI_func_seq_tempo(uint8_t param); -void UI_func_seq_pat_chain(uint8_t param); -void UI_func_arpeggio(uint8_t param); -void UI_func_seq_mute_matrix(uint8_t param); -void UI_func_seq_track_setup(uint8_t param); -void UI_func_dexed_assign(uint8_t param); -void UI_func_seq_display_style(uint8_t param); void UI_func_set_performance_name(uint8_t param); void UI_func_volume(uint8_t param); void UI_func_smart_filter(uint8_t param); @@ -395,8 +362,6 @@ void UI_func_drum_volume(uint8_t param); void UI_func_drum_pan(uint8_t param); void UI_func_drum_pitch(uint8_t param); void UI_func_drum_tune_offset(uint8_t param); -void UI_func_custom_mappings(uint8_t param); -void UI_func_cc_mappings(uint8_t param); char* basename(const char* filename); char* strip_extension(char* filename); @@ -580,59 +545,6 @@ uint8_t * rotTile(const uint8_t * tile) } #endif -void smart_filter(uint8_t dir) -{ - bool found = false; - - //search backwards - if (dir == 0) { - if (seq.smartfilter) { - do { - if (found == false) activesample = constrain(activesample - 1, 0, NUM_DRUMSET_CONFIG - 2); - for (uint8_t d = 0; d < 10; d++) - { - if (seq.content_type[d] == 0) { - for (uint8_t y = 0; y < 16; y++) - { - if (drum_config[activesample].midinote == seq.note_data[d][y] || drum_config[activesample].midinote == seq.vel[d][y]) - { - found = true; - break; - } - } - } - } - } while (found == false && activesample > 0 ); - } - else - activesample = constrain(activesample - 1, 0, NUM_DRUMSET_CONFIG - 2); - } - else //search forwards - { - if (seq.smartfilter) { - do { - if (found == false) activesample = constrain(activesample + 1, 0, NUM_DRUMSET_CONFIG - 2); - for (uint8_t d = 0; d < 10; d++) - { - if (seq.content_type[d] == 0) { - - for (uint8_t y = 0; y < 16; y++) - { - if (drum_config[activesample].midinote == seq.note_data[d][y] || drum_config[activesample].midinote == seq.vel[d][y]) - { - found = true; - break; - } - } - } - } - } while (found == false && activesample < NUM_DRUMSET_CONFIG - 2 ); - } - else - activesample = constrain(activesample + 1, 0, NUM_DRUMSET_CONFIG - 2); - } -} - void setup_ui(void) { // LCD Begin @@ -672,18 +584,6 @@ void setup_debug_message(void) } #endif -void toggle_sequencer_play_status() -{ - if (seq.running == false && seq.recording == false) - { - handleStart(); - } - else if (seq.running == true && seq.recording == false) - { - handleStop(); - } -} - /*********************************************************************** MENU CONTROL ***********************************************************************/ @@ -819,14 +719,6 @@ void lcdml_menu_control(void) #endif encoderDir[ENC_R].ButtonLong(true); - // if (seq.running) { - // seq.running = false; - // seq.recording = false; - // seq.step = 0; - // seq.chain_active_step = 0; - // MicroDexed[0]->panic(); - // } - if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) { LCDML.BT_enter(); @@ -964,9 +856,6 @@ void lcdml_menu_control(void) // when in Voice select Menu, long left-press sets/unsets favorite if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) save_favorite(configuration.dexed[selected_instance_id].bank, configuration.dexed[selected_instance_id].voice, selected_instance_id); - // when not in Voice select Menu, long left-press starts/stops sequencer - else if (LCDML.FUNC_getID() != LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) - toggle_sequencer_play_status(); //for (uint8_t i = 0; i < NUM_DEXED; i++) // MicroDexed[i]->panic(); @@ -4484,73 +4373,32 @@ void UI_func_drum_reverb_send(uint8_t param) } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (menu_select_toggle == false) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + if (LCDML.BT_checkDown()) { - if (LCDML.BT_checkDown()) - { - // activesample = constrain(activesample + ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - smart_filter(1); - } - else if (LCDML.BT_checkUp()) - { - // activesample = constrain(activesample - ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - smart_filter(0); - } + temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, REVERB_SEND_MAX); } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + else if (LCDML.BT_checkUp()) { - if (LCDML.BT_checkDown()) - { - temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, REVERB_SEND_MAX); - } - else if (LCDML.BT_checkUp()) - { - temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, REVERB_SEND_MAX); - } - } - } - if (LCDML.BT_checkEnter()) - { - if (menu_select_toggle) { - menu_select_toggle = false; - } else - { menu_select_toggle = true; - temp_int = (int)(drum_config[activesample].reverb_send * 100); + temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, REVERB_SEND_MAX); } } - if (menu_select_toggle == false) { - display.setCursor(11, 1); - display.print(" "); - display.setCursor(15, 1); - display.print(" "); - display.setCursor(0, 1); - display.print("["); - display.setCursor(3, 1); - display.print("]"); - display.setCursor(1, 1); - sprintf(displayname, "%02d", activesample); - display.print(displayname); - display.show(4, 5, 6, basename(drum_config[activesample].name)); - sprintf(displayname, "%03d", (int)(drum_config[activesample].reverb_send * 100) ); - display.setCursor(12, 1); - display.print(displayname); - } else { - display.setCursor(0, 1); - display.print(" "); - display.setCursor(3, 1); - display.print(" "); - display.setCursor(11, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - sprintf(displayname, "%03d", temp_int); - display.setCursor(12, 1); - display.print(displayname); - drum_config[activesample].reverb_send = mapfloat(temp_int, 0, 100, 0.0, 1.0); - } + + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + sprintf(displayname, "%03d", temp_int); + display.setCursor(12, 1); + display.print(displayname); + drum_config[activesample].reverb_send = mapfloat(temp_int, 0, 100, 0.0, 1.0); } + if (LCDML.FUNC_close()) // ****** STABLE END ********* { encoderDir[ENC_R].reset(); @@ -4592,7 +4440,7 @@ void UI_func_drums_main_volume(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - temp_int = mapfloat(seq.drums_volume, 0.0, VOL_MAX_FLOAT, 0, 100); + temp_int = mapfloat(configuration.drums.vol, 0.0, VOL_MAX_FLOAT, 0, 100); display.setCursor(0, 0); display.print(" Drums M.Volume "); } @@ -4616,7 +4464,7 @@ void UI_func_drums_main_volume(uint8_t param) display.print("/100"); master_mixer_r.gain (MASTER_MIX_CH_DRUMS, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT))); master_mixer_l.gain (MASTER_MIX_CH_DRUMS, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT))); - seq.drums_volume = mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT); + configuration.drums.vol = mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -4641,72 +4489,35 @@ void UI_func_drum_tune_offset(uint8_t param) } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (menu_select_toggle == false) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + if (LCDML.BT_checkDown()) { - if (LCDML.BT_checkDown()) - { - activesample = constrain(activesample + ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - } - else if (LCDML.BT_checkUp()) - { - activesample = constrain(activesample - ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - } + temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 400); } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + else if (LCDML.BT_checkUp()) { - if (LCDML.BT_checkDown()) - { - temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 400); - } - else if (LCDML.BT_checkUp()) - { - temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 400); - } - } - } - if (LCDML.BT_checkEnter()) - { - if (menu_select_toggle) { - menu_select_toggle = false; - } else - { menu_select_toggle = true; - temp_int = (int)(drum_config[activesample].p_offset * 200); + temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 400); } } - if (menu_select_toggle == false) { - display.setCursor(11, 1); - display.print(" "); - display.setCursor(15, 1); - display.print(" "); - display.setCursor(0, 1); - display.print("["); - display.setCursor(3, 1); - display.print("]"); - display.setCursor(1, 1); - sprintf(displayname, "%02d", activesample); - display.print(displayname); - display.show(1, 4, 7, basename(drum_config[activesample].name)); - sprintf(displayname, "%03d", (int)(drum_config[activesample].p_offset * 200) ); - display.setCursor(12, 1); - display.print(displayname); - } else { - temp_float = mapfloat(temp_int, 0, 400, 0.0, 2.0); - display.setCursor(0, 1); - display.print(" "); - display.setCursor(3, 1); - display.print(" "); - display.setCursor(11, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - sprintf(displayname, "%03d", temp_int); - display.setCursor(12, 1); - display.print(displayname); - drum_config[activesample].p_offset = temp_float; - } + + + temp_float = mapfloat(temp_int, 0, 400, 0.0, 2.0); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + sprintf(displayname, "%03d", temp_int); + display.setCursor(12, 1); + display.print(displayname); + drum_config[activesample].p_offset = temp_float; } + if (LCDML.FUNC_close()) // ****** STABLE END ********* { encoderDir[ENC_R].reset(); @@ -4730,259 +4541,91 @@ void UI_func_drum_pitch(uint8_t param) } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (menu_select_toggle == false) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + if (LCDML.BT_checkDown()) { - if (LCDML.BT_checkDown()) - { - activesample = constrain(activesample + ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - } - else if (LCDML.BT_checkUp()) - { - activesample = constrain(activesample - ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - } + temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 400); } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + else if (LCDML.BT_checkUp()) { - if (LCDML.BT_checkDown()) - { - temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 400); - } - else if (LCDML.BT_checkUp()) - { - temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 400); - } - } - } - if (LCDML.BT_checkEnter()) - { - if (menu_select_toggle) { - menu_select_toggle = false; - } else - { menu_select_toggle = true; - temp_int = (int)(drum_config[activesample].pitch * 200); + temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 400); } } - if (menu_select_toggle == false) { - display.setCursor(11, 1); - display.print(" "); - display.setCursor(15, 1); - display.print(" "); - display.setCursor(0, 1); - display.print("["); - display.setCursor(3, 1); - display.print("]"); - display.setCursor(1, 1); - sprintf(displayname, "%02d", activesample); - display.print(displayname); - display.show(1, 4, 7, basename(drum_config[activesample].name)); - sprintf(displayname, "%03d", (int)(drum_config[activesample].pitch * 200) ); - display.setCursor(12, 1); - display.print(displayname); - } else { - temp_float = mapfloat(temp_int, 0, 400, 0.0, 2.0); - display.setCursor(0, 1); - display.print(" "); - display.setCursor(3, 1); - display.print(" "); - display.setCursor(11, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - sprintf(displayname, "%03d", temp_int); - display.setCursor(12, 1); - display.print(displayname); - drum_config[activesample].pitch = temp_float; - } + + temp_float = mapfloat(temp_int, 0, 400, 0.0, 2.0); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + sprintf(displayname, "%03d", temp_int); + display.setCursor(12, 1); + display.print(displayname); + drum_config[activesample].pitch = temp_float; } + if (LCDML.FUNC_close()) // ****** STABLE END ********* { encoderDir[ENC_R].reset(); } } -void print_custom_mappings() -{ - // display.setTextSize(2); - // display.setTextColor(WHITE, BLACK); - // - // for (uint8_t y = 0; y < 10; y++) - // { - // display.setCursor_textGrid(1, y + 8); - // display.setTextColor(WHITE, BLACK); - // seq_print_formatted_number(y + 1, 2); //entry no. - // - // if (custom_midi_map[y].type == 0) - // { - // display.setTextColor(GREY1, BLACK); - // display.show(y + 8, 4, 5, "NONE" ); - // } - // else if (custom_midi_map[y].type == 1) - // { - // display.setTextColor(DX_CYAN, BLACK); - // display.show(y + 8, 4, 7, "KEY/PAD" ); - // } - // else if (custom_midi_map[y].type == 2) - // { - // display.setTextColor(DX_CYAN, BLACK); - // display.show(y + 8, 4, 7, "MIDI CC" ); - // } - // display.setTextColor(DX_ORANGE, BLACK); - // display.show(y + 8, 12, 3, custom_midi_map[y].in ); - // - // display.setTextColor(DX_MAGENTA, BLACK); - // display.show(y + 8, 16, 3, custom_midi_map[y].out ); - // - // display.setTextColor(LIGHTBLUE, BLACK); - // display.show(y + 8, 20, 3, custom_midi_map[y].channel ); - // - // - // display.setTextColor(DX_PURPLE, BLACK); - // if (custom_midi_map[y].in == 0) - // display.show(y + 8, 24, 12, "EMPTY SLOT"); - // else if (custom_midi_map[y].type == 1) - // { - // display.setTextColor(PINK, BLACK); - // display.show(y + 8, 24, 13, find_long_drum_name_from_note(custom_midi_map[y].out) ); - // } - // else if (custom_midi_map[y].type == 2) - // { - // display.setTextColor(LIGHTBLUE, BLACK); - // for (uint8_t i = 0; i < sizeof(cc_dest_values); i++) - // { - // if (custom_midi_map[y].out == cc_dest_values[i]) - // display.show(y + 8, 24, 13, cc_names[i] ); - // } - // } - // } - ; -} - -void UI_func_custom_mappings(uint8_t param) -{ - //char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; +void UI_func_drum_volume(uint8_t param) +{ + char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - // display.fillScreen(BLACK); - // display.setTextColor(WHITE, BLACK); - // display.setTextSize(2); - // border1(); - // border2(); - // border3_large(); - // display.setCursor_textGrid(1, 1); - // display.print(F("CUSTOM MAPPINGS")); - // - // display.setTextColor(WHITE, BLUE); - // display.setTextSize(2); - // display.fillRect (240 + CHAR_width, CHAR_height, 8 * CHAR_width, 4 * CHAR_height, BLUE); - // display.setCursor(240 + CHAR_width * 2 + 5, 2 * CHAR_height ); - // display.print(F("TOUCH")); - // - // display.drawBitmap(240 + CHAR_width * 2 + 4, CHAR_height * 4 - 12, special_chars[19], 8, 8, GREEN); - // display.setCursor(240 + CHAR_width * 3 + 10, CHAR_height * 4 - 12 ); - // display.setTextSize(1); - // display.print(F("PREVIEW")); - // - // display.fillRect (240 + CHAR_width + CHAR_width * 10 - 2, CHAR_height, 8 * CHAR_width, 4 * CHAR_height, BLUE); - // display.setCursor(240 + CHAR_width * 12 + 4, 2 * CHAR_height); - // display.setTextSize(2); - // display.print(F("TOUCH")); - // display.setCursor(240 + CHAR_width * 12 + 3, CHAR_height * 4 - 12 ); - // display.setTextSize(1); - // display.print(F("MIDI LEARN")); - // - // //scrollbar - // display.fillRect (480 - 28, 8 * CHAR_height, 14, 10 * CHAR_height, WHITE); - // display.fillRect (480 - 27, 8 * CHAR_height + 1, 12, 4 * CHAR_height, GREY1); - // - // display.setTextSize(2); - // display.setTextColor(WHITE, BLACK); - // display.setCursor_textGrid(1, 7); - // display.print(F("NO TYPE IN OUT CH. NAME")); - - print_custom_mappings(); + temp_int = (int)(drum_config[activesample].vol_max * 100); + display.setCursor(0, 0); + display.print("DrumSmp. Volume"); + display.setCursor(1, 1); + display.setCursor(1, 1); + sprintf(displayname, "%02d", activesample); + display.print(displayname); + display.show(1, 4, 7, basename(drum_config[activesample].name)); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - smart_filter(1); - } - else if (LCDML.BT_checkUp()) - { - smart_filter(0); - } - } - if (LCDML.BT_checkEnter()) - { - ; - } - // display.setTextColor(WHITE, BLACK); - // display.setTextSize(2); - // display.setCursor_textGrid(1, 2); - // display.print("["); - // display.setCursor_textGrid(4, 2); - // display.print("]"); - // display.setCursor_textGrid(2, 2); - // - // sprintf(displayname, "%02d", activesample); - // display.print(displayname); - // display.setTextColor(DX_CYAN, BLACK); - // display.show(2, 5, 13, basename(drum_config[activesample].name)); - + temp_float = mapfloat(temp_int, 0, 100, 0.0, 1.0); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + sprintf(displayname, "%03d", temp_int); + display.setCursor(12, 1); + display.print(displayname); + drum_config[activesample].vol_max = temp_float; } + if (LCDML.FUNC_close()) // ****** STABLE END ********* { - seq.midi_learn_active = false; encoderDir[ENC_R].reset(); } } -void UI_func_cc_mappings(uint8_t param) +void UI_func_drum_pan(uint8_t param) { + char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; if (LCDML.FUNC_setup()) // ****** SETUP ********* { - encoderDir[ENC_R].reset(); - // display.fillScreen(BLACK); - // display.setTextColor(WHITE, BLACK); - // display.setTextSize(2); - // border1(); - // border2(); - // border3_large(); - - UI_update_instance_icons(); - - // display.setCursor_textGrid(1, 1); - // display.print("CUSTOM DEXED CC"); - // - // display.setTextColor(WHITE, BLUE); - // display.setTextSize(2); - // - // display.fillRect (240 + CHAR_width + CHAR_width * 10 - 2, CHAR_height, 8 * CHAR_width, 4 * CHAR_height, BLUE); - // display.setCursor(240 + CHAR_width * 12 + 4, 2 * CHAR_height); - // display.setTextSize(2); - // display.print(F("TOUCH")); - // display.setCursor(240 + CHAR_width * 12 + 3, CHAR_height * 4 - 12 ); - // display.setTextSize(1); - // display.print(F("MIDI LEARN")); - // - // //scrollbar - // display.fillRect (480 - 28, 8 * CHAR_height, 14, 10 * CHAR_height, WHITE); - // display.fillRect (480 - 27, 8 * CHAR_height + 1, 12, 4 * CHAR_height, GREY1); - // - // display.setTextSize(2); - // display.setTextColor(WHITE, BLACK); - // display.setCursor_textGrid(1, 7); - // display.print(F("NO TYPE IN OUT CH. NAME")); - - print_custom_mappings(); - + temp_int = mapfloat(drum_config[activesample].pan, -1.0, 1.0, -99, 99); + display.setCursor(0, 0); + display.print("DrmSmp. Panorama"); + display.setCursor(1, 1); + sprintf(displayname, "%02d", activesample); + display.print(displayname); + display.show(1, 4, 6, basename(drum_config[activesample].name)); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -4990,2375 +4633,173 @@ void UI_func_cc_mappings(uint8_t param) { if (LCDML.BT_checkDown()) { - seq.temp_select_menu = constrain(seq.temp_select_menu + ENCODER[ENC_R].speed(), 0, 7); + temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), -99, 99); } else if (LCDML.BT_checkUp()) { - seq.temp_select_menu = constrain(seq.temp_select_menu - ENCODER[ENC_R].speed(), 0, 7); + temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), -99, 99); } } - if (LCDML.BT_checkEnter()) - { - selected_instance_id = !selected_instance_id; - UI_update_instance_icons(); - } + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + drum_config[activesample].pan = mapfloat(temp_int, -99, 99, -1.0, 1.0); - // display.setTextSize(2); - // display.setTextColor(DX_CYAN, BLACK); - // display.show(2, 1, 13, cc_names[seq.temp_select_menu] ); + temp_int = mapfloat(drum_config[activesample].pan, -1.0, 1.0, -99, 99); + display.setCursor(12, 1); + if (temp_int > 1) { + display.print("R"); + } else if (temp_int < 0) { + display.print("L"); + } + else { + display.print("C"); + } + sprintf(displayname, "%02d", abs(temp_int)); + display.setCursor(13, 1); + display.print( displayname); } + if (LCDML.FUNC_close()) // ****** STABLE END ********* { - seq.midi_learn_active = false; encoderDir[ENC_R].reset(); } } -void UI_func_drum_volume(uint8_t param) +void UI_func_save_performance(uint8_t param) { - char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; + static bool overwrite; + static bool yesno; + static uint8_t mode; if (LCDML.FUNC_setup()) // ****** SETUP ********* { + char tmp[CONFIG_FILENAME_LEN]; + yesno = false; + temp_int = 0; + mode = 0; encoderDir[ENC_R].reset(); - temp_int = (int)(drum_config[activesample].vol_max * 100); display.setCursor(0, 0); - display.print("DrumSmp. Volume"); - display.setCursor(1, 1); - display.setCursor(1, 1); - sprintf(displayname, "%02d", activesample); - display.print(displayname); - display.show(1, 4, 7, basename(drum_config[activesample].name)); - + display.print(F("Save Performance")); + display.setCursor(0, 1); + sprintf(tmp, "[%2d]", temp_int); + display.print(tmp); + sprintf(tmp, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, temp_int, PERFORMANCE_CONFIG_NAME); + if (SD.exists(tmp)) + overwrite = true; + else + overwrite = false; + if (check_sd_performance_exists(temp_int)) + { + get_sd_performance_name_json(temp_int); + if ( configuration.performance.name_temp[0] != 0 ) + display.show(1, 5, 11, configuration.performance.name_temp); + else + display.print(" -- DATA --"); + } } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (menu_select_toggle == false) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + if (LCDML.BT_checkDown()) { - if (LCDML.BT_checkDown()) - { - // activesample = constrain(activesample + ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - smart_filter(1); - } - else if (LCDML.BT_checkUp()) - { - // activesample = constrain(activesample - ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - smart_filter(0); - } + if (mode == 0) + temp_int = constrain(temp_int + ENCODER[ENC_L].speed(), 0, 99); + else + yesno = true; } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + else if (LCDML.BT_checkUp()) { - if (LCDML.BT_checkDown()) - { - temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 100); - } - else if (LCDML.BT_checkUp()) - { - temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 100); - } - } - } - if (LCDML.BT_checkEnter()) - { - if (menu_select_toggle) { - menu_select_toggle = false; - } else - { menu_select_toggle = true; - temp_int = (int)(drum_config[activesample].vol_max * 100); - } - } - if (menu_select_toggle == false) { - display.setCursor(11, 1); - display.print(" "); - display.setCursor(15, 1); - display.print(" "); - display.setCursor(0, 1); - display.print("["); - display.setCursor(3, 1); - display.print("]"); - display.setCursor(1, 1); - sprintf(displayname, "%02d", activesample); - display.print(displayname); - display.show(1, 4, 7, basename(drum_config[activesample].name)); - sprintf(displayname, "%03d", (int)(drum_config[activesample].vol_max * 100) ); - display.setCursor(12, 1); - display.print(displayname); - } else { - temp_float = mapfloat(temp_int, 0, 100, 0.0, 1.0); - display.setCursor(0, 1); - display.print(" "); - display.setCursor(3, 1); - display.print(" "); - display.setCursor(11, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - sprintf(displayname, "%03d", temp_int); - display.setCursor(12, 1); - display.print(displayname); - drum_config[activesample].vol_max = temp_float; - } - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void UI_func_arp_shift(uint8_t param) -{ - char displayname[4] = {0, 0, 0, 0}; - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - display.setCursor(0, 0); - display.print("Arp/Chord Transp"); - display.setCursor(0, 1); - display.print("Oct"); - display.setCursor(4, 1); - sprintf(displayname, "%02d", seq.oct_shift); - display.print(displayname); - display.setCursor(8, 1); - display.print("Shift"); - display.setCursor(14, 1); - display.print(seq.element_shift); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (menu_select_toggle == false) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - seq.oct_shift = constrain(seq.oct_shift + ENCODER[ENC_R].speed(), -2, 2); - } - else if (LCDML.BT_checkUp()) - { - seq.oct_shift = constrain(seq.oct_shift - ENCODER[ENC_R].speed(), -2, 2); - } - } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - seq.element_shift = constrain(seq.element_shift + ENCODER[ENC_R].speed(), 0, 6); - } - else if (LCDML.BT_checkUp()) - { - seq.element_shift = constrain(seq.element_shift - ENCODER[ENC_R].speed(), 0, 6); - } - } - } - if (LCDML.BT_checkEnter()) - { - menu_select_toggle = !menu_select_toggle; - } - if (menu_select_toggle == false) - { display.setCursor(13, 1); - display.print(" "); - display.setCursor(15, 1); - display.print(" "); - display.setCursor(3, 1); - display.print("["); - display.setCursor(6, 1); - display.print("]"); - display.setCursor(4, 1); - sprintf(displayname, "%02d", seq.oct_shift); - display.print(displayname); - - } else { - display.setCursor(3, 1); - display.print(" "); - display.setCursor(6, 1); - display.print(" "); - display.setCursor(13, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - display.setCursor(14, 1); - display.print(seq.element_shift); - - } - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void UI_func_drum_pan(uint8_t param) -{ - char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - temp_int = mapfloat(drum_config[activesample].pan, -1.0, 1.0, -99, 99); - display.setCursor(0, 0); - display.print("DrmSmp. Panorama"); - display.setCursor(1, 1); - sprintf(displayname, "%02d", activesample); - display.print(displayname); - display.show(1, 4, 6, basename(drum_config[activesample].name)); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (menu_select_toggle == false) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - //activesample = constrain(activesample + ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - smart_filter(1); - } - else if (LCDML.BT_checkUp()) - { - //activesample = constrain(activesample - ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); - smart_filter(0); - } - } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), -99, 99); - } - else if (LCDML.BT_checkUp()) - { - temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), -99, 99); - } - } - } - if (LCDML.BT_checkEnter()) - { - if (menu_select_toggle) { - menu_select_toggle = false; - } else - { menu_select_toggle = true; - } - } - if (menu_select_toggle == false) { - display.setCursor(11, 1); - display.print(" "); - display.setCursor(15, 1); - display.print(" "); - display.setCursor(0, 1); - display.print("["); - display.setCursor(3, 1); - display.print("]"); - display.setCursor(1, 1); - sprintf(displayname, "%02d", activesample); - display.print(displayname); - display.show(1, 4, 6, basename(drum_config[activesample].name)); - } else { - display.setCursor(0, 1); - display.print(" "); - display.setCursor(3, 1); - display.print(" "); - display.setCursor(11, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - drum_config[activesample].pan = mapfloat(temp_int, -99, 99, -1.0, 1.0); - } - - temp_int = mapfloat(drum_config[activesample].pan, -1.0, 1.0, -99, 99); - - display.setCursor(12, 1); - if (temp_int > 1) { - display.print("R"); - } else if (temp_int < 0) { - display.print("L"); - } - else { - display.print("C"); - } - sprintf(displayname, "%02d", abs(temp_int)); - display.setCursor(13, 1); - display.print( displayname); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -const char* seq_find_drum_name_from_note(uint8_t note) -{ - bool found = false; - const char* shortname; - for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG - 1; d++) - { - if (note == drum_config[d].midinote) - { shortname = basename(drum_config[d].name); - found = true; - break; - } - } - if (found == false) shortname = " "; - - return shortname; -} - -const char* seq_find_shortname(uint8_t sstep) -{ - const char* shortname; - bool found = false; - if (seq.content_type[seq.active_track] == 0 && seq.vel[seq.active_track][sstep] < 210) //is Drumtrack and not a pitched sample - { - for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG - 1; d++) - { - if (seq.note_data[seq.active_track][sstep] == drum_config[d].midinote) - { - shortname = drum_config[d].shortname; - found = true; - break; - } - } - if (found == false) shortname = "-"; - } else - { - if (seq.note_data[seq.active_track][sstep] > 0 && seq.note_data[seq.active_track][sstep] != 130) - shortname = noteNames[seq.note_data[seq.active_track][sstep] % 12]; - else if (seq.note_data[seq.active_track][sstep] == 130) shortname = "~"; // note has tie/latch - else - shortname = "-"; - } - return shortname; -} - -void seq_printAllSeqSteps() -{ - display.setCursor(0, 1); - for (uint8_t i = 0; i < 16; i++) - { - display.print(seq_find_shortname(i)[0]); - } -} - -#ifdef TESTDISPLAY20x4 -void seq_printVelGraphBar() -{ - display.setCursor(0, 2); - for (uint8_t i = 0; i < 16; i++) - { - if (seq.vel[seq.active_track][i] == 0) - display.print(" "); - else if (seq.vel[seq.active_track][i] > 0 && seq.vel[seq.active_track][i] <= 20) - display.write(1); - else if (seq.vel[seq.active_track][i] > 21 && seq.vel[seq.active_track][i] <= 40) - display.write(2); - else if (seq.vel[seq.active_track][i] > 41 && seq.vel[seq.active_track][i] <= 60) - display.write(3); - else if (seq.vel[seq.active_track][i] > 61 && seq.vel[seq.active_track][i] <= 80) - display.write(4); - else if (seq.vel[seq.active_track][i] > 81 && seq.vel[seq.active_track][i] <= 90) - display.write(5); - else if (seq.vel[seq.active_track][i] > 91 && seq.vel[seq.active_track][i] <= 105) - display.write(6); - else if (seq.vel[seq.active_track][i] > 105 && seq.vel[seq.active_track][i] <= 128) - display.write(7); - else - display.print("C"); - } -} -#endif - -void UI_func_seq_display_style(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - display.setCursor(0, 0); - display.print("Seq. Disp. Style"); - display.setCursor(0, 1); - display.print("Pat."); - display.setCursor(9, 1); - display.print("="); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (menu_select_toggle == false) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - seq.active_track = constrain(seq.active_track + ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); - } - else if (LCDML.BT_checkUp()) - { - seq.active_track = constrain(seq.active_track - ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); - } - } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - seq.content_type[seq.active_track] = constrain(seq.content_type[seq.active_track] + ENCODER[ENC_R].speed(), 0, 2); - } - else if (LCDML.BT_checkUp()) - { - seq.content_type[seq.active_track] = constrain(seq.content_type[seq.active_track] - ENCODER[ENC_R].speed(), 0, 2); - } - } - } - if (LCDML.BT_checkEnter()) - { - menu_select_toggle = !menu_select_toggle; - } - if (menu_select_toggle == false) { - display.setCursor(10, 1); - display.print(" "); - display.setCursor(15, 1); - display.print(" "); - display.setCursor(4, 1); - display.print("["); - if (seq.active_track < 10) - display.print ("0"); - display.print(seq.active_track); - display.print("]"); - } else { - display.setCursor(4, 1); - display.print(" "); - display.setCursor(7, 1); - display.print(" "); - display.setCursor(10, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - } - display.setCursor(11, 1); - if (seq.content_type[seq.active_track] == 0) - display.print("Drum"); - else if (seq.content_type[seq.active_track] == 1) - display.print("Inst"); - else - display.print("Chrd"); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void UI_func_seq_live_transpose_oct(uint8_t param) -{ //Select octave for live transpose of sequencer instrument track. Should be one of the lowest octaves available on the keyboard. - //Allowed range: C1-C5 to not restrict too much, even for very unusual user setups/configurations. - - char note_name[4]; - char note_name2[4]; - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - getNoteName(note_name, seq.transpose); - getNoteName(note_name2, seq.transpose + 12); - display.setCursor(0, 0); - display.print(F("Live Transp.Oct.")); - display.setCursor(0, 1); - display.print(F("[")); - display.print(note_name); - display.print(F("] - ")); - display.print(("[")); - display.print(note_name2); - display.print(("]")); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - seq.transpose = constrain(seq.transpose + ENCODER[ENC_R].speed(), 24, 60); - else if (LCDML.BT_checkUp()) - seq.transpose = constrain(seq.transpose - ENCODER[ENC_R].speed(), 24, 60); - } - getNoteName(note_name, seq.transpose); - getNoteName(note_name2, seq.transpose + 12); - display.setCursor(0, 1); - display.print(F("[")); - display.print(note_name); - display.print(F("] - ")); - display.print(("[")); - display.print(note_name2); - display.print(("]")); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void UI_func_seq_chord_keys_ammount(uint8_t param) -{ - char displayname[4] = {0, 0, 0, 0}; - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - display.setCursor(0, 0); - display.print("ChordTrack Keys:"); - display.setCursor(8, 1); - display.print("Keys"); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - seq.chord_key_ammount = constrain(seq.chord_key_ammount + ENCODER[ENC_R].speed(), 1, 7); - else if (LCDML.BT_checkUp()) - seq.chord_key_ammount = constrain(seq.chord_key_ammount - ENCODER[ENC_R].speed(), 1, 7); - } - display.setCursor(4, 1); - display.print("["); - sprintf(displayname, "%02d", seq.chord_key_ammount); - display.print(displayname); - display.print("]"); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void UI_func_seq_lenght(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - display.setCursor(0, 0); - display.print(" Seq. lenght "); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - seq.chain_lenght = constrain(seq.chain_lenght + ENCODER[ENC_R].speed(), 0, 3); - else if (LCDML.BT_checkUp()) - seq.chain_lenght = constrain(seq.chain_lenght - ENCODER[ENC_R].speed(), 0, 3); - } - display.setCursor(3, 1); - display.print((seq.chain_lenght + 1) * 16 ); - display.setCursor(7, 1); - display.print("Steps"); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void UI_func_seq_tempo(uint8_t param) -{ - char tmp[7]; - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - display.setCursor(0, 0); - display.print(" Seq. Tempo "); - display.setCursor(5, 1); - display.print("BPM"); - display.setCursor(14, 1); - display.print("ms"); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - seq.bpm = constrain(seq.bpm + ENCODER[ENC_R].speed(), 50, 190); - else if (LCDML.BT_checkUp()) - seq.bpm = constrain(seq.bpm - ENCODER[ENC_R].speed(), 50, 190); - } - seq.tempo_ms = 60000000 / seq.bpm / 4; - display.setCursor(0, 1); - sprintf(tmp, "[%3d]", seq.bpm); - display.print(tmp); - display.setCursor(11, 1); - sprintf(tmp, "%3d", seq.tempo_ms / 1000); - display.print(tmp); -#ifdef USE_FX - for (uint8_t i = 0; i < MAX_DEXED; i++) - { - if (configuration.fx.delay_sync[i] > 0) - { - uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[i]] / seq.bpm); - delay_fx[i]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); - } - } -#endif - //sequencer_timer.stop(); -#ifdef USE_SEQUENCER - sequencer_timer.begin(sequencer, seq.tempo_ms / 2); -#endif - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void UI_func_seq_vel_editor(uint8_t param) -{ - char tmp[5]; - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - // setup function - encoderDir[ENC_R].reset(); - display.setCursor(0, 0); - display.print("V:"); - sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); - display.setCursor(2, 0); - display.print(tmp); - display.setCursor(12, 0); - display.print("["); - display.setCursor(13, 0); - if (seq.active_track < 10) - display.print("0"); - display.print(seq.active_track); - display.setCursor(15, 0); - display.print("]"); - - seq_printAllSeqSteps(); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (seq_active_function == 99) - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.menu = constrain(seq.menu + 1, 0, 16); - else if (LCDML.BT_checkUp()) - seq.menu = constrain(seq.menu - 1, 0, 16); - } - } - else if (seq_active_function == 0) - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.active_track = constrain(seq.active_track + 1, 0, NUM_SEQ_PATTERN - 1); - else if (LCDML.BT_checkUp()) - seq.active_track = constrain(seq.active_track - 1, 0, NUM_SEQ_PATTERN - 1); - } - } - if ( seq.note_data[seq.active_track][seq.menu - 1] > 0 ) - { - if (seq.vel[seq.active_track][seq.menu - 1] < 210) //it is a normal sample - { - if (seq_active_function == 1 && seq.content_type[seq.active_track] < 2 ) - { //if is Drum or normal Instrument Track - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] + 1, 0, 127); - else if (LCDML.BT_checkUp()) - seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] - 1, 0, 127); - } - } - else if (seq_active_function == 1 && seq.content_type[seq.active_track] > 1 ) - { //is in Chord or Arp Mode - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] + 1, 200, 205); - else if (LCDML.BT_checkUp()) - seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] - 1, 200, 205); - } - } - } - else - { - //is in pitched Sample Mode - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] + 1, 210, 215); - else if (LCDML.BT_checkUp()) - seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] - 1, 210, 215); - } - } - } - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if ( seq.menu == 0 && seq_active_function == 99) - { - seq_active_function = 0; - } else if ( seq.menu == 0 && seq_active_function == 0) - { - seq_active_function = 99; - } - else if (seq.menu > 0 && seq_active_function == 99) - { - seq_active_function = 1; - } - else - seq_active_function = 99; - } - //button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - if ( seq.content_type[seq.active_track] > 1 && seq.vel[seq.active_track][seq.menu - 1] < 200) seq.vel[seq.active_track][seq.menu - 1] = 200; - if (seq_active_function == 0) { - display.setCursor(0, 0); - if (seq.content_type[seq.active_track] == 0) - display.print("Drum Track "); - else if (seq.content_type[seq.active_track] == 1) - display.print("Instr. Track "); - else - display.print("Chord Track "); - } - if (seq.menu > 0 && seq.content_type[seq.active_track] == 0) - { - display.setCursor(0, 0); - if (seq.vel[seq.active_track][seq.menu - 1] < 210 && seq.vel[seq.active_track][seq.menu - 1] > 0) //it is a normal sample - { - display.print("V:"); - sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); - display.setCursor(2, 0); - display.print(tmp); - } - else - { // else it is a live-pitched sample - if (seq.vel[seq.active_track][seq.menu - 1] > 0) { - display.setCursor(0, 0); - display.print("Smp:["); - display.setCursor(12, 0); - display.print("]"); - display.show(0, 5, 7, basename(drum_config[seq.vel[seq.active_track][seq.menu - 1] - 210].name)); - } - } - } - if (seq.menu == 0) { - display.setCursor(12, 0); - display.print("["); - if (seq.active_track < 10) - display.print("0"); - display.print(seq.active_track); - display.print("]"); - display.setCursor(0, 1); - seq_printAllSeqSteps(); - } else if (seq.menu == 1) { - display.setCursor(12, 0); - display.print(" "); - display.setCursor(15, 0); - display.print(" "); - display.setCursor(0, 1); - display.write(219); // cursor symbol - display.setCursor(1, 1); - display.print(seq_find_shortname(1)[0] ); - if (seq.vel[seq.active_track][seq.menu - 1] < 210 && seq.content_type[seq.active_track] < 2) //it is a normal sample - { - sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); - display.setCursor(2, 0); - display.print(tmp); - } - } else if (seq.menu > 1) - { - display.setCursor(seq.menu - 1, 1); - display.write(219); // cursor symbol - display.setCursor(seq.menu - 2, 1); - display.print(seq_find_shortname(seq.menu - 2)[0] ); - if (seq.menu < 16) { - display.setCursor(seq.menu , 1); - display.print(seq_find_shortname(seq.menu)[0] ); - } - } - if (seq.menu > 0) { - display.setCursor(4, 0); - if (seq.note_data[seq.active_track][seq.menu - 1] > 0) - { - if (seq.content_type[seq.active_track] == 0) //is Drumtrack - { - display.setCursor(0, 0); - if (seq.vel[seq.active_track][seq.menu - 1] < 210) //it is a normal sample - { - display.print("V:"); - sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); - display.print(tmp); - //display.setCursor(7, 0); - //display.print(" "); - display.show(0, 6, 5, seq_find_drum_name_from_note( seq.note_data[seq.active_track][seq.menu - 1]) ); - } - else - { // else it is a live-pitched sample - display.setCursor(0, 0); - display.print("Smp:["); - display.setCursor(12, 0); - display.print("]"); - display.setCursor(1, 0); - display.show(0, 5, 7, basename(drum_config[seq.vel[seq.active_track][seq.menu - 1] - 210].name)); - } - } else - { - if ( seq.note_data[seq.active_track][seq.menu - 1] != 130 ) //note not latched - { - if (seq.content_type[seq.active_track] < 2) - { - display.setCursor(0, 0); - display.print("Vel:"); - sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); - display.setCursor(4, 0); - display.print(tmp); - display.print(" "); - } - display.setCursor(8, 0); - display.print(noteNames[seq.note_data[seq.active_track][seq.menu - 1] % 12 ][0] ); - if (noteNames[seq.note_data[seq.active_track][seq.menu - 1] % 12 ][1] != '\0' ) { - display.print(noteNames[seq.note_data[seq.active_track][seq.menu - 1] % 12 ][1] ); - } - display.print( (seq.note_data[seq.active_track][seq.menu - 1] / 12) - 1); - display.print(" "); - } - else - { //note is latched - display.setCursor(0, 0); - display.print("latched note "); - } - if (seq.content_type[seq.active_track] > 1) - { - display.setCursor(0, 0); - if (seq.vel[seq.active_track][seq.menu - 1] == 200) display.print("Major " ); - else if (seq.vel[seq.active_track][seq.menu - 1] == 201) display.print("Minor " ); - else if (seq.vel[seq.active_track][seq.menu - 1] == 202) display.print("Seven " ); - else if (seq.vel[seq.active_track][seq.menu - 1] == 203) display.print("Aug " ); - else if (seq.vel[seq.active_track][seq.menu - 1] == 204) display.print("Dim " ); - else if (seq.vel[seq.active_track][seq.menu - 1] == 205) display.print("Major7 " ); - } - } - } - else - { - display.setCursor(0, 0); - display.print(" "); - } - } - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -void seq_clear_active_pattern() -{ - memset(seq.note_data[seq.active_track], 0, sizeof(seq.note_data[seq.active_track])); - memset(seq.vel[seq.active_track], 0, sizeof(seq.vel[seq.active_track])); -} -void seq_clear_all_patterns() -{ - for (uint8_t i = 0; i < NUM_SEQ_PATTERN - 1; i++) - { - memset(seq.note_data[i], 0, sizeof(seq.note_data[i])); - memset(seq.vel[i], 0, sizeof(seq.vel[i])); - } -} - -void seq_refresh_display_play_status() -{ - if (seq.running == false && seq.recording == false) - { - display.createChar(0, (uint8_t*)special_chars[19]); //play symbol -#ifdef TESTDISPLAY20x4 - display.setCursor(14, 0); -#else - display.setCursor(10, 0); -#endif - display.write(0); - } else if (seq.running == true && seq.recording == false) - { - seq.note_in = 0; - display.createChar(0, (uint8_t*)special_chars[20]); //record symbol -#ifdef TESTDISPLAY20x4 - display.setCursor(14, 0); -#else - display.setCursor(10, 0); -#endif - display.write(0); - } else if (seq.running == true && seq.recording == true) - { - seq.note_in = 0; - display.createChar(0, (uint8_t*)special_chars[21]); //stop symbol -#ifdef TESTDISPLAY20x4 - display.setCursor(14, 0); -#else - display.setCursor(10, 0); -#endif - display.write(0); - } -} - -void arp_refresh_display_play_status() -{ - if (seq.running == false ) - { - display.createChar(0, (uint8_t*)special_chars[19]); //play symbol - display.setCursor(13, 0); - display.write(0); - } else if (seq.running == true ) - { - seq.note_in = 0; - display.createChar(0, (uint8_t*)special_chars[21]); //stop symbol - display.setCursor(13, 0); - display.write(0); - } -} -void seq_print_current_note() -{ - display.print(noteNames[seq.note_data[seq.active_track][seq.menu - 3] % 12 ][0] ); - if (noteNames[seq.note_data[seq.active_track][seq.menu - 3] % 12 ][1] != '\0' ) - { - display.print(noteNames[seq.note_data[seq.active_track][seq.menu - 3] % 12 ][1] ); - } - display.print( (seq.note_data[seq.active_track][seq.menu - 3] / 12) - 1); - display.print(" "); -} -void check_variable_samples_basespeed() -{ - for (uint8_t i = 0; i < 6; i++) - { - if (drum_config[i].p_offset == 0) - drum_config[i].p_offset = 1; - } -} -void UI_func_seq_pattern_editor(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - check_variable_samples_basespeed(); - display.createChar(0, (uint8_t*)special_chars[19]); //play symbol + record symbol switching -#ifdef TESTDISPLAY20x4 - display.createChar(1, (uint8_t*)special_chars[9]); //bar graph - display.createChar(2, (uint8_t*)special_chars[10]); //bar graph - display.createChar(3, (uint8_t*)special_chars[11]); //bar graph - display.createChar(4, (uint8_t*)special_chars[12]); //bar graph - display.createChar(5, (uint8_t*)special_chars[13]); //bar graph - display.createChar(6, (uint8_t*)special_chars[14]); //bar graph - display.createChar(7, (uint8_t*)special_chars[15]); //bar graph -#endif - temp_int = seq.note_data[seq.active_track][0]; - encoderDir[ENC_R].reset(); - seq.note_in = 0; - // setup function - seq_refresh_display_play_status(); -#ifdef TESTDISPLAY20x4 - display.setCursor(17, 0); -#else - display.setCursor(13, 0); -#endif - if (seq.active_track < 10)display.print("0"); - display.print(seq.active_track); - seq_printAllSeqSteps(); -#ifdef TESTDISPLAY20x4 - seq_printVelGraphBar(); -#endif - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (seq_active_function == 40 ) { // pitch edit sample - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) { - seq.note_data[seq.active_track][seq.menu - 3] = constrain(seq.note_data[seq.active_track][seq.menu - 3] + 1, 1, 108); - } - else if (LCDML.BT_checkUp()) { - seq.note_data[seq.active_track][seq.menu - 3] = constrain(seq.note_data[seq.active_track][seq.menu - 3] - 1, 1, 108); - } - } - } - else if (seq.menu == 33) { // is in sub-function - fill pattern - seq_active_function = 95; - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) { - seq.temp_active_menu = constrain(seq.temp_active_menu + 1, 0, 3); - } - else if (LCDML.BT_checkUp()) { - seq.temp_active_menu = constrain(seq.temp_active_menu - 1, 0, 3); - } - } - } - else if (seq.menu == 32) { // is in sub-function - fill pattern - seq_active_function = 97; - if (seq.content_type[seq.active_track] == 0) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) { - seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_DRUMSET_CONFIG - 1); - } - else if (LCDML.BT_checkUp()) { - seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_DRUMSET_CONFIG - 1); - } - } - } - else - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, 108 ); - else if (LCDML.BT_checkUp()) - seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, 108 ); - } - } - } - else if (seq.menu == 30 || seq.menu == 31 ) { // is in sub-function - swap pattern or copy pattern - seq_active_function = 98; - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) { - - temp_int = constrain(temp_int + 1, 0, NUM_SEQ_PATTERN - 1); - if (temp_int == seq.active_track)temp_int++; - if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; - } - else if (LCDML.BT_checkUp()) { - temp_int = constrain(temp_int - 1, 0, NUM_SEQ_PATTERN - 1); - if (temp_int == seq.active_track)temp_int--; - if (temp_int < 0)temp_int = NUM_SEQ_PATTERN - 1; - } - } - } - else if (seq.menu == 34) { // is in transpose edit - seq_active_function = 94; - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) { - temp_int = constrain(temp_int + 1, -36, 36); - if (temp_int > 36)temp_int = 36; - } - else if (LCDML.BT_checkUp()) { - temp_int = constrain(temp_int - 1, -36, 36); - if (temp_int < -36)temp_int = -36; - } - } - } - else if (seq_active_function == 99 ) - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.menu = constrain(seq.menu + 1, 0, 18); - else if (LCDML.BT_checkUp()) - seq.menu = constrain(seq.menu - 1, 0, 18); - } - } - else if (seq_active_function == 0 ) { - if (seq.content_type[seq.active_track] == 0) // is in Drumedit mode - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - activesample = constrain(activesample + 1, 0, NUM_DRUMSET_CONFIG + 5 ); - else if (LCDML.BT_checkUp()) - activesample = constrain(activesample - 1, 0, NUM_DRUMSET_CONFIG + 5 ); - } - } - else //is in Instrument Mode - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - temp_int = constrain(temp_int + 1, 0, 116 ); - else if (LCDML.BT_checkUp()) - temp_int = constrain(temp_int - 1, 0, 116 ); - } - } - } else if (seq_active_function == 2) - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.active_track = constrain(seq.active_track + 1, 0, NUM_SEQ_PATTERN - 1); - else if (LCDML.BT_checkUp()) - seq.active_track = constrain(seq.active_track - 1, 0, NUM_SEQ_PATTERN - 1); - - display.setCursor(1, 0); - if (seq.content_type[seq.active_track] == 0) display.print("Drum "); else if (seq.content_type[seq.active_track] == 1) display.print("Instr "); else if (seq.content_type[seq.active_track] == 2) display.print("Chord "); else display.print("Arp "); - } - } - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if (seq.menu > 2 && seq.menu < 19 && seq.vel[seq.active_track][seq.menu - 3] > 209 && seq_active_function != 40 && activesample != NUM_DRUMSET_CONFIG - 1) //edit pitch of sample - { - seq_active_function = 40; - } else if ( seq_active_function == 40 ) // get out of pitch edit for samples - { - display.setCursor(8, 0); - display.print(" "); - seq_active_function = 0; - activesample = 0; - seq_refresh_display_play_status(); - seq_printAllSeqSteps(); - } else if (seq.menu == 34 ) //transpose pattern - { - seq.menu = 0; - seq_active_function = 0; - activesample = 0; - temp_int = seq.note_data[seq.active_track][0]; - display.setCursor(8, 0); - display.print(" "); - display.setCursor(12, 0); - display.print(" "); - display.setCursor(13, 0); - if (seq.active_track < 10)display.print("0"); - display.print(seq.active_track); - seq_refresh_display_play_status(); - seq_printAllSeqSteps(); - } - else if (seq.menu == 32 && seq_active_function == 97) //fill pattern every 1/4, 1/8, 1/16 step with active sample/note step 1 - { - seq_active_function = 96; - seq.menu = 33; - } else if (seq.menu == 33 && seq_active_function == 95) //fill pattern every 1/4, 1/8, 1/16 step with active sample/note step 2 - { - if (seq.content_type[seq.active_track] == 0) { //Drumtrack - for (uint8_t i = 0; i < 16; i++) - { - seq.note_data[seq.active_track][i] = drum_config[seq.temp_select_menu].midinote; - seq.vel[seq.active_track][i] = 120; - if (seq.temp_active_menu == 0) i = i + 3; else if (seq.temp_active_menu == 1) i = i + 1; - } - } - else - { //Inst. Track - for (uint8_t i = 0; i < 16; i++) - { - seq.note_data[seq.active_track][i] = seq.temp_select_menu; - seq.vel[seq.active_track][i] = 120; - if (seq.temp_active_menu == 0) i = i + 3; else if (seq.temp_active_menu == 1) i = i + 1; - } - } - seq.menu = 0; - seq_active_function = 0; - activesample = 0; - temp_int = seq.note_data[seq.active_track][0]; - display.setCursor(8, 0); - display.print(" "); - seq_refresh_display_play_status(); - seq_printAllSeqSteps(); - } else if (seq.menu == 31 && seq_active_function != 40) //copy patterns - { - memcpy( seq.note_data[temp_int], seq.note_data[seq.active_track], sizeof(seq.note_data[0])); - memcpy( seq.vel[temp_int], seq.vel[seq.active_track], sizeof(seq.vel[0])); - seq.content_type[temp_int] = seq.content_type[seq.active_track]; - seq.menu = 0; - seq_active_function = 0; - activesample = 0; - temp_int = seq.note_data[seq.active_track][0]; - display.setCursor(8, 0); - display.print(" "); - seq_refresh_display_play_status(); - seq_printAllSeqSteps(); - } else if (seq.menu == 30 && seq_active_function != 40) //swap patterns - { - uint8_t data_temp[1][16]; - uint8_t vel_temp[1][16]; - uint8_t content_type_temp; - memcpy( data_temp[0], seq.note_data[seq.active_track], sizeof(data_temp[0])); - memcpy( vel_temp[0], seq.vel[seq.active_track], sizeof(vel_temp[0])); - content_type_temp = seq.content_type[seq.active_track]; - memcpy( seq.note_data[seq.active_track], seq.note_data[temp_int], sizeof(data_temp[0])); - memcpy( seq.vel[seq.active_track], seq.vel[temp_int], sizeof(vel_temp[0])); - seq.content_type[seq.active_track] = seq.content_type[temp_int]; - memcpy( seq.note_data[temp_int], data_temp[0], sizeof(data_temp[0])); - memcpy( seq.vel[temp_int], vel_temp[0], sizeof(vel_temp[0])); - seq.content_type[temp_int] = content_type_temp; - seq.menu = 0; - seq_active_function = 0; - activesample = 0; - display.setCursor(8, 0); - display.print(" "); - temp_int = seq.note_data[seq.active_track][0]; - seq_refresh_display_play_status(); - seq_printAllSeqSteps(); - } - if ( seq.menu == 0 && seq_active_function == 99) - { - seq_active_function = 0; - } else if ( seq.menu == 0 && seq_active_function == 0) - { - if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 5) || (seq.content_type[seq.active_track] > 0 && temp_int == 116) ) - { //transpose pattern - display.setCursor(0, 0); - display.print("Transpose:[ 00]"); - for (uint8_t i = 0; i < 16; i++) - { - seq.data_buffer[i] = seq.note_data[seq.active_track][i]; - } - seq.menu = 34; - temp_int = 0; - seq.temp_select_menu = 0; - seq.temp_active_menu = 0; - } - if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 4) || (seq.content_type[seq.active_track] > 0 && temp_int == 115) ) - { //fill patterns - display.setCursor(0, 0); - display.print("Fill Pattern:"); - display.setCursor(9, 1); - display.print(" "); - seq.menu = 32; - seq.temp_select_menu = 0; - seq.temp_active_menu = 0; - } - else if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 3) || (seq.content_type[seq.active_track] > 0 && temp_int == 114) ) - { //swap patterns: Active pattern <-> destination pattern - display.setCursor(0, 0); - display.print("SwapPattern:"); - temp_int = seq.active_track + 1; - if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; - seq.menu = 30; - } else if ( ( seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 2) || ( seq.content_type[seq.active_track] > 0 && temp_int == 113) ) - { //copy pattern - display.setCursor(0, 0); - display.print("Copy Pattern:"); - temp_int = seq.active_track + 1; - if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; - seq.menu = 31; - } else if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 1) || (seq.content_type[seq.active_track] > 0 && temp_int == 112) ) - { //clear all patterns - seq_clear_all_patterns(); - seq_printAllSeqSteps(); - } else if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG) || (seq.content_type[seq.active_track] > 0 && temp_int == 111) ) - { //clear pattern - seq_clear_active_pattern(); - seq_printAllSeqSteps(); - } - seq_active_function = 99; - } - if ( seq.menu == 1 && seq_active_function != 40) - { - if (seq.running == false && seq.recording == false) - { - handleStart(); - } else if (seq.running == true && seq.recording == false) - { - seq.running = true; - seq.recording = true; - seq.note_in = 0; - } else if (seq.running == true && seq.recording == true) - { - handleStop(); - } - } else if ( seq.menu == 2 && seq_active_function != 40) - { - if (seq_active_function != 2) seq_active_function = 2; else seq_active_function = 99; - - if (seq.content_type[seq.active_track] == 0) - { - if (activesample < NUM_DRUMSET_CONFIG - 1) - display.show(0, 1, 6, basename(drum_config[activesample].name)); - } else - { - if (temp_int < 109) { - display.setCursor(3, 0); - display.print(" "); - display.setCursor(1, 0); - display.print(noteNames[temp_int % 12 ]); - display.print( (temp_int / 12) - 1); - } - } - } else if (seq.menu > 2 && seq.menu < 30 && seq_active_function != 40) - { - if (seq_active_function == 99) - { - if (seq.content_type[seq.active_track] == 0) - { //Drumtrack - - if ( drum_config[activesample].midinote > 209 ) //it is a pitched sample - { - seq.vel[seq.active_track][seq.menu - 3] = drum_config[activesample].midinote; - //seq.note_data[seq.active_track][seq.menu - 3] = MIDI_C4; - } - else - // if (activesample == NUM_DRUMSET_CONFIG - 1) //user selected EMPTY note for pitched sample - // { - // seq.note_data[seq.active_track][seq.menu - 3] = 0; - // seq.vel[seq.active_track][seq.menu - 3] = 0; - // } - // else - //check if note is already there, if not -> insert it, else remove it from grid. - if (seq.note_data[seq.active_track][seq.menu - 3] == drum_config[activesample].midinote) - { - seq.note_data[seq.active_track][seq.menu - 3] = 0; - seq.vel[seq.active_track][seq.menu - 3] = 0; - } else - { - seq.note_data[seq.active_track][seq.menu - 3] = drum_config[activesample].midinote; - seq.vel[seq.active_track][seq.menu - 3] = 120; - } - } - else - { //Inst. Track - if (temp_int == 109 || seq.note_data[seq.active_track][seq.menu - 3] == temp_int ) - { //clear note - seq.note_data[seq.active_track][seq.menu - 3] = 0; - seq.vel[seq.active_track][seq.menu - 3] = 0; - } else if (temp_int == 110) { //latch note - seq.note_data[seq.active_track][seq.menu - 3] = 130; - //seq.vel[seq.active_track][seq.menu - 3] = 0; - } else - { - seq.note_data[seq.active_track][seq.menu - 3] = temp_int; - seq.vel[seq.active_track][seq.menu - 3] = 120; - } - } - } - else - seq_active_function = 99; - } - } - //button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - - if (seq.menu == 34 && seq_active_function == 94) - { //transpose - char displayname[4] = {0, 0, 0, 0}; - display.setCursor(10, 0); - display.print("["); - display.setCursor(11, 0); - if (temp_int > 0) { - display.print("+"); - } else if (temp_int < 0) - { - display.print("-"); - } - else { - display.print(" "); - } - sprintf(displayname, "%02d", abs(temp_int)); - display.print( displayname); - display.print("]"); - for (uint8_t i = 0; i < 16; i++) - { - if (seq.content_type[seq.active_track] == 0) { //drums - if (seq.data_buffer[i] != 0 && seq.data_buffer[i] + temp_int >= 0 && seq.data_buffer[i] + temp_int < 254 - && seq.vel[seq.active_track][i] >= 210 ) // pitched drums only - seq.note_data[seq.active_track][i] = seq.data_buffer[i] + temp_int; - } - else - //instruments - if (seq.content_type[seq.active_track] > 0) { - if (seq.data_buffer[i] != 0 && seq.data_buffer[i] != 130 && seq.data_buffer[i] + temp_int > 0 && seq.data_buffer[i] + temp_int < 254) - seq.note_data[seq.active_track][i] = seq.data_buffer[i] + temp_int; - } - } - seq_printAllSeqSteps(); - } - else if (seq.menu == 33) - { //fill pattern 2nd parameter - display.setCursor(4, 1); - display.print(" "); - display.setCursor(9, 1); - display.print(" "); - display.setCursor(10, 1); - display.print("["); - display.setCursor(15, 1); - display.print("]"); - display.setCursor(11, 1); - if (seq.temp_active_menu == 0) display.print(" 1/4"); - else if (seq.temp_active_menu == 1) display.print(" 1/8"); - else if (seq.temp_active_menu == 2) display.print("1/16"); - } else if (seq.menu == 32 ) { //fill pattern - if (seq.content_type[seq.active_track] == 0) { //drum - display.setCursor(0, 1); - display.print("with"); - display.setCursor(4, 1); - display.print("["); - display.setCursor(9, 1); - display.print("]"); - display.show(1, 5, 4, basename(drum_config[seq.temp_select_menu].name)); - display.setCursor(11, 1); - if (seq.temp_active_menu == 0) display.print(" 1/4"); - else if (seq.temp_active_menu == 1) display.print(" 1/8"); - else if (seq.temp_active_menu == 2) display.print("1/16"); - } else - { //inst - display.setCursor(0, 1); - display.print("with"); - display.setCursor(4, 1); - display.print("["); - display.setCursor(5, 1); - display.print(noteNames[seq.temp_select_menu % 12 ]); - display.print( (seq.temp_select_menu / 12) - 1); - display.print(" "); - display.setCursor(9, 1); - display.print("]"); - display.setCursor(11, 1); - if (seq.temp_active_menu == 0) display.print(" 1/4"); - else if (seq.temp_active_menu == 1) display.print(" 1/8"); - else if (seq.temp_active_menu == 2) display.print("1/16"); - } - } else if (seq.menu == 31) { //copy pattern - display.setCursor(12, 0); - display.print("["); - display.setCursor(15, 0); - display.print("]"); - display.setCursor(0, 1); - display.print(" to:[ ]"); - display.setCursor(13, 1); - if (temp_int < 10) display.print("0"); - display.print(temp_int); - } else if (seq.menu == 30) { //swap pattern - display.setCursor(12, 0); - display.print("["); - display.setCursor(15, 0); - display.print("]"); - display.setCursor(0, 1); - display.print(" with:[ ]"); - display.setCursor(13, 1); - if (temp_int < 10) display.print("0"); - display.print(temp_int); - } else if (seq.menu == 0) { -#ifdef TESTDISPLAY20x4 - display.setCursor(13, 0); - display.print(" "); - display.setCursor(15, 0); - display.print(" "); -#else - display.setCursor(9, 0); - display.print(" "); - display.setCursor(11, 0); - display.print(" "); -#endif - display.setCursor(0, 0); - display.print("["); - if (seq.content_type[seq.active_track] == 0) //Drum Mode - { - if (activesample < NUM_DRUMSET_CONFIG - 1) { - display.show(0, 1, 6, basename(drum_config[activesample].name)); - } else if (activesample == NUM_DRUMSET_CONFIG - 1) { - display.setCursor(1, 0); - display.print("EMPTY "); - } else if (activesample == NUM_DRUMSET_CONFIG ) { - display.setCursor(1, 0); - display.print("ClrPat"); - } else if (activesample == NUM_DRUMSET_CONFIG + 1) { - display.setCursor(1, 0); - display.print("ClrAll"); - } - else if (activesample == NUM_DRUMSET_CONFIG + 2) { - display.setCursor(1, 0); - display.print("Copy P"); - } - else if (activesample == NUM_DRUMSET_CONFIG + 3) { - display.setCursor(1, 0); - display.print("Swap P"); - } - else if (activesample == NUM_DRUMSET_CONFIG + 4) { - display.setCursor(1, 0); - display.print("Fill P"); - } - else if (activesample == NUM_DRUMSET_CONFIG + 5) { - display.setCursor(1, 0); - display.print("Transp"); - } - display.setCursor(7, 0); - display.print("]"); - } else //Inst. Mode - { - if (temp_int < 109) { - display.setCursor(3, 0); - display.print(" "); - display.setCursor(1, 0); - display.print(noteNames[temp_int % 12 ]); - display.print( (temp_int / 12) - 1); - } else if (temp_int == 109) { - display.setCursor(1, 0); - display.print("EMPTY "); - } else if (temp_int == 110) { - display.setCursor(1, 0); - display.print("LATCH "); - } else if (temp_int == 111) { - display.setCursor(1, 0); - display.print("ClrPat"); - } else if (temp_int == 112) { - display.setCursor(1, 0); - display.print("ClrAll"); - } else if (temp_int == 113) { - display.setCursor(1, 0); - display.print("Copy P"); - } else if (temp_int == 114) { - display.setCursor(1, 0); - display.print("Swap P"); - } else if (temp_int == 115) { - display.setCursor(1, 0); - display.print("Fill P"); - } else if (temp_int == 116) { - display.setCursor(1, 0); - display.print("Transp"); - } - display.setCursor(7, 0); - display.print("]"); - } - } - else if (seq.menu == 1) { - display.setCursor(0, 0); - display.print(" "); - display.setCursor(7, 0); - display.print(" "); -#ifdef TESTDISPLAY20x4 - display.setCursor(16, 0); - display.print(" "); - display.setCursor(19, 0); - display.print(" "); -#else - display.setCursor(12, 0); - display.print(" "); - display.setCursor(15, 0); - display.print(" "); -#endif -#ifdef TESTDISPLAY20x4 - display.setCursor(13, 0); - display.print("["); - seq_refresh_display_play_status(); - display.setCursor(15, 0); - display.print("]"); -#else - display.setCursor(9, 0); - display.print("["); - seq_refresh_display_play_status(); - display.setCursor(11, 0); - display.print("]"); -#endif - } - if (seq.menu == 2) { -#ifdef TESTDISPLAY20x4 - display.setCursor(13, 0); - display.print(" "); - display.setCursor(15, 0); - display.print(" "); - display.setCursor(16, 0); - display.print("["); - display.setCursor(17, 0); - if (seq.active_track < 10) display.print("0"); - display.print(seq.active_track); - display.setCursor(19, 0); - display.print("]"); -#else - display.setCursor(9, 0); - display.print(" "); - display.setCursor(11, 0); - display.print(" "); - display.setCursor(12, 0); - display.print("["); - display.setCursor(13, 0); - if (seq.active_track < 10) display.print("0"); - display.print(seq.active_track); - display.setCursor(15, 0); - display.print("]"); - if (seq.content_type[seq.active_track] == 0) //Drum Mode - { - display.setCursor(0, 0); - display.print(" "); - display.show(0, 1, 6, basename(drum_config[activesample].name)); - display.print(" "); - } -#endif - display.setCursor(0, 1); - seq_printAllSeqSteps(); -#ifdef TESTDISPLAY20x4 - seq_printVelGraphBar(); -#endif - } - if (seq.menu == 3) { -#ifdef TESTDISPLAY20x4 - display.setCursor(16, 0); - display.print(" "); - display.setCursor(19, 0); - display.print(" "); -#else - display.setCursor(12, 0); - display.print(" "); - display.setCursor(15, 0); - display.print(" "); -#endif - // display.setCursor(0, 1); - // display.print("_"); - // display.setCursor(1, 1); - // display.print(seq_find_shortname(1)[0]); - } - if (seq.menu > 2 && seq.menu < 19 && seq_active_function != 40) - { - if (seq.menu == 3) - display.setCursor(0, 1); - else - display.setCursor(seq.menu - 3, 1); - display.write(219); // cursor symbol - - if (seq.menu > 3) - { - display.setCursor(seq.menu - 4, 1); - - display.print(seq_find_shortname(seq.menu - 4)[0]); - } - if (seq.menu < 18) - { - display.setCursor(seq.menu - 2, 1); - display.print(seq_find_shortname(seq.menu - 2)[0]); - } - if (seq.vel[seq.active_track][seq.menu - 3] > 209 && activesample != NUM_DRUMSET_CONFIG - 1 ) //is pitched sample and selected item is not set to EMPTY - { - display.setCursor(0, 0); - display.print("[EDIT "); - seq_print_current_note(); - display.setCursor(8, 0); - display.print("?]"); - } - else - //print current sample name on active step if not empty - if (seq.note_data[seq.active_track][seq.menu - 3] > 0) - { - display.setCursor(0, 0); - display.print(" "); - display.show(0, 1, 6, seq_find_drum_name_from_note( seq.note_data[seq.active_track][seq.menu - 3]) ); - display.print(" "); - } + if (mode == 0) + temp_int = constrain(temp_int - ENCODER[ENC_L].speed(), 0, 99); else - { //if step empty, print selected, active sample - if (seq.note_data[seq.active_track][seq.menu - 3] == 0) - display.setCursor(0, 0); - display.print(" "); - display.show(0, 1, 6, basename(drum_config[activesample].name)); - display.print(" "); - } - } - else if (seq_active_function == 40 && activesample != NUM_DRUMSET_CONFIG - 1) - { //is in pitch edit function 40 - display.setCursor(1, 0); - display.show(0, 1, 4, basename(drum_config[activesample].name)); - display.setCursor(5, 0); - display.print("-"); - display.setCursor(6, 0); - seq_print_current_note(); - display.setCursor(9, 0); - display.print("]"); - } - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - seq.menu = 0; - seq_active_function = 99; - lcd_special_chars(SCROLLBAR); - } -} - -void UI_func_arpeggio(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - display.createChar(0, (uint8_t*)special_chars[19]); //play symbol - display.createChar(2, (uint8_t*)special_chars[21]); //stop symbol - seq.temp_select_menu = 0; - seq.temp_active_menu = 0; - display.setCursor( 0, 0); - display.print("Len"); - display.setCursor(7, 0); - display.print( seq.chord_names[seq.arp_chord][0]); - display.print( seq.chord_names[seq.arp_chord][1]); - display.print( seq.chord_names[seq.arp_chord][2]); - display.print( seq.chord_names[seq.arp_chord][3]); - display.setCursor( 0, 1); - display.print("Style"); - display.setCursor( 11, 1); - display.print("1/16"); - arp_refresh_display_play_status(); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (seq.temp_active_menu == 0) - { - if (LCDML.BT_checkDown()) - seq.temp_select_menu = constrain(seq.temp_select_menu + ENCODER[ENC_R].speed(), 0, 3); - else if (LCDML.BT_checkUp()) - seq.temp_select_menu = constrain(seq.temp_select_menu - ENCODER[ENC_R].speed(), 0, 3); - } - else if (seq.temp_active_menu == 1) // Octave setting - { - if (LCDML.BT_checkDown()) - seq.arp_lenght = constrain(seq.arp_lenght + ENCODER[ENC_R].speed(), 0, 9); - else if (LCDML.BT_checkUp()) - seq.arp_lenght = constrain(seq.arp_lenght - ENCODER[ENC_R].speed(), 0, 9); - } - else if (seq.temp_active_menu == 2) // Style setting - { - if (LCDML.BT_checkDown()) - seq.arp_style = constrain(seq.arp_style + ENCODER[ENC_R].speed(), 0, 3); - else if (LCDML.BT_checkUp()) - seq.arp_style = constrain(seq.arp_style - ENCODER[ENC_R].speed(), 0, 3); - } - else if (seq.temp_active_menu == 3) // Arp Speed setting - { - if (LCDML.BT_checkDown()) - seq.arp_speed = constrain(seq.arp_speed + ENCODER[ENC_R].speed(), 0, 1); - else if (LCDML.BT_checkUp()) - seq.arp_speed = constrain(seq.arp_speed - ENCODER[ENC_R].speed(), 0, 1); - } - - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if ( seq.temp_select_menu == 0 && seq.temp_active_menu == 0 ) - { - seq.temp_active_menu = 1; - } - else if ( seq.temp_select_menu == 0 && seq.temp_active_menu == 1 ) - { - seq.temp_active_menu = 0; - } - if ( seq.temp_select_menu == 1 && seq.temp_active_menu == 0 ) - { - seq.temp_active_menu = 2; - } - else if ( seq.temp_select_menu == 1 && seq.temp_active_menu == 2 ) - { - seq.temp_active_menu = 0; - } - - else if ( seq.temp_select_menu == 2 ) - { - - if (seq.running) { - seq.running = !seq.running; - handleStop(); - arp_refresh_display_play_status(); - seq.step = 0; - seq.arp_octave = 0; - seq.arp_step = 0; - seq.chain_active_step = 0; - } else - { - seq.running = !seq.running; - arp_refresh_display_play_status(); - handleStart(); - } - } - else if ( seq.temp_select_menu == 3 && seq.temp_active_menu == 0 ) - { - seq.temp_active_menu = 3; - } - else if ( seq.temp_select_menu == 3 && seq.temp_active_menu == 3 ) - { - seq.temp_active_menu = 0; - } - } - } - display.setCursor( 4, 0); - if (seq.arp_lenght == 0) display.print("A"); else display.print(seq.arp_lenght); //play all elements or from 1-xx elements - display.setCursor( 6, 1); - display.print( seq.arp_style_names[seq.arp_style][0] ); - display.print( seq.arp_style_names[seq.arp_style][1] ); - display.print( seq.arp_style_names[seq.arp_style][2] ); - display.setCursor( 11, 1); - if (seq.arp_speed == 0)display.print("1/16"); else if (seq.arp_speed == 1)display.print("1/8 "); - - if (seq.temp_select_menu == 0) { - display.setCursor( 3, 0); - display.print("["); - display.setCursor( 5, 0); - display.print("]"); - display.setCursor( 5, 1); - display.print(" "); - display.setCursor( 9, 1); - display.print(" "); - display.setCursor( 13, 1); - display.print(" "); - display.setCursor( 15, 1); - display.print(" "); - } - else if (seq.temp_select_menu == 1) - { - display.setCursor( 5, 1); - display.print("["); - display.setCursor( 9, 1); - display.print("]"); - display.setCursor( 3, 0); - display.print(" "); - display.setCursor( 5, 0); - display.print(" "); - display.setCursor( 13, 0); - display.print(" "); - display.setCursor( 15, 0); - display.print(" "); - } - else if (seq.temp_select_menu == 2) - { - display.setCursor( 5, 1); - display.print(" "); - display.setCursor( 9, 1); - display.print(" "); - display.setCursor( 13, 0); - display.print("["); - display.setCursor( 15, 0); - display.print("]"); - display.setCursor( 10, 1); - display.print(" "); - display.setCursor( 15, 1); - display.print(" "); - } - else if (seq.temp_select_menu == 3) - { - display.setCursor( 13, 0); - display.print(" "); - display.setCursor( 15, 0); - display.print(" "); - display.setCursor( 10, 1); - display.print("["); - display.setCursor( 15, 1); - display.print("]"); - display.setCursor( 3, 0); - display.print(" "); - display.setCursor( 5, 0); - display.print(" "); - } - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - lcd_special_chars(SCROLLBAR); - } -} - -void UI_func_seq_pat_chain(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - // setup function - seq.temp_select_menu = 0; - seq.temp_active_menu = 99; - seq.menu = 0; - display.setCursor( 0, 0); - display.print("ChainStep:"); - display.setCursor( 13, 0); - display.print(seq.chain_active_chainstep + 1); - display.setCursor( 14, 0); - display.print("/"); - display.setCursor( 15, 0); - display.print(seq.chain_lenght + 1); - display.setCursor( 0, 1); - display.print("T"); - display.setCursor(10 , 1); - display.print("=P"); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (seq.temp_active_menu == 99) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.menu = constrain(seq.menu + 1, 0, 2); //menu select - else if (LCDML.BT_checkUp()) - seq.menu = constrain(seq.menu - 1, 0, 2); - } - } - else if (seq.temp_active_menu == 90) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); - else if (LCDML.BT_checkUp()) - seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); - } - } else if (seq.temp_active_menu == 20) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.chain_active_chainstep = constrain(seq.chain_active_chainstep + 1, 0, seq.chain_lenght); - else if (LCDML.BT_checkUp()) - seq.chain_active_chainstep = constrain(seq.chain_active_chainstep - 1, 0, seq.chain_lenght); - } - } - else if (seq.temp_active_menu == 18) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - { - seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] = constrain(seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] + 1, 0, NUM_SEQ_PATTERN ); - } - else if (LCDML.BT_checkUp()) - { - seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] = constrain(seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] - 1, 0, NUM_SEQ_PATTERN ); - } - } - } - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if (seq.temp_active_menu == 99 && seq.menu == 0 ) - { - seq.temp_active_menu = 20; - } - else if (seq.temp_active_menu == 99 && seq.menu == 1 ) - { - seq.temp_active_menu = 90; - } - else if (seq.temp_active_menu == 99 && seq.menu == 2 ) - { - seq.temp_active_menu = 18; - } - else - seq.temp_active_menu = 99; - } - if (seq.menu == 0) // Chainselect modify - { - display.setCursor( 12, 1); - display.print(" "); - display.setCursor( 15, 1); - display.print(" "); - display.setCursor(1 , 1); - display.print(" "); - display.setCursor(3 , 1); - display.print(" "); - display.setCursor( 11, 0); - display.print("["); - display.setCursor( 13, 0); - display.print("]"); - } - else if (seq.menu == 1 ) { - display.setCursor( 12, 1); - display.print(" "); - display.setCursor( 15, 1); - display.print(" "); - display.setCursor( 11, 0); - display.print(" "); - display.setCursor( 13, 0); - display.print(" "); - display.setCursor(1 , 1); - display.print("["); - display.setCursor(3 , 1); - display.print("]"); - } - else if (seq.menu == 2 ) { - display.setCursor( 11, 0); - display.print(" "); - display.setCursor( 13, 0); - display.print(" "); - display.setCursor(1 , 1); - display.print(" "); - display.setCursor(3 , 1); - display.print(" "); - display.setCursor( 12, 1); - display.print("["); - display.setCursor( 15, 1); - display.print("]"); - } - display.setCursor( 12, 0); - display.print(seq.chain_active_chainstep + 1); - display.setCursor(2 , 1); - display.print( seq.temp_select_menu + 1); - display.setCursor(4 , 1); - if (seq.track_type[seq.temp_select_menu] == 0 ) display.print("(Drum)"); - else if (seq.track_type[seq.temp_select_menu] == 1 ) display.print("(Inst)"); - else if (seq.track_type[seq.temp_select_menu] == 2 ) display.print("(Chrd)"); else display.print("(Arp.)"); - display.setCursor( 13, 1); - if (seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] == NUM_SEQ_PATTERN)display.print("--"); //empty pattern - else - { - if (seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] < 10) - display.print("0"); - display.print(seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] ); - } - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -#ifdef TESTDISPLAY20x4 -void UI_func_seq_mute_matrix(uint8_t param) // for test display 20x4 -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - // setup function - seq.temp_active_menu = 99; - seq.temp_select_menu = 1; - seq.menu = 0; - temp_int = 0; //y offset - display.setCursor( 0, 0); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - uint8_t xscroll; - if (seq.temp_active_menu == 99) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - { - seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int != 3) //next chain step - { - display.setCursor( 14 , temp_int); - display.print(" "); - display.setCursor( 18 , temp_int); - display.print(" "); - seq.temp_select_menu = 1; - if (temp_int < 3)temp_int++; - } - if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int == 3) - seq.temp_select_menu = NUM_SEQ_TRACKS; - } - else if (LCDML.BT_checkUp()) - { - seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.temp_select_menu == 0 && temp_int > 0) //prev chain step - { - display.setCursor( 2 , temp_int); - display.print(" "); - display.setCursor( 6 , temp_int); - display.print(" "); - seq.temp_select_menu = NUM_SEQ_TRACKS - 1 ; - if (temp_int >= 0)temp_int = temp_int - 1; - display.setCursor( 14 , temp_int); - display.print("["); - display.setCursor( 18 , temp_int); - display.print("]"); - } - else if (seq.temp_select_menu < 1 && temp_int == 0 ) - seq.temp_select_menu = 1; - } + yesno = false; } - } - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if (seq.patternchain[temp_int][seq.temp_select_menu - 1] < NUM_SEQ_PATTERN) - seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] + (NUM_SEQ_PATTERN + 10); - else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] > NUM_SEQ_PATTERN && seq.patternchain[temp_int][seq.temp_select_menu - 1] != 99) - seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] - (NUM_SEQ_PATTERN + 10); - else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] == 99) - seq.patternchain[temp_int][seq.temp_select_menu - 1] = NUM_SEQ_PATTERN - 1; - } - if (seq.temp_select_menu - 1 < 4)xscroll = 0; - else if (seq.temp_select_menu - 1 == 4)xscroll = 1; - else xscroll = 2; - for (uint8_t y = 0; y < 4; y++) - { - for (uint8_t x = 0; x < NUM_SEQ_TRACKS - 2; x++) + else if (LCDML.BT_checkEnter()) { - display.setCursor( x * 4 + 3, y); - if (seq.patternchain[y][x + xscroll] < NUM_SEQ_PATTERN ) + if (mode == 0 && overwrite == true) { - if (seq.track_type[x + xscroll ] == 0 ) display.print("D"); - else if (seq.track_type[x + xscroll ] == 1 ) display.print("I"); - else if (seq.track_type[x + xscroll ] == 2 ) display.print("C"); - else display.print("A"); - if (seq.patternchain[y][x + xscroll] < 10) - display.print("0"); - display.print( seq.patternchain[y][x + xscroll] ); + mode = 1; + display.setCursor(0, 1); + display.print(F("Overwrite: [ ]")); } else - display.print("OFF"); - } - } - if (xscroll == 0) - { - //print cursor - display.setCursor( (seq.temp_select_menu - 1) * 4 + 2, temp_int); - display.print("["); - display.setCursor( (seq.temp_select_menu - 1) * 4 + 6, temp_int); - display.print("]"); - if ((seq.temp_select_menu - 1) > 0) { - display.setCursor( (seq.temp_select_menu - 1) * 4 + 2 - 4 , temp_int); - display.print(" "); - } - if ((seq.temp_select_menu - 1) < 4) { - display.setCursor( (seq.temp_select_menu - 1) * 4 + 6 + 4 , temp_int); - display.print(" "); - } - } - display.setCursor( 0, 0); - display.print("T"); - display.print(seq.temp_select_menu); - display.setCursor( 0, 1); - display.print("S"); - display.print(temp_int + 1); // Chain Step - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - -#else - -void UI_func_seq_mute_matrix(uint8_t param) // for standard display 16x2 -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - // setup function - seq.temp_active_menu = 99; - seq.temp_select_menu = 1; - seq.menu = 0; - temp_int = 0; //y offset - display.setCursor( 0, 0); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - uint8_t xscroll; - if (seq.temp_active_menu == 99) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) { - seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int != 3) //next chain step + mode = 0xff; + if (overwrite == false || yesno == true) { - display.setCursor( 10 , 1); - display.print(" "); - display.setCursor( 14 , 1); - display.print(" "); - seq.temp_select_menu = 1; - if (temp_int < 3)temp_int++; + display.show(1, 0, 16, "Done."); + delay(MESSAGE_WAIT_TIME); + LCDML.FUNC_goBackToMenu(); } - if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int == 3) - seq.temp_select_menu = NUM_SEQ_TRACKS; - } - else if (LCDML.BT_checkUp()) - { - seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.temp_select_menu == 0 && temp_int > 0) //prev chain step + else if (overwrite == true && yesno == false) { - display.setCursor( 2 , 1); - display.print(" "); - display.setCursor( 6 , 1); - display.print(" "); - seq.temp_select_menu = NUM_SEQ_TRACKS - 1 ; - if (temp_int >= 0)temp_int = temp_int - 1; - display.setCursor( 10 , 1); - display.print("["); - display.setCursor( 14 , 1); - display.print("]"); + char tmp[10]; + + mode = 0; + display.setCursor(0, 1); + sprintf(tmp, "[%2d] ", temp_int); + display.print(tmp); } - else if (seq.temp_select_menu < 1 && temp_int == 0 ) - seq.temp_select_menu = 1; } } - } - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if (seq.patternchain[temp_int][seq.temp_select_menu - 1] < NUM_SEQ_PATTERN) - seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] + (NUM_SEQ_PATTERN + 10); - else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] > NUM_SEQ_PATTERN && seq.patternchain[temp_int][seq.temp_select_menu - 1] != 99) - seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] - (NUM_SEQ_PATTERN + 10); - else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] == 99) - seq.patternchain[temp_int][seq.temp_select_menu - 1] = NUM_SEQ_PATTERN - 1; - } - if (seq.temp_select_menu - 1 < 3)xscroll = 0; - else xscroll = seq.temp_select_menu - 3; - - if (xscroll == 0) - { - //print cursor - display.setCursor( (seq.temp_select_menu - 1) * 4 + 2, 1); - display.print("["); - display.setCursor( (seq.temp_select_menu - 1) * 4 + 6, 1); - display.print("]"); - if ((seq.temp_select_menu - 1) > 0) - { - display.setCursor( (seq.temp_select_menu - 1) * 4 + 2 - 4 , 1); - display.print(" "); - } - if ((seq.temp_select_menu - 1) < 4) + if (mode == 0) { - display.setCursor( (seq.temp_select_menu - 1) * 4 + 6 + 4 , 1); - display.print(" "); - } - display.setCursor( 3, 0); - display.print("T1"); - display.setCursor( 7, 0); - display.print("T2"); - display.setCursor( 11, 0); - display.print("T3"); - } - else - { - display.setCursor( 3, 0); - display.print("T"); - display.print(seq.temp_select_menu - 2); - display.setCursor( 7, 0); - display.print("T"); - display.print(seq.temp_select_menu - 2 + 1); - display.setCursor( 11, 0); - display.print("T"); - display.print(seq.temp_select_menu - 2 + 2); - } - for (uint8_t x = 0; x < NUM_SEQ_TRACKS - 3; x++) - { - display.setCursor( x * 4 + 3, 1); - if (seq.patternchain[temp_int][x + xscroll] < NUM_SEQ_PATTERN ) - { - if (seq.track_type[x + xscroll] == 0 ) display.print("D"); - else if (seq.track_type[x + xscroll ] == 1 ) display.print("I"); - else if (seq.track_type[x + xscroll ] == 2 ) display.print("C"); - else display.print("A"); - if (seq.patternchain[temp_int][x + xscroll] < 10) - display.print("0"); - display.print( seq.patternchain[temp_int][x + xscroll] ); - } - else - display.print("OFF"); - } - display.setCursor( 0, 1); - display.print("S"); - display.print(temp_int + 1); // Chain Step - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} -#endif + char tmp[CONFIG_FILENAME_LEN]; + sprintf(tmp, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, temp_int, PERFORMANCE_CONFIG_NAME); -void UI_func_seq_track_setup(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - // setup function - seq.temp_active_menu = 99; - seq.temp_select_menu = 0; - display.setCursor(0 , 0); - display.print("Track Setup"); - display.setCursor(0 , 1); - display.print("Track "); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (seq.temp_active_menu == 99) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); - else if (LCDML.BT_checkUp()) - seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); - } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.track_type[seq.temp_active_menu] = constrain(seq.track_type[seq.temp_active_menu] + 1, 0, 3); - else if (LCDML.BT_checkUp()) - seq.track_type[seq.temp_active_menu] = constrain(seq.track_type[seq.temp_active_menu] - 1, 0, 3); + if (SD.exists(tmp)) + overwrite = true; + else + overwrite = false; + + display.setCursor(0, 1); + sprintf(tmp, "[%2d]", temp_int); + display.print(tmp); + display.setCursor(5, 1); + if (overwrite == false) { + display.print("-- EMPTY --"); + } else if (check_sd_performance_exists(temp_int)) + { + get_sd_performance_name_json(temp_int); + if ( configuration.performance.name_temp[0] != 0 ) + display.show(1, 5, 11, configuration.performance.name_temp); else + display.print("-- DATA --"); + } + else display.print(" "); } - } - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if (seq.temp_active_menu == 99) { - seq.temp_active_menu = seq.temp_select_menu; - } else + else if (mode < 0xff) { - seq.temp_active_menu = 99; + display.setCursor(12, 1); + if (yesno == true) + { + display.print(F("YES")); + } + else + display.print(F("NO ")); } } - if (seq.temp_active_menu == 99) - { - display.setCursor(8 , 1); - display.print(" "); - display.setCursor(15 , 1); - display.print(" "); - display.setCursor(5 , 1); - display.print("["); - display.setCursor(6 , 1); - display.print(seq.temp_select_menu + 1); - display.setCursor(7 , 1); - display.print("]"); - display.setCursor(9 , 1); - } else - { - display.setCursor(5 , 1); - display.print(" "); - display.setCursor(7 , 1); - display.print(" "); - display.setCursor(8 , 1); - display.print("["); - display.setCursor(15 , 1); - display.print("]"); - display.setCursor(9 , 1); - } - if (seq.track_type[seq.temp_select_menu] == 0 ) display.print("Drums "); else if (seq.track_type[seq.temp_select_menu] == 1 ) display.print("Instru"); - else if (seq.track_type[seq.temp_select_menu] == 2 )display.print("Chords"); else display.print("Arp "); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { encoderDir[ENC_R].reset(); } -} -void UI_func_dexed_assign(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - // setup function - seq.temp_active_menu = 99; - seq.temp_select_menu = 0; - display.setCursor(0 , 0); - display.print("Dexed Assign"); - display.setCursor(0 , 1); - display.print("Track "); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* + if (LCDML.FUNC_close()) // ****** STABLE END ********* { - if (seq.temp_active_menu == 99) { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); - else if (LCDML.BT_checkUp()) - seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); - } - } else { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.inst_dexed[seq.temp_active_menu] = constrain(seq.inst_dexed[seq.temp_active_menu] + 1, 0, 1); - else if (LCDML.BT_checkUp()) - seq.inst_dexed[seq.temp_active_menu] = constrain(seq.inst_dexed[seq.temp_active_menu] - 1, 0, 1); - } - } - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - { - if (seq.temp_active_menu == 99) { - seq.temp_active_menu = seq.temp_select_menu; - } else - { - seq.temp_active_menu = 99; - } - } - if (seq.temp_active_menu == 99) + if (mode < 0xff) { - display.setCursor(8 , 1); - display.print(" "); - display.setCursor(15 , 1); - display.print(" "); - display.setCursor(5 , 1); - display.print("["); - display.setCursor(6 , 1); - display.print(seq.temp_select_menu + 1); - display.setCursor(7 , 1); - display.print("]"); - display.setCursor(9 , 1); - } else - { - display.setCursor(5 , 1); - display.print(" "); - display.setCursor(7 , 1); - display.print(" "); - display.setCursor(8 , 1); - display.print("["); - display.setCursor(15 , 1); - display.print("]"); - display.setCursor(9 , 1); - + display.show(1, 0, 16, "Canceled."); + delay(MESSAGE_WAIT_TIME); } - if (seq.inst_dexed[seq.temp_select_menu] == 0 ) display.print("dexed0"); else if (seq.inst_dexed[seq.temp_select_menu] == 1 ) display.print("dexed1"); else display.print("??????"); + else + save_sd_performance_json(temp_int); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { encoderDir[ENC_R].reset(); } } @@ -7369,7 +4810,7 @@ void UI_func_load_performance(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { char tmp[10]; - if (seq.state_last_loadsave != 200)temp_int = seq.state_last_loadsave; else temp_int = param; + temp_int = 0; mode = 0; encoderDir[ENC_R].reset(); display.setCursor(0, 0); @@ -7399,7 +4840,6 @@ void UI_func_load_performance(uint8_t param) else { load_sd_performance_json(temp_int); - seq.state_last_loadsave = temp_int; display.print("Done. "); } delay(MESSAGE_WAIT_TIME); @@ -7413,8 +4853,8 @@ void UI_func_load_performance(uint8_t param) if (check_sd_performance_exists(temp_int)) { get_sd_performance_name_json(temp_int); - if ( seq.name_temp[0] != 0 ) - display.show(1, 5, 11, seq.name_temp); + if ( configuration.performance.name_temp[0] != 0 ) + display.show(1, 5, 11, configuration.performance.name_temp); else display.print(" -- DATA --"); } @@ -7436,140 +4876,6 @@ void UI_func_load_performance(uint8_t param) } } -void UI_func_save_performance(uint8_t param) -{ - static bool overwrite; - static bool yesno; - static uint8_t mode; - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - char tmp[CONFIG_FILENAME_LEN]; - yesno = false; - if (seq.state_last_loadsave != 200) - temp_int = seq.state_last_loadsave; - else - temp_int = 0; - mode = 0; - encoderDir[ENC_R].reset(); - display.setCursor(0, 0); - display.print(F("Save Performance")); - display.setCursor(0, 1); - sprintf(tmp, "[%2d]", temp_int); - display.print(tmp); - sprintf(tmp, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, temp_int, SEQUENCER_CONFIG_NAME); - if (SD.exists(tmp)) - overwrite = true; - else - overwrite = false; - if (check_sd_performance_exists(temp_int)) - { - get_sd_performance_name_json(temp_int); - if ( seq.name_temp[0] != 0 ) - display.show(1, 5, 11, seq.name_temp); - else - display.print(" -- DATA --"); - } - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) - { - if (LCDML.BT_checkDown()) - { - if (mode == 0) - temp_int = constrain(temp_int + ENCODER[ENC_L].speed(), 0, 99); - else - yesno = true; - } - else if (LCDML.BT_checkUp()) - { - if (mode == 0) - temp_int = constrain(temp_int - ENCODER[ENC_L].speed(), 0, 99); - else - yesno = false; - } - else if (LCDML.BT_checkEnter()) - { - if (mode == 0 && overwrite == true) - { - mode = 1; - display.setCursor(0, 1); - display.print(F("Overwrite: [ ]")); - } - else - { - mode = 0xff; - if (overwrite == false || yesno == true) - { - display.show(1, 0, 16, "Done."); - seq.state_last_loadsave = temp_int; - delay(MESSAGE_WAIT_TIME); - LCDML.FUNC_goBackToMenu(); - } - else if (overwrite == true && yesno == false) - { - char tmp[10]; - - mode = 0; - display.setCursor(0, 1); - sprintf(tmp, "[%2d] ", temp_int); - display.print(tmp); - } - } - } - if (mode == 0) - { - char tmp[CONFIG_FILENAME_LEN]; - sprintf(tmp, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, temp_int, SEQUENCER_CONFIG_NAME); - - if (SD.exists(tmp)) - overwrite = true; - else - overwrite = false; - - display.setCursor(0, 1); - sprintf(tmp, "[%2d]", temp_int); - display.print(tmp); - display.setCursor(5, 1); - if (overwrite == false) { - display.print("-- EMPTY --"); - } else if (check_sd_performance_exists(temp_int)) - { - get_sd_performance_name_json(temp_int); - if ( seq.name_temp[0] != 0 ) - display.show(1, 5, 11, seq.name_temp); else - display.print("-- DATA --"); - } - else display.print(" "); - } - else if (mode < 0xff) - { - display.setCursor(12, 1); - if (yesno == true) - { - display.print(F("YES")); - } - else - display.print(F("NO ")); - } - } - encoderDir[ENC_R].reset(); - } - - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - if (mode < 0xff) - { - display.show(1, 0, 16, "Canceled."); - delay(MESSAGE_WAIT_TIME); - } - else - save_sd_performance_json(temp_int); - - encoderDir[ENC_R].reset(); - } -} - void UI_func_information(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -7644,33 +4950,6 @@ void UI_func_midi_soft_thru(uint8_t param) } } -void UI_func_smart_filter(uint8_t param) -{ - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - - display.setCursor(0, 0); - display.print(F("Drm Smart Filter")); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) - { - if (LCDML.BT_checkDown()) - seq.smartfilter = !seq.smartfilter; - else if (LCDML.BT_checkUp()) - seq.smartfilter = !seq.smartfilter; - } - display.setCursor(0, 1); - if (seq.smartfilter) display.print(F("[ON ]")); else display.print(F("[OFF]")); - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } -} - void UI_func_velocity_level(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8508,10 +5787,10 @@ void UI_func_set_performance_name(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - if (mode == 1) ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, false); + if (mode == 1) ui_select_name_state = UI_select_name(1, 1, configuration.performance.name_temp, BANK_NAME_LEN - 1, false); } else if (LCDML.BT_checkUp()) { - if (mode == 1) ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, false); + if (mode == 1) ui_select_name_state = UI_select_name(1, 1, configuration.performance.name_temp, BANK_NAME_LEN - 1, false); // if (ui_select_name_state == false) { // display.setCursor(12, 1); // display.print(" "); @@ -8520,7 +5799,7 @@ void UI_func_set_performance_name(uint8_t param) // display.setCursor(11, 1); // display.print("]"); // display.blink(); - // ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, true); + // ui_select_name_state = UI_select_name(1, 1, configuration.performance.name_temp, BANK_NAME_LEN - 1, true); // } } } @@ -8529,10 +5808,10 @@ void UI_func_set_performance_name(uint8_t param) if (mode == 1) { - ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, false); + ui_select_name_state = UI_select_name(1, 1, configuration.performance.name_temp, BANK_NAME_LEN - 1, false); if (ui_select_name_state == true) { - strcpy( seq.name, seq.name_temp); + strcpy(configuration.performance.name, configuration.performance.name_temp); mode = 0xff; display.noBlink(); display.setCursor(0, 1); @@ -8545,10 +5824,10 @@ void UI_func_set_performance_name(uint8_t param) if (mode == 0 ) { mode = 1; - strcpy(seq.name_temp, seq.name); + strcpy(configuration.performance.name_temp, configuration.performance.name); display.setCursor(0, 1); display.print(F("[ ] ")); - ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, true); + ui_select_name_state = UI_select_name(1, 1, configuration.performance.name_temp, BANK_NAME_LEN - 1, true); display.blink(); } } @@ -9747,7 +7026,7 @@ void lcd_special_chars(uint8_t mode) void lcd_display_delay_sync(uint8_t sync) { display.show(0, 0, LCD_cols - 2, "Delay Sync"); - if (seq.running == false)display.show(1, 0, 10, "MIDI Sync "); else display.show(1, 0, 10, "Seq. Sync "); + display.show(1, 0, 10, "MIDI Sync "); switch (sync) { case 1: @@ -9778,24 +7057,18 @@ void lcd_display_delay_sync(uint8_t sync) display.show(1, 10, 6, "1/1"); break; } - if (seq.running == false) { - uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[sync] / midi_bpm + 0.5); - if (midi_sync_delay_time > DELAY_MAX_TIME) - { + uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[sync] / midi_bpm + 0.5); + if (midi_sync_delay_time > DELAY_MAX_TIME) + { #ifdef DEBUG - Serial.println(F("Calculated MIDI-Sync delay: ")); - Serial.print(round(60000.0 * midi_ticks_factor[sync] / midi_bpm), DEC); - Serial.println(F("ms")); - Serial.println(F("MIDI-Sync delay: midi_sync_delay_time")); - Serial.print(midi_sync_delay_time, DEC); - Serial.println(F("ms")); + Serial.println(F("Calculated MIDI-Sync delay: ")); + Serial.print(round(60000.0 * midi_ticks_factor[sync] / midi_bpm), DEC); + Serial.println(F("ms")); + Serial.println(F("MIDI-Sync delay: midi_sync_delay_time")); + Serial.print(midi_sync_delay_time, DEC); + Serial.println(F("ms")); #endif - } - } else - { - uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[sync] / seq.bpm); - delay_fx[selected_instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); } display.show(1, 15, 1, "!"); } diff --git a/UI_FX_T4.h b/UI_FX_T4.h index 600521f..50f1f16 100644 --- a/UI_FX_T4.h +++ b/UI_FX_T4.h @@ -96,86 +96,67 @@ LCDML_add(61, LCDML_0_2, 4, "Drum Rev.Send", UI_func_drum_reverb_send); LCDML_add(62, LCDML_0_2, 5, "Drum Pitch", UI_func_drum_pitch); LCDML_add(63, LCDML_0_2, 6, "Drum Tune", UI_func_drum_tune_offset); LCDML_add(64, LCDML_0_2, 7, "MIDI Channel", UI_func_drum_midi_channel); -LCDML_add(65, LCDML_0_2, 8, "Smart Filter", UI_func_smart_filter); -LCDML_add(66, LCDML_0_2, 9, "Cust.DrumMap", UI_func_custom_mappings); -LCDML_add(67, LCDML_0, 3, "E-Piano", NULL); -LCDML_add(68, LCDML_0_3, 1, "Voice Level", UI_func_epiano_sound_intensity); -LCDML_add(69, LCDML_0_3, 2, "Panorama", UI_func_epiano_panorama); -LCDML_add(70, LCDML_0_3, 3, "Sound", NULL); -LCDML_add(71, LCDML_0_3_3, 1, "Decay", UI_func_epiano_decay); // uint8_t decay; -LCDML_add(72, LCDML_0_3_3, 2, "Release", UI_func_epiano_release); // uint8_t release; -LCDML_add(73, LCDML_0_3_3, 3, "Hardness", UI_func_epiano_hardness); // uint8_t hardness; -LCDML_add(74, LCDML_0_3_3, 4, "Treble", UI_func_epiano_treble); // uint8_t treble; -LCDML_add(75, LCDML_0_3_3, 5, "Stereo", UI_func_epiano_stereo); // uint8_t stereo; -LCDML_add(76, LCDML_0_3_3, 6, "Tune", UI_func_epiano_tune); // uint8_t tune; -LCDML_add(77, LCDML_0_3_3, 7, "Detune", UI_func_epiano_detune); // uint8_t detune; -LCDML_add(78, LCDML_0_3, 4, "Effects", NULL); -LCDML_add(79, LCDML_0_3_4, 1, "Overdrive", UI_func_epiano_overdrive); // uint8_t overdrive; -LCDML_add(80, LCDML_0_3_4, 2, "Tremolo", NULL); -LCDML_add(81, LCDML_0_3_4_2, 1, "Width", UI_func_epiano_pan_tremolo); // uint8_t pan_tremolo; -LCDML_add(82, LCDML_0_3_4_2, 2, "LFO", UI_func_epiano_pan_lfo); // uint8_t pan_lfo; -LCDML_add(83, LCDML_0_3_4, 3, "Chorus", NULL); -LCDML_add(84, LCDML_0_3_4_3, 1, "Frequency", UI_func_epiano_chorus_frequency); -LCDML_add(85, LCDML_0_3_4_3, 2, "Waveform", UI_func_epiano_chorus_waveform); -LCDML_add(86, LCDML_0_3_4_3, 3, "Depth", UI_func_epiano_chorus_depth); -LCDML_add(87, LCDML_0_3_4_3, 4, "Level", UI_func_epiano_chorus_level); -LCDML_add(88, LCDML_0_3_4, 4, "Reverb Send", UI_func_epiano_reverb_send); -LCDML_add(89, LCDML_0_3, 6, "MIDI", NULL); -LCDML_add(90, LCDML_0_3_6, 1, "MIDI Channel", UI_func_epiano_midi_channel); // uint8_t midi_channel; -LCDML_add(91, LCDML_0_3_6, 2, "Lowest Note", UI_func_epiano_lowest_note); // uint8_t lowest_note; -LCDML_add(92, LCDML_0_3_6, 3, "Highest Note", UI_func_epiano_highest_note); // uint8_t highest_note; -LCDML_add(93, LCDML_0_3, 7, "Setup", NULL); -LCDML_add(94, LCDML_0_3_7, 4, "Transpose", UI_func_epiano_transpose); // uint8_t transpose; -LCDML_add(95, LCDML_0_3_7, 1, "Polyphony", UI_func_epiano_polyphony); // uint8_t polyphony; -LCDML_add(96, LCDML_0_3_7, 2, "Vel. Sense", UI_func_epiano_velocity_sense); // uint8_t velocity_sense; -LCDML_add(97, LCDML_0, 4, "Master Effects", NULL); -LCDML_add(98, LCDML_0_4, 1, "Reverb", NULL); -LCDML_add(99, LCDML_0_4_1, 1, "Roomsize", UI_func_reverb_roomsize); -LCDML_add(100, LCDML_0_4_1, 2, "Lowpass", UI_func_reverb_lowpass); -LCDML_add(101, LCDML_0_4_1, 3, "Lodamp", UI_func_reverb_lodamp); -LCDML_add(102, LCDML_0_4_1, 4, "Hidamp", UI_func_reverb_hidamp); -LCDML_add(103, LCDML_0_4_1, 5, "Diffusion", UI_func_reverb_diffusion); -LCDML_add(104, LCDML_0_4_1, 6, "Level", UI_func_reverb_level); -LCDML_add(105, LCDML_0_4_1, 7, "Reverb Send", UI_func_reverb_send); -LCDML_add(106, LCDML_0_4, 2, "EQ", NULL); -LCDML_add(107, LCDML_0_4_2, 1, "Low-Cut", UI_func_eq_1); -LCDML_add(108, LCDML_0_4_2, 2, "110Hz", UI_func_eq_2); -LCDML_add(109, LCDML_0_4_2, 3, "220Hz", UI_func_eq_3); -LCDML_add(110, LCDML_0_4_2, 4, "1000Hz", UI_func_eq_4); -LCDML_add(111, LCDML_0_4_2, 5, "2000Hz", UI_func_eq_5); -LCDML_add(112, LCDML_0_4_2, 6, "7000Hz", UI_func_eq_6); -LCDML_add(113, LCDML_0_4_2, 7, "High-Cut", UI_func_eq_7) -LCDML_add(114, LCDML_0, 5, "Sequencer", NULL); -LCDML_add(115, LCDML_0_5, 1, "Pattern Editor", UI_func_seq_pattern_editor); -LCDML_add(116, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); -LCDML_add(117, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); -LCDML_add(118, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio); -LCDML_add(119, LCDML_0_5, 5, "Mute Matrix", UI_func_seq_mute_matrix); -LCDML_add(120, LCDML_0_5, 6, "Seq. Settings", NULL); -LCDML_add(121, LCDML_0_5_6, 1, "Tempo", UI_func_seq_tempo); -LCDML_add(122, LCDML_0_5_6, 2, "Seq. Length", UI_func_seq_lenght); -LCDML_add(123, LCDML_0_5_6, 3, "Track Setup", UI_func_seq_track_setup); -LCDML_add(124, LCDML_0_5_6, 4, "Seq.Disp.Style", UI_func_seq_display_style); -LCDML_add(125, LCDML_0_5_6, 5, "Dexed Assign", UI_func_dexed_assign); -LCDML_add(126, LCDML_0_5_6, 6, "Shift&Transp.", UI_func_arp_shift); -LCDML_add(127, LCDML_0_5_6, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct); -LCDML_add(128, LCDML_0_5_6, 8, "ChordTrack Keys", UI_func_seq_chord_keys_ammount); -LCDML_add(129, LCDML_0_5_6, 9, "Smart Filter", UI_func_smart_filter); -LCDML_add(130, LCDML_0, 6, "Load/Save", NULL); -LCDML_add(131, LCDML_0_6, 1, "Load Perf.", UI_func_load_performance); -LCDML_add(132, LCDML_0_6, 2, "Save Perf.", UI_func_save_performance); -LCDML_add(133, LCDML_0_6, 3, "Name Perf.", UI_func_set_performance_name); -LCDML_add(134, LCDML_0_6, 4, "MIDI", NULL); -LCDML_add(135, LCDML_0_6_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); -LCDML_add(136, LCDML_0_6_4, 2, "MIDI Snd Bank", UI_func_sysex_send_bank); -LCDML_add(137, LCDML_0_6_4, 3, "MIDI Snd Voice", UI_func_sysex_send_voice); -LCDML_add(138, LCDML_0, 7, "System", NULL); -LCDML_add(139, LCDML_0_7, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(140, LCDML_0_7, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(141, LCDML_0_7, 3, "Cust. CC Map", UI_func_cc_mappings); -LCDML_add(142, LCDML_0_7, 4, "Favorites", UI_func_favorites); -LCDML_add(143, LCDML_0_7, 5, "Startup", UI_func_startup); -LCDML_add(144, LCDML_0, 8, "Info", UI_func_information); -LCDML_addAdvanced(145, LCDML_0, 9, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); -#define _LCDML_DISP_cnt 145 +LCDML_add(65, LCDML_0, 3, "E-Piano", NULL); +LCDML_add(66, LCDML_0_3, 1, "Voice Level", UI_func_epiano_sound_intensity); +LCDML_add(67, LCDML_0_3, 2, "Panorama", UI_func_epiano_panorama); +LCDML_add(68, LCDML_0_3, 3, "Sound", NULL); +LCDML_add(69, LCDML_0_3_3, 1, "Decay", UI_func_epiano_decay); // uint8_t decay; +LCDML_add(70, LCDML_0_3_3, 2, "Release", UI_func_epiano_release); // uint8_t release; +LCDML_add(71, LCDML_0_3_3, 3, "Hardness", UI_func_epiano_hardness); // uint8_t hardness; +LCDML_add(72, LCDML_0_3_3, 4, "Treble", UI_func_epiano_treble); // uint8_t treble; +LCDML_add(73, LCDML_0_3_3, 5, "Stereo", UI_func_epiano_stereo); // uint8_t stereo; +LCDML_add(74, LCDML_0_3_3, 6, "Tune", UI_func_epiano_tune); // uint8_t tune; +LCDML_add(75, LCDML_0_3_3, 7, "Detune", UI_func_epiano_detune); // uint8_t detune; +LCDML_add(76, LCDML_0_3, 4, "Effects", NULL); +LCDML_add(77, LCDML_0_3_4, 1, "Overdrive", UI_func_epiano_overdrive); // uint8_t overdrive; +LCDML_add(78, LCDML_0_3_4, 2, "Tremolo", NULL); +LCDML_add(79, LCDML_0_3_4_2, 1, "Width", UI_func_epiano_pan_tremolo); // uint8_t pan_tremolo; +LCDML_add(80, LCDML_0_3_4_2, 2, "LFO", UI_func_epiano_pan_lfo); // uint8_t pan_lfo; +LCDML_add(81, LCDML_0_3_4, 3, "Chorus", NULL); +LCDML_add(82, LCDML_0_3_4_3, 1, "Frequency", UI_func_epiano_chorus_frequency); +LCDML_add(83, LCDML_0_3_4_3, 2, "Waveform", UI_func_epiano_chorus_waveform); +LCDML_add(84, LCDML_0_3_4_3, 3, "Depth", UI_func_epiano_chorus_depth); +LCDML_add(85, LCDML_0_3_4_3, 4, "Level", UI_func_epiano_chorus_level); +LCDML_add(86, LCDML_0_3_4, 4, "Reverb Send", UI_func_epiano_reverb_send); +LCDML_add(87, LCDML_0_3, 6, "MIDI", NULL); +LCDML_add(88, LCDML_0_3_6, 1, "MIDI Channel", UI_func_epiano_midi_channel); // uint8_t midi_channel; +LCDML_add(89, LCDML_0_3_6, 2, "Lowest Note", UI_func_epiano_lowest_note); // uint8_t lowest_note; +LCDML_add(90, LCDML_0_3_6, 3, "Highest Note", UI_func_epiano_highest_note); // uint8_t highest_note; +LCDML_add(91, LCDML_0_3, 7, "Setup", NULL); +LCDML_add(92, LCDML_0_3_7, 4, "Transpose", UI_func_epiano_transpose); // uint8_t transpose; +LCDML_add(93, LCDML_0_3_7, 1, "Polyphony", UI_func_epiano_polyphony); // uint8_t polyphony; +LCDML_add(94, LCDML_0_3_7, 2, "Vel. Sense", UI_func_epiano_velocity_sense); // uint8_t velocity_sense; +LCDML_add(95, LCDML_0, 4, "Master Effects", NULL); +LCDML_add(96, LCDML_0_4, 1, "Reverb", NULL); +LCDML_add(97, LCDML_0_4_1, 1, "Roomsize", UI_func_reverb_roomsize); +LCDML_add(98, LCDML_0_4_1, 2, "Lowpass", UI_func_reverb_lowpass); +LCDML_add(99, LCDML_0_4_1, 3, "Lodamp", UI_func_reverb_lodamp); +LCDML_add(100, LCDML_0_4_1, 4, "Hidamp", UI_func_reverb_hidamp); +LCDML_add(101, LCDML_0_4_1, 5, "Diffusion", UI_func_reverb_diffusion); +LCDML_add(102, LCDML_0_4_1, 6, "Level", UI_func_reverb_level); +LCDML_add(103, LCDML_0_4_1, 7, "Reverb Send", UI_func_reverb_send); +LCDML_add(104, LCDML_0_4, 2, "EQ", NULL); +LCDML_add(105, LCDML_0_4_2, 1, "Low-Cut", UI_func_eq_1); +LCDML_add(106, LCDML_0_4_2, 2, "110Hz", UI_func_eq_2); +LCDML_add(107, LCDML_0_4_2, 3, "220Hz", UI_func_eq_3); +LCDML_add(108, LCDML_0_4_2, 4, "1000Hz", UI_func_eq_4); +LCDML_add(109, LCDML_0_4_2, 5, "2000Hz", UI_func_eq_5); +LCDML_add(110, LCDML_0_4_2, 6, "7000Hz", UI_func_eq_6); +LCDML_add(111, LCDML_0_4_2, 7, "High-Cut", UI_func_eq_7) +LCDML_add(112, LCDML_0, 5, "Load/Save", NULL); +LCDML_add(113, LCDML_0_5, 1, "Load Perf.", UI_func_load_performance); +LCDML_add(114, LCDML_0_5, 2, "Save Perf.", UI_func_save_performance); +LCDML_add(115, LCDML_0_5, 3, "Name Perf.", UI_func_set_performance_name); +LCDML_add(116, LCDML_0_5, 4, "MIDI", NULL); +LCDML_add(117, LCDML_0_5_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); +LCDML_add(118, LCDML_0_5_4, 2, "MIDI Snd Bank", UI_func_sysex_send_bank); +LCDML_add(119, LCDML_0_5_4, 3, "MIDI Snd Voice", UI_func_sysex_send_voice); +LCDML_add(120, LCDML_0, 6, "System", NULL); +LCDML_add(121, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(122, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(123, LCDML_0_6, 3, "Favorites", UI_func_favorites); +LCDML_add(124, LCDML_0_6, 4, "Startup", UI_func_startup); +LCDML_add(125, LCDML_0, 7, "Info", UI_func_information); +LCDML_addAdvanced(126, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); +#define _LCDML_DISP_cnt 126 #endif diff --git a/addon/SD/PERFORMANCE/0/patterns.json b/addon/SD/PERFORMANCE/0/patterns.json deleted file mode 100755 index 141eb18..0000000 --- a/addon/SD/PERFORMANCE/0/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 72, - 0, - 0, - 73, - 72, - 0, - 0, - 0, - 72, - 0, - 74, - 74, - 72, - 0, - 0, - 0, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 72, - 87, - 87, - 92, - 72, - 90, - 90, - 90, - 72, - 0, - 0, - 75, - 72, - 95, - 95, - 95, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 77, - 0, - 0, - 55, - 0, - 0, - 0, - 0, - 0, - 52, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 57, - 0, - 0, - 0, - 0, - 0, - 53, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 74, - 0, - 0, - 72, - 0, - 0, - 74, - 0, - 0, - 0, - 76, - 130, - 130, - 130, - 130, - 0, - 74, - 0, - 0, - 72, - 0, - 0, - 71, - 0, - 0, - 0, - 67, - 130, - 0, - 0, - 0, - 0, - 69, - 0, - 0, - 76, - 0, - 0, - 69, - 130, - 130, - 130, - 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, - 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, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/0/sequencer.json b/addon/SD/PERFORMANCE/0/sequencer.json deleted file mode 100755 index 387b2c4..0000000 --- a/addon/SD/PERFORMANCE/0/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 1, - 6, - 9, - 3, - 3, - 0, - 1, - 5, - 8, - 3, - 3, - 0, - 1, - 6, - 9, - 3, - 3, - 2, - 1, - 5, - 7, - 3, - 3 - ], - "seq_tempo_ms": 147058, - "seq_bpm": 102, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 8, - "arp_style": 0, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 3, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": 0, - "seq_element_shift": 0, - "track_type": [ - 0, - 0, - 3, - 1, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 0, - 2, - 2, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 1, - 1, - 0, - 0 - ], - "seq_name": [ - 65, - 108, - 108, - 79, - 110, - 66, - 111, - 97, - 114, - 100, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/0/velocity.json b/addon/SD/PERFORMANCE/0/velocity.json deleted file mode 100755 index 5d72cc4..0000000 --- a/addon/SD/PERFORMANCE/0/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 120, - 120, - 120, - 120, - 120, - 0, - 0, - 0, - 120, - 0, - 120, - 120, - 120, - 0, - 0, - 0, - 105, - 80, - 105, - 70, - 106, - 98, - 106, - 70, - 126, - 97, - 106, - 70, - 106, - 99, - 90, - 65, - 120, - 120, - 120, - 120, - 120, - 86, - 106, - 99, - 120, - 0, - 120, - 80, - 120, - 79, - 95, - 109, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 10, - 30, - 50, - 70, - 90, - 100, - 127, - 100, - 60, - 40, - 30, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/1/patterns.json b/addon/SD/PERFORMANCE/1/patterns.json deleted file mode 100755 index 97392ab..0000000 --- a/addon/SD/PERFORMANCE/1/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 72, - 0, - 0, - 92, - 72, - 0, - 0, - 0, - 72, - 90, - 90, - 90, - 72, - 0, - 0, - 0, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 72, - 0, - 0, - 92, - 72, - 90, - 90, - 90, - 72, - 0, - 0, - 75, - 72, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 77, - 77, - 0, - 77, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 79, - 79, - 0, - 79, - 0, - 0, - 0, - 0, - 0, - 0, - 55, - 0, - 0, - 0, - 0, - 0, - 52, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 57, - 0, - 0, - 0, - 0, - 0, - 53, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 74, - 0, - 0, - 72, - 0, - 0, - 74, - 0, - 0, - 0, - 76, - 0, - 0, - 0, - 0, - 0, - 74, - 0, - 0, - 72, - 0, - 0, - 71, - 0, - 0, - 0, - 67, - 0, - 0, - 0, - 0, - 0, - 69, - 0, - 0, - 76, - 0, - 0, - 69, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 68, - 68, - 0, - 68, - 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, - 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, - 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, - 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, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/1/sequencer.json b/addon/SD/PERFORMANCE/1/sequencer.json deleted file mode 100755 index a6c89b3..0000000 --- a/addon/SD/PERFORMANCE/1/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 1, - 6, - 9, - 3, - 16, - 0, - 1, - 5, - 8, - 4, - 15, - 0, - 1, - 6, - 9, - 10, - 17, - 2, - 1, - 5, - 7, - 4, - 15 - ], - "seq_tempo_ms": 145631, - "seq_bpm": 103, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 9, - "arp_style": 0, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 3, - "seq_transpose": 0, - "chord_key_ammount": 6, - "seq_oct_shift": -1, - "seq_element_shift": 3, - "track_type": [ - 0, - 0, - 2, - 1, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 1, - 1, - 0, - 0 - ], - "seq_name": [ - 67, - 108, - 101, - 97, - 114, - 67, - 111, - 97, - 115, - 116, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/1/velocity.json b/addon/SD/PERFORMANCE/1/velocity.json deleted file mode 100755 index c2ee54e..0000000 --- a/addon/SD/PERFORMANCE/1/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 120, - 0, - 0, - 120, - 120, - 0, - 0, - 0, - 120, - 90, - 100, - 84, - 120, - 0, - 0, - 0, - 105, - 80, - 105, - 70, - 106, - 98, - 106, - 70, - 126, - 97, - 106, - 70, - 106, - 99, - 90, - 65, - 120, - 0, - 0, - 120, - 120, - 83, - 106, - 79, - 120, - 0, - 120, - 91, - 120, - 120, - 120, - 120, - 0, - 0, - 0, - 0, - 0, - 0, - 210, - 210, - 0, - 210, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 210, - 210, - 0, - 210, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 210, - 210, - 0, - 210, - 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, - 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, - 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, - 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, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/2/patterns.json b/addon/SD/PERFORMANCE/2/patterns.json deleted file mode 100755 index 3937c39..0000000 --- a/addon/SD/PERFORMANCE/2/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 72, - 0, - 76, - 0, - 72, - 72, - 76, - 0, - 72, - 0, - 76, - 0, - 72, - 72, - 76, - 0, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 72, - 0, - 76, - 0, - 72, - 72, - 76, - 0, - 72, - 0, - 76, - 0, - 72, - 75, - 76, - 75, - 50, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 55, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 52, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 57, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 38, - 0, - 0, - 48, - 0, - 0, - 45, - 0, - 74, - 71, - 0, - 69, - 0, - 0, - 67, - 0, - 74, - 71, - 0, - 69, - 0, - 0, - 67, - 69, - 69, - 0, - 0, - 0, - 69, - 0, - 0, - 67, - 69, - 71, - 0, - 64, - 0, - 0, - 67, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 62, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 67, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 64, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 69, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/2/sequencer.json b/addon/SD/PERFORMANCE/2/sequencer.json deleted file mode 100755 index 9dfdc85..0000000 --- a/addon/SD/PERFORMANCE/2/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 1, - 6, - 9, - 16, - 99, - 0, - 1, - 5, - 9, - 15, - 99, - 0, - 1, - 4, - 8, - 14, - 99, - 2, - 1, - 3, - 7, - 13, - 99 - ], - "seq_tempo_ms": 180722, - "seq_bpm": 83, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 5, - "arp_style": 2, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 3, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": -1, - "seq_element_shift": 3, - "track_type": [ - 0, - 0, - 3, - 1, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 2, - 2, - 2, - 2, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 0, - 1, - 0, - 0 - ], - "seq_name": [ - 66, - 108, - 105, - 110, - 100, - 105, - 110, - 103, - 68, - 88, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/2/velocity.json b/addon/SD/PERFORMANCE/2/velocity.json deleted file mode 100755 index 97977bb..0000000 --- a/addon/SD/PERFORMANCE/2/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 108, - 0, - 127, - 120, - 98, - 114, - 125, - 120, - 108, - 0, - 127, - 0, - 90, - 106, - 115, - 120, - 127, - 127, - 124, - 116, - 124, - 127, - 125, - 120, - 125, - 127, - 123, - 124, - 125, - 127, - 123, - 100, - 109, - 0, - 127, - 120, - 92, - 103, - 125, - 120, - 103, - 0, - 126, - 0, - 106, - 119, - 127, - 119, - 200, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 200, - 200, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 200, - 201, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 200, - 201, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 120, - 0, - 0, - 120, - 0, - 0, - 120, - 0, - 107, - 126, - 0, - 124, - 0, - 0, - 123, - 0, - 96, - 127, - 0, - 110, - 0, - 0, - 115, - 120, - 127, - 0, - 0, - 0, - 127, - 0, - 0, - 113, - 125, - 125, - 0, - 105, - 0, - 0, - 125, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 120, - 215, - 0, - 0, - 0, - 0, - 0, - 210, - 120, - 0, - 0, - 0, - 0, - 0, - 0, - 200, - 120, - 215, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 200, - 120, - 215, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 200, - 120, - 215, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/3/patterns.json b/addon/SD/PERFORMANCE/3/patterns.json deleted file mode 100755 index 4cf3846..0000000 --- a/addon/SD/PERFORMANCE/3/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 72, - 72, - 0, - 72, - 78, - 0, - 0, - 72, - 0, - 0, - 72, - 0, - 78, - 0, - 78, - 78, - 78, - 78, - 78, - 78, - 46, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 46, - 78, - 0, - 0, - 78, - 78, - 78, - 78, - 46, - 78, - 78, - 78, - 78, - 78, - 78, - 78, - 46, - 78, - 46, - 46, - 73, - 0, - 0, - 73, - 0, - 0, - 73, - 0, - 0, - 0, - 73, - 73, - 73, - 0, - 0, - 0, - 73, - 0, - 0, - 73, - 0, - 0, - 73, - 0, - 0, - 0, - 73, - 0, - 0, - 73, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 40, - 40, - 0, - 40, - 0, - 0, - 40, - 43, - 0, - 43, - 0, - 43, - 45, - 47, - 0, - 40, - 0, - 0, - 0, - 40, - 0, - 0, - 0, - 43, - 0, - 0, - 45, - 0, - 0, - 40, - 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, - 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, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/3/sequencer.json b/addon/SD/PERFORMANCE/3/sequencer.json deleted file mode 100755 index 26deb0f..0000000 --- a/addon/SD/PERFORMANCE/3/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 1, - 3, - 9, - 5, - 5, - 0, - 2, - 4, - 8, - 5, - 5, - 0, - 1, - 4, - 8, - 5, - 5, - 2, - 1, - 3, - 7, - 5, - 5 - ], - "seq_tempo_ms": 133928, - "seq_bpm": 112, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 5, - "arp_style": 2, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 1, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": -1, - "seq_element_shift": 3, - "track_type": [ - 0, - 0, - 0, - 1, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_name": [ - 110, - 105, - 110, - 101, - 116, - 101, - 101, - 110, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/3/velocity.json b/addon/SD/PERFORMANCE/3/velocity.json deleted file mode 100755 index 4a4613b..0000000 --- a/addon/SD/PERFORMANCE/3/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 120, - 120, - 0, - 120, - 120, - 0, - 0, - 120, - 0, - 0, - 120, - 0, - 120, - 0, - 120, - 102, - 120, - 105, - 120, - 102, - 120, - 104, - 120, - 106, - 120, - 109, - 120, - 103, - 120, - 108, - 120, - 120, - 120, - 99, - 120, - 106, - 120, - 113, - 113, - 105, - 120, - 108, - 120, - 110, - 120, - 109, - 120, - 120, - 120, - 0, - 0, - 120, - 0, - 0, - 120, - 0, - 0, - 0, - 120, - 120, - 120, - 0, - 0, - 0, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 127, - 127, - 0, - 120, - 0, - 0, - 120, - 127, - 0, - 125, - 0, - 127, - 127, - 124, - 0, - 127, - 0, - 0, - 0, - 124, - 0, - 0, - 0, - 115, - 0, - 0, - 127, - 0, - 0, - 122, - 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, - 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, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/4/patterns.json b/addon/SD/PERFORMANCE/4/patterns.json deleted file mode 100755 index 8e94b57..0000000 --- a/addon/SD/PERFORMANCE/4/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 0, - 92, - 78, - 0, - 0, - 0, - 78, - 0, - 78, - 0, - 78, - 97, - 97, - 78, - 73, - 73, - 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, - 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, - 55, - 0, - 0, - 0, - 0, - 0, - 52, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 57, - 0, - 0, - 0, - 0, - 0, - 53, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 74, - 130, - 130, - 72, - 130, - 130, - 74, - 130, - 130, - 0, - 76, - 130, - 130, - 130, - 130, - 0, - 74, - 130, - 130, - 72, - 130, - 130, - 71, - 130, - 130, - 0, - 67, - 130, - 130, - 130, - 130, - 0, - 69, - 130, - 130, - 76, - 130, - 130, - 69, - 130, - 130, - 130, - 130, - 130, - 130, - 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, - 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, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/4/sequencer.json b/addon/SD/PERFORMANCE/4/sequencer.json deleted file mode 100755 index f78f768..0000000 --- a/addon/SD/PERFORMANCE/4/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 1, - 6, - 9, - 3, - 3, - 0, - 1, - 5, - 8, - 3, - 3, - 0, - 1, - 6, - 9, - 3, - 3, - 0, - 1, - 5, - 7, - 3, - 3 - ], - "seq_tempo_ms": 154639, - "seq_bpm": 97, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 7, - "arp_style": 1, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 3, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": 0, - "seq_element_shift": 0, - "track_type": [ - 0, - 0, - 3, - 1, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 0, - 2, - 2, - 2, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 0, - 1, - 0, - 0 - ], - "seq_name": [ - 77, - 117, - 116, - 101, - 100, - 83, - 116, - 111, - 114, - 109, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/4/velocity.json b/addon/SD/PERFORMANCE/4/velocity.json deleted file mode 100755 index 9825d98..0000000 --- a/addon/SD/PERFORMANCE/4/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 120, - 119, - 120, - 120, - 120, - 0, - 125, - 0, - 113, - 0, - 120, - 120, - 120, - 120, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 201, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 200, - 201, - 200, - 200, - 200, - 200, - 200, - 200, - 200, - 200, - 200, - 200, - 0, - 0, - 0, - 0, - 0, - 98, - 120, - 0, - 88, - 120, - 0, - 108, - 120, - 0, - 0, - 107, - 120, - 0, - 0, - 0, - 0, - 111, - 120, - 0, - 103, - 0, - 0, - 100, - 120, - 0, - 0, - 99, - 120, - 0, - 0, - 0, - 0, - 115, - 120, - 0, - 105, - 120, - 0, - 93, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/5/patterns.json b/addon/SD/PERFORMANCE/5/patterns.json deleted file mode 100755 index 37db3eb..0000000 --- a/addon/SD/PERFORMANCE/5/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 48, - 47, - 0, - 49, - 48, - 0, - 0, - 47, - 74, - 48, - 50, - 51, - 50, - 59, - 0, - 51, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 54, - 63, - 0, - 0, - 0, - 50, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 50, - 0, - 66, - 0, - 0, - 0, - 0, - 49, - 49, - 49, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/5/sequencer.json b/addon/SD/PERFORMANCE/5/sequencer.json deleted file mode 100755 index a70ae9b..0000000 --- a/addon/SD/PERFORMANCE/5/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 1, - 3, - 9, - 5, - 5, - 0, - 2, - 4, - 8, - 5, - 5, - 0, - 1, - 4, - 8, - 5, - 5, - 2, - 1, - 3, - 7, - 5, - 5 - ], - "seq_tempo_ms": 145631, - "seq_bpm": 103, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 5, - "arp_style": 2, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 1, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": -1, - "seq_element_shift": 3, - "track_type": [ - 0, - 0, - 0, - 1, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_name": [ - 68, - 114, - 68, - 114, - 117, - 109, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/5/velocity.json b/addon/SD/PERFORMANCE/5/velocity.json deleted file mode 100755 index 57026f6..0000000 --- a/addon/SD/PERFORMANCE/5/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 125, - 120, - 0, - 127, - 125, - 0, - 0, - 120, - 120, - 120, - 80, - 120, - 120, - 120, - 120, - 120, - 127, - 127, - 127, - 103, - 127, - 103, - 125, - 98, - 127, - 101, - 127, - 102, - 127, - 103, - 104, - 113, - 127, - 123, - 127, - 105, - 110, - 107, - 127, - 110, - 126, - 113, - 126, - 113, - 126, - 116, - 126, - 116, - 127, - 0, - 0, - 0, - 126, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 120, - 0, - 0, - 0, - 120, - 0, - 0, - 0, - 126, - 0, - 125, - 0, - 0, - 0, - 120, - 120, - 120, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/6/patterns.json b/addon/SD/PERFORMANCE/6/patterns.json deleted file mode 100755 index ee619b4..0000000 --- a/addon/SD/PERFORMANCE/6/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 69, - 69, - 0, - 69, - 69, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 67, - 67, - 0, - 67, - 67, - 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, - 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, - 55, - 0, - 0, - 0, - 0, - 0, - 52, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 57, - 0, - 0, - 0, - 0, - 0, - 53, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 74, - 0, - 0, - 72, - 0, - 0, - 74, - 0, - 0, - 0, - 76, - 0, - 0, - 0, - 0, - 0, - 74, - 0, - 0, - 72, - 0, - 0, - 71, - 0, - 0, - 0, - 67, - 0, - 0, - 0, - 0, - 0, - 69, - 0, - 0, - 76, - 0, - 0, - 69, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/6/sequencer.json b/addon/SD/PERFORMANCE/6/sequencer.json deleted file mode 100755 index ced5d7f..0000000 --- a/addon/SD/PERFORMANCE/6/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 2, - 6, - 9, - 3, - 3, - 1, - 2, - 5, - 8, - 3, - 3, - 0, - 2, - 6, - 9, - 3, - 3, - 1, - 2, - 5, - 7, - 3, - 3 - ], - "seq_tempo_ms": 156250, - "seq_bpm": 96, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 8, - "arp_style": 0, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 3, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": 0, - "seq_element_shift": 0, - "track_type": [ - 0, - 0, - 0, - 0, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 1, - 1, - 0, - 0 - ], - "seq_name": [ - 70, - 97, - 105, - 114, - 108, - 105, - 103, - 104, - 116, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/6/velocity.json b/addon/SD/PERFORMANCE/6/velocity.json deleted file mode 100755 index cfe3c9f..0000000 --- a/addon/SD/PERFORMANCE/6/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 210, - 210, - 0, - 210, - 210, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 210, - 210, - 0, - 210, - 210, - 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, - 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, - 213, - 0, - 0, - 0, - 0, - 0, - 213, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 213, - 0, - 0, - 0, - 0, - 0, - 213, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 211, - 0, - 0, - 211, - 0, - 0, - 211, - 0, - 0, - 0, - 211, - 0, - 0, - 0, - 0, - 0, - 211, - 0, - 0, - 211, - 0, - 0, - 211, - 0, - 0, - 0, - 211, - 0, - 0, - 0, - 0, - 0, - 211, - 0, - 0, - 211, - 0, - 0, - 211, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/7/patterns.json b/addon/SD/PERFORMANCE/7/patterns.json deleted file mode 100755 index 0f55b65..0000000 --- a/addon/SD/PERFORMANCE/7/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 81, - 81, - 0, - 81, - 81, - 0, - 81, - 81, - 81, - 81, - 0, - 81, - 81, - 0, - 81, - 81, - 77, - 0, - 0, - 0, - 77, - 0, - 0, - 0, - 77, - 0, - 0, - 0, - 77, - 0, - 0, - 0, - 78, - 0, - 93, - 0, - 76, - 0, - 93, - 0, - 78, - 0, - 93, - 0, - 76, - 0, - 93, - 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, - 77, - 77, - 0, - 77, - 77, - 0, - 77, - 77, - 77, - 77, - 0, - 77, - 77, - 0, - 77, - 77, - 79, - 79, - 0, - 79, - 79, - 0, - 79, - 79, - 79, - 79, - 0, - 79, - 79, - 0, - 79, - 79, - 76, - 76, - 0, - 76, - 76, - 0, - 76, - 76, - 76, - 76, - 0, - 76, - 76, - 0, - 76, - 76, - 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, - 77, - 0, - 74, - 0, - 72, - 72, - 74, - 77, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 77, - 0, - 74, - 0, - 72, - 72, - 74, - 77, - 0, - 0, - 0, - 0, - 79, - 0, - 0, - 0, - 77, - 0, - 74, - 0, - 72, - 72, - 74, - 77, - 0, - 74, - 0, - 74, - 72, - 0, - 74, - 0, - 69, - 0, - 0, - 69, - 0, - 0, - 69, - 0, - 72, - 0, - 67, - 69, - 0, - 0, - 76, - 81, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/7/sequencer.json b/addon/SD/PERFORMANCE/7/sequencer.json deleted file mode 100755 index 427cb19..0000000 --- a/addon/SD/PERFORMANCE/7/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 1, - 2, - 10, - 17, - 19, - 5, - 1, - 2, - 11, - 17, - 17, - 6, - 1, - 2, - 12, - 18, - 20, - 7, - 1, - 2, - 13, - 19, - 16 - ], - "seq_tempo_ms": 150000, - "seq_bpm": 100, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 8, - "arp_style": 0, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 3, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": 0, - "seq_element_shift": 0, - "track_type": [ - 0, - 0, - 0, - 1, - 0, - 0 - ], - "content_type": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 1, - 0, - 0, - 0 - ], - "seq_name": [ - 74, - 97, - 112, - 97, - 110, - 45, - 66, - 73, - 71, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/7/velocity.json b/addon/SD/PERFORMANCE/7/velocity.json deleted file mode 100755 index de3002c..0000000 --- a/addon/SD/PERFORMANCE/7/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 210, - 210, - 0, - 210, - 210, - 120, - 210, - 210, - 210, - 210, - 120, - 210, - 210, - 0, - 210, - 210, - 120, - 0, - 0, - 0, - 106, - 0, - 0, - 0, - 120, - 0, - 0, - 0, - 107, - 0, - 0, - 0, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 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, - 210, - 210, - 0, - 210, - 210, - 120, - 210, - 210, - 210, - 210, - 120, - 210, - 210, - 0, - 210, - 210, - 210, - 210, - 0, - 210, - 210, - 120, - 210, - 210, - 210, - 210, - 120, - 210, - 210, - 0, - 210, - 210, - 210, - 210, - 0, - 210, - 210, - 120, - 210, - 210, - 210, - 210, - 120, - 210, - 210, - 0, - 210, - 210, - 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, - 124, - 0, - 115, - 0, - 101, - 94, - 105, - 127, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 127, - 0, - 125, - 0, - 113, - 103, - 107, - 108, - 0, - 0, - 0, - 0, - 127, - 0, - 0, - 0, - 101, - 0, - 110, - 0, - 101, - 90, - 107, - 102, - 0, - 102, - 0, - 102, - 107, - 0, - 113, - 0, - 115, - 0, - 0, - 101, - 0, - 0, - 76, - 0, - 102, - 0, - 100, - 120, - 0, - 120, - 89, - 96, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/8/patterns.json b/addon/SD/PERFORMANCE/8/patterns.json deleted file mode 100755 index 13a4173..0000000 --- a/addon/SD/PERFORMANCE/8/patterns.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_data": [ - 72, - 0, - 0, - 55, - 53, - 0, - 0, - 0, - 72, - 0, - 0, - 0, - 76, - 0, - 74, - 74, - 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, - 45, - 57, - 69, - 81, - 45, - 57, - 69, - 81, - 45, - 57, - 69, - 81, - 45, - 57, - 69, - 81, - 38, - 50, - 62, - 74, - 38, - 50, - 62, - 74, - 38, - 50, - 62, - 74, - 38, - 50, - 62, - 74, - 69, - 0, - 69, - 0, - 0, - 0, - 0, - 69, - 69, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 74, - 0, - 74, - 0, - 0, - 0, - 0, - 74, - 74, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 69, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 76, - 0, - 76, - 78, - 74, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 72, - 0, - 74, - 0, - 76, - 69, - 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, - 64, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/8/sequencer.json b/addon/SD/PERFORMANCE/8/sequencer.json deleted file mode 100755 index 45192de..0000000 --- a/addon/SD/PERFORMANCE/8/sequencer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "seq_patternchain": [ - 0, - 3, - 10, - 5, - 99, - 99, - 0, - 4, - 11, - 6, - 24, - 24, - 0, - 3, - 12, - 5, - 99, - 99, - 0, - 3, - 13, - 5, - 99, - 99 - ], - "seq_tempo_ms": 170454, - "seq_bpm": 88, - "arp_play_basenote": true, - "arp_speed": 0, - "arp_lenght": 8, - "arp_style": 0, - "seq_chord_velocity": 60, - "seq_chord_dexed_inst": 0, - "seq_chain_lenght": 3, - "seq_transpose": 0, - "chord_key_ammount": 4, - "seq_oct_shift": 0, - "seq_element_shift": 0, - "track_type": [ - 0, - 1, - 1, - 0, - 1, - 1 - ], - "content_type": [ - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "seq_inst_dexed": [ - 0, - 0, - 1, - 1, - 1, - 1 - ], - "seq_name": [ - 86, - 105, - 115, - 105, - 116, - 111, - 114, - 115, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/addon/SD/PERFORMANCE/8/velocity.json b/addon/SD/PERFORMANCE/8/velocity.json deleted file mode 100755 index a83a3f6..0000000 --- a/addon/SD/PERFORMANCE/8/velocity.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "seq_velocity": [ - 120, - 0, - 0, - 115, - 124, - 0, - 0, - 0, - 120, - 0, - 0, - 0, - 127, - 0, - 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, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 120, - 210, - 0, - 210, - 0, - 0, - 0, - 0, - 210, - 210, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 210, - 0, - 210, - 0, - 0, - 0, - 0, - 210, - 210, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 125, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 126, - 0, - 125, - 125, - 127, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 92, - 0, - 95, - 0, - 102, - 123, - 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, - 124, - 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, - 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, - 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, - 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, - 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 - ] -} \ No newline at end of file diff --git a/config.h b/config.h index 48b8510..ee1f3dc 100644 --- a/config.h +++ b/config.h @@ -122,7 +122,7 @@ // NUMBER OF SAMPLES IN DRUMSET #if defined(ARDUINO_TEENSY41) -#define NUM_DRUMSET_CONFIG 69 +#define NUM_DRUMSET_CONFIG 69 #elif defined(ARDUINO_TEENSY40) #define NUM_DRUMSET_CONFIG 47 #else @@ -331,11 +331,9 @@ #define FAV_CONFIG_NAME "FAVCFG" #define PERFORMANCE_CONFIG_PATH "PERFORMANCE" -#define SEQUENCER_CONFIG_NAME "sequencer" +#define PERFORMANCE_CONFIG_NAME "performance" #define DRUMS_CONFIG_NAME "drums" #define DRUMS_MAPPING_NAME "drmmap" -#define PATTERN_CONFIG_NAME "patterns" -#define VELOCITY_CONFIG_NAME "velocity" #define FX_CONFIG_NAME "fx" #define VOICE_CONFIG_NAME "voice" #define SYS_CONFIG_NAME "sys" @@ -910,10 +908,22 @@ typedef struct sys_s { uint8_t load_at_startup; } sys_t; +typedef struct performance_s { + char name[FILENAME_LEN]; + char name_temp[FILENAME_LEN]; +} performance_t; + +typedef struct drums_s { + uint8_t vol; + bool smartfilter; +} drum_t; + typedef struct configuration_s { + performance_t performance; sys_t sys; dexed_t dexed[MAX_DEXED]; epiano_t epiano; + drum_t drums; fx_t fx; } config_t; diff --git a/dexed_sd.cpp b/dexed_sd.cpp index 0cc1ce4..99ce5d2 100644 --- a/dexed_sd.cpp +++ b/dexed_sd.cpp @@ -34,7 +34,6 @@ using namespace TeensyTimerTool; #include "dexed_sd.h" #include "synth_dexed.h" #if NUM_DRUMS > 0 -#include "sequencer.h" #include "drums.h" extern void set_drums_volume(float vol); extern drum_config_t drum_config[]; @@ -46,11 +45,6 @@ extern void check_configuration_dexed(uint8_t instance_id); extern void check_configuration_performance(void); extern void check_configuration_fx(void); extern void check_configuration_epiano(void); -extern void sequencer(); -extern sequencer_t seq; -#ifdef USE_SEQUENCER -extern PeriodicTimer sequencer_timer; -#endif extern float midi_volume_transform(uint8_t midi_amp); extern void set_sample_note(uint8_t sample, uint8_t note); extern void set_sample_pitch(uint8_t sample, float playbackspeed); @@ -618,8 +612,9 @@ bool load_sd_drumsettings_json(uint8_t number) serializeJsonPretty(data_json, Serial); Serial.println(); #endif - seq.drums_volume = data_json["drums_volume"]; - set_drums_volume(seq.drums_volume); + + configuration.drums.vol = data_json["drums_volume"]; + for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG - 1; i++) { uint8_t drumnumber = 0; @@ -687,7 +682,7 @@ bool save_sd_drumsettings_json(uint8_t number) json = SD.open(filename, FILE_WRITE); if (json) { - data_json["drums_volume"] = seq.drums_volume; + data_json["drums_volume"] = configuration.drums.vol; for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG - 1; i++) { data_json["note"][i] = get_sample_note(i); @@ -1378,134 +1373,11 @@ bool save_sd_sys_json(void) return (false); } -/****************************************************************************** - SD SEQUENCER - ******************************************************************************/ -bool save_sd_seq_sub_vel_json(uint8_t number) -{ - char filename[CONFIG_FILENAME_LEN]; - int count = 0; - number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - - if (sd_card > 0) - { - File json; - StaticJsonDocument data_json; - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, VELOCITY_CONFIG_NAME); -#ifdef DEBUG - Serial.print(F("Saving sequencer velocity ")); - Serial.print(number); - Serial.print(F(" to ")); - Serial.println(filename); -#endif - int total = sizeof(seq.vel); - int columns = sizeof(seq.vel[0]); - int rows = total / columns; - AudioNoInterrupts(); - SD.begin(); - SD.remove(filename); - json = SD.open(filename, FILE_WRITE); - if (json) - { - for (uint8_t i = 0; i < rows; i++) - { - for (uint8_t j = 0; j < columns; j++) { - data_json["seq_velocity"][count] = seq.vel[i][j]; - count++; - } - } - -#if defined(DEBUG) && defined(DEBUG_SHOW_JSON) - Serial.println(F("Write JSON data:")); - serializeJsonPretty(data_json, Serial); - Serial.println(); -#endif - serializeJsonPretty(data_json, json); - json.close(); - AudioInterrupts(); - return (true); - } - json.close(); - } - else - { -#ifdef DEBUG - Serial.print(F("E : Cannot open ")); - Serial.print(filename); - Serial.println(F(" on SD.")); -#endif - } - return (false); -} - -bool save_sd_seq_sub_patterns_json(uint8_t number) -{ - char filename[CONFIG_FILENAME_LEN]; - int count = 0; - number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - - if (sd_card > 0) - { - File json; - StaticJsonDocument data_json; - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, PATTERN_CONFIG_NAME); -#ifdef DEBUG - Serial.print(F("Saving sequencer patterns ")); - Serial.print(number); - Serial.print(F(" to ")); - Serial.println(filename); -#endif - int total = sizeof(seq.note_data); - int columns = sizeof(seq.note_data[0]); - int rows = total / columns; - AudioNoInterrupts(); - SD.begin(); - SD.remove(filename); - json = SD.open(filename, FILE_WRITE); - if (json) - { - for (uint8_t i = 0; i < rows; i++) - { - for (uint8_t j = 0; j < columns; j++) { - data_json["seq_data"][count] = seq.note_data[i][j]; - count++; - } - } - -#if defined(DEBUG) && defined(DEBUG_SHOW_JSON) - Serial.println(F("Write JSON data:")); - serializeJsonPretty(data_json, Serial); - Serial.println(); -#endif - serializeJsonPretty(data_json, json); - json.close(); - AudioInterrupts(); - return (true); - } - json.close(); - } - else - { -#ifdef DEBUG - Serial.print(F("E : Cannot open ")); - Serial.print(filename); - Serial.println(F(" on SD.")); -#endif - } - return (false); -} - bool save_sd_performance_json(uint8_t number) { char filename[CONFIG_FILENAME_LEN]; - int count = 0; - bool seq_was_running = false; number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - if (seq.running == true ) { - seq_was_running = true; - handleStop(); - } dac_mute(); AudioNoInterrupts(); @@ -1517,8 +1389,6 @@ bool save_sd_performance_json(uint8_t number) Serial.println(number); #endif - save_sd_seq_sub_vel_json(number); - save_sd_seq_sub_patterns_json(number); save_sd_drummappings_json(number); save_sd_fx_json(number); save_sd_epiano_json(number); @@ -1527,70 +1397,31 @@ bool save_sd_performance_json(uint8_t number) { sprintf(filename, "/%s/%d/%s%d.json", PERFORMANCE_CONFIG_PATH, number, VOICE_CONFIG_NAME, i); #ifdef DEBUG - Serial.print(F("Write Voice-Config for sequencer")); + Serial.print(F("Write Voice-Config")); Serial.println(filename); #endif save_sd_voiceconfig_json(number, i); } + if (sd_card > 0) { File json; StaticJsonDocument data_json; - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, SEQUENCER_CONFIG_NAME); + sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); #ifdef DEBUG - Serial.print(F("Saving sequencer config ")); + Serial.print(F("Saving performance config ")); Serial.print(number); Serial.print(F(" to ")); Serial.println(filename); #endif - int total = sizeof(seq.patternchain); - int columns = sizeof(seq.patternchain[0]); - int rows = total / columns; - Serial.print(F(" ")); + SD.remove(filename); json = SD.open(filename, FILE_WRITE); if (json) { - Serial.print(F("Chain Rows: ")); - Serial.print(rows); - Serial.print(" Chain Columns: "); - Serial.print(columns); - Serial.print(F(" ")); - count = 0; - for (uint8_t i = 0; i < rows; i++) - { - for (uint8_t j = 0; j < columns; j++) { - data_json["seq_patternchain"][count] = seq.patternchain[i][j]; - count++; - } - } - count = 0; - data_json["seq_tempo_ms"] = seq.tempo_ms ; - data_json["seq_bpm"] = seq.bpm; - data_json["arp_play_basenote"] = seq.arp_play_basenote; - data_json["arp_speed"] = seq.arp_speed; - data_json["arp_lenght"] = seq.arp_lenght; - data_json["arp_style"] = seq.arp_style; - data_json["seq_chord_velocity"] = seq.chord_velocity; - data_json["seq_chord_dexed_inst"] = seq.chord_dexed_inst; - data_json["seq_chain_lenght"] = seq.chain_lenght; - data_json["seq_transpose"] = seq.transpose; - data_json["chord_key_ammount"] = seq.chord_key_ammount; - data_json["seq_oct_shift"] = seq.oct_shift; - data_json["seq_element_shift"] = seq.element_shift; - for (uint8_t i = 0; i < sizeof(seq.track_type); i++) { - data_json["track_type"][i] = seq.track_type[i]; - } - for (uint8_t i = 0; i < sizeof(seq.content_type); i++) { - data_json["content_type"][i] = seq.content_type[i]; - } - for (uint8_t i = 0; i < sizeof(seq.inst_dexed); i++) { - data_json["seq_inst_dexed"][i] = seq.inst_dexed[i]; - } for (uint8_t i = 0; i < FILENAME_LEN; i++) { - data_json["seq_name"][i] = seq.name[i]; + data_json["name"][i] = configuration.performance.name[i]; } - #if defined(DEBUG) && defined(DEBUG_SHOW_JSON) Serial.println(F("Write JSON data:")); serializeJsonPretty(data_json, Serial); @@ -1600,8 +1431,6 @@ bool save_sd_performance_json(uint8_t number) json.close(); AudioInterrupts(); dac_unmute(); - if (seq_was_running == true ) - handleStart(); return (true); } json.close(); @@ -1664,14 +1493,13 @@ bool check_performance_directory(uint8_t number) void get_sd_performance_name_json(uint8_t number) { number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - memset(seq.name_temp, 0, FILENAME_LEN); if (sd_card > 0) { File json; StaticJsonDocument data_json; char filename[CONFIG_FILENAME_LEN]; - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, SEQUENCER_CONFIG_NAME); + sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); // first check if file exists... AudioNoInterrupts(); @@ -1687,15 +1515,15 @@ void get_sd_performance_name_json(uint8_t number) json.close(); AudioInterrupts(); } - if (data_json["seq_name"][0] != 0) { + if (data_json["performance_name"][0] != 0) { for (uint8_t i = 0; i < FILENAME_LEN; i++) { - seq.name_temp[i] = data_json["seq_name"][i]; + configuration.performance.name_temp[i] = data_json["name"][i]; } #ifdef DEBUG Serial.print(F("Get performance name for ")); Serial.print(number); Serial.print(F(": ")); - Serial.print(seq.name_temp); + Serial.print(configuration.performance.name_temp); Serial.println(); #endif } @@ -1711,162 +1539,12 @@ void get_sd_performance_name_json(uint8_t number) } } -bool load_sd_seq_sub_vel_json(uint8_t number) -{ - if (number < 0) - return (false); - number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - if (sd_card > 0) - { - File json; - StaticJsonDocument data_json; - char filename[CONFIG_FILENAME_LEN]; - - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, VELOCITY_CONFIG_NAME); - - // first check if file exists... - AudioNoInterrupts(); - if (SD.exists(filename)) - { - // ... and if: load -#ifdef DEBUG - Serial.print(F("Found velocity data [")); - Serial.print(filename); - Serial.println(F("]... loading...")); - Serial.println(F(" ")); -#endif - json = SD.open(filename); - if (json) - { - deserializeJson(data_json, json); - json.close(); - AudioInterrupts(); - -#if defined(DEBUG) && defined(DEBUG_SHOW_JSON) - Serial.println(F("Read JSON data:")); - serializeJsonPretty(data_json, Serial); - Serial.println(); -#endif - int total = sizeof(seq.vel); - int columns = sizeof(seq.vel[0]); - int rows = total / columns; - int count = 0; - for (uint8_t i = 0; i < rows; i++) - { - for (uint8_t j = 0; j < columns; j++) { - seq.vel[i][j] = data_json["seq_velocity"][count]; - count++; - } - } - return (true); - } -#ifdef DEBUG - else - { - Serial.print(F("E: Cannot open ")); - Serial.print(filename); - Serial.println(F(" on SD.")); - } - } - else - { - Serial.print(F("No ")); - Serial.print(filename); - Serial.println(F(" available.")); -#endif - } - } - return (false); -} - -bool load_sd_seq_sub_patterns_json(uint8_t number) -{ - if (number < 0) - return (false); - number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - if (sd_card > 0) - { - File json; - StaticJsonDocument data_json; - char filename[CONFIG_FILENAME_LEN]; - - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, PATTERN_CONFIG_NAME); - - // first check if file exists... - AudioNoInterrupts(); - if (SD.exists(filename)) - { - // ... and if: load -#ifdef DEBUG - Serial.print(F("Found pattern data [")); - Serial.print(filename); - Serial.println(F("]... loading...")); - Serial.println(F(" ")); -#endif - json = SD.open(filename); - if (json) - { - deserializeJson(data_json, json); - - json.close(); - AudioInterrupts(); - -#if defined(DEBUG) && defined(DEBUG_SHOW_JSON) - Serial.println(F("Read JSON data:")); - serializeJsonPretty(data_json, Serial); - Serial.println(); -#endif - int total = sizeof(seq.note_data); - int columns = sizeof(seq.note_data[0]); - int rows = total / columns; - int count = 0; - - for (uint8_t i = 0; i < rows; i++) - { - for (uint8_t j = 0; j < columns; j++) { - seq.note_data[i][j] = data_json["seq_data"][count]; - count++; - } - } - return (true); - } -#ifdef DEBUG - else - { - Serial.print(F("E : Cannot open ")); - Serial.print(filename); - Serial.println(F(" on SD.")); - } - } - else - { - Serial.print(F("No ")); - Serial.print(filename); - Serial.println(F(" available.")); -#endif - } - } - return (false); -} - bool load_sd_performance_json(uint8_t number) { -#ifdef USE_SEQUENCER - bool seq_was_running = false; - - if (seq.running) - { - seq_was_running = true; - seq.running = false; - } -#endif - dac_mute(); handleStop(); number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); AudioNoInterrupts(); - load_sd_seq_sub_patterns_json(number); - load_sd_seq_sub_vel_json(number); load_sd_fx_json(number); load_sd_epiano_json(number); load_sd_drummappings_json(number); @@ -1875,126 +1553,25 @@ bool load_sd_performance_json(uint8_t number) { File json; StaticJsonDocument data_json; - char filename[CONFIG_FILENAME_LEN]; - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, SEQUENCER_CONFIG_NAME); - // first check if file exists... - if (SD.exists(filename)) - { - // ... and if: load -#ifdef DEBUG - Serial.print(F("Found Performance configuration [")); - Serial.print(filename); - Serial.println(F("]... loading...")); -#endif - AudioNoInterrupts(); - json = SD.open(filename); - if (json) - { - deserializeJson(data_json, json); - json.close(); - AudioInterrupts(); - -#if defined(DEBUG) && defined(DEBUG_SHOW_JSON) - Serial.println(F("Read JSON data:")); - serializeJsonPretty(data_json, Serial); - Serial.println(); -#endif - int total = sizeof(seq.patternchain); - int columns = sizeof(seq.patternchain[0]); - int rows = total / columns; - int count = 0; - for (uint8_t i = 0; i < rows; i++) - { - for (uint8_t j = 0; j < columns; j++) - { - seq.patternchain[i][j] = data_json["seq_patternchain"][count]; - count++; - } - } - for (uint8_t i = 0; i < sizeof(seq.track_type); i++) - { - seq.track_type[i] = data_json["track_type"][i]; - } - for (uint8_t i = 0; i < sizeof(seq.content_type); i++) - { - seq.content_type[i] = data_json["content_type"][i]; - } - for (uint8_t i = 0; i < sizeof(seq.inst_dexed); i++) - { - seq.inst_dexed[i] = data_json["seq_inst_dexed"][i]; - } - if (data_json["seq_name"][0] != 0) - { - for (uint8_t i = 0; i < FILENAME_LEN; i++) - { - seq.name[i] = data_json["seq_name"][i]; - } - } - count = 0; - seq.tempo_ms = data_json["seq_tempo_ms"] ; - seq.bpm = data_json["seq_bpm"]; - seq.arp_play_basenote = data_json["arp_play_basenote"]; - seq.arp_speed = data_json["arp_speed"] ; - seq.arp_lenght = data_json["arp_lenght"]; - seq.arp_style = data_json["arp_style"]; - seq.chord_velocity = data_json["seq_chord_velocity"]; - seq.chord_dexed_inst = data_json["seq_chord_dexed_inst"] ; - seq.chain_lenght = data_json["seq_chain_lenght"]; - seq.transpose = data_json["seq_transpose"]; - seq.chord_key_ammount = data_json["chord_key_ammount"]; - seq.oct_shift = data_json["seq_oct_shift"]; - seq.element_shift = data_json["seq_element_shift"]; - for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - { + for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) + { #ifdef DEBUG - Serial.print(F("Load Voice-Config ")); - Serial.print(instance_id + 1); - Serial.print(F(" for sequencer")); + Serial.print(F("Load Voice-Config ")); + Serial.println(instance_id + 1); #endif - load_sd_voiceconfig_json(number, instance_id); - load_sd_voice(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); - MicroDexed[instance_id]->setGain(midi_volume_transform(map(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0, 127))); - MicroDexed[instance_id]->panic(); - } - /* for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - set_voiceconfig_params(instance_id); + load_sd_voiceconfig_json(number, instance_id); + load_sd_voice(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); + MicroDexed[instance_id]->setGain(midi_volume_transform(map(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0, 127))); + MicroDexed[instance_id]->panic(); + } - set_fx_params();*/ + dac_unmute(); + AudioInterrupts(); - dac_unmute(); - seq.step = 0; - seq.chain_active_step = 0; -#ifdef USE_SEQUENCER - if (seq_was_running) - { - sequencer_timer.begin(sequencer, seq.tempo_ms / 2); - seq.running = true; - } - else - sequencer_timer.begin(sequencer, seq.tempo_ms / 2, false); -#else - seq.running = false; -#endif - return (true); - } -#ifdef DEBUG - else - { - AudioInterrupts(); - Serial.print(F("E : Cannot open ")); - Serial.print(filename); - Serial.println(F(" on SD.")); - } - } - else - { - Serial.print(F("No ")); - Serial.print(filename); - Serial.println(F(" available.")); -#endif - } + return (true); } + return (false); } @@ -2009,7 +1586,7 @@ bool check_sd_performance_exists(uint8_t number) { char filename[CONFIG_FILENAME_LEN]; - sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, SEQUENCER_CONFIG_NAME); + sprintf(filename, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); // check if file exists... if (SD.exists(filename)) diff --git a/midi_devices.hpp b/midi_devices.hpp index ffa7e76..12ac916 100644 --- a/midi_devices.hpp +++ b/midi_devices.hpp @@ -1,10 +1,12 @@ /* MicroDexed - MicroMDAEPiano is a port of the MDA-EPiano sound engine - (https://sourceforge.net/projects/mda-vst/) for the Teensy-3.5/3.6/4.x with audio shield. + MicroDexed is a port of the Dexed sound engine + (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield. + Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android - (c)2019-2021 H. Wirtz + (c)2018-2022 H. Wirtz + (c)2021-2022 H. Wirtz , M. Koslowski This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,30 +21,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ #ifndef MIDI_DEVICES_H #define MIDI_DEVICES_H - #include "config.h" -#include "sequencer.h" - extern config_t configuration; -extern sequencer_t seq; - -/* #if defined(MIDI_DEVICE_USB) - #include - #endif */ #ifdef MIDI_DEVICE_USB_HOST #include #endif - // override default sysex size settings struct MicroDexedSettings : public midi::DefaultSettings { static const unsigned SysExMaxSize = 4104; // Accept SysEx messages up to 1024 bytes long. }; - #ifdef MIDI_DEVICE_DIN MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, MIDI_DEVICE_DIN, midi_serial, MicroDexedSettings); #endif @@ -56,17 +49,16 @@ MIDIDevice midi_usb(usb_host); UsbTransport sUsbTransport; MIDI_CREATE_INSTANCE(UsbTransport, sUsbTransport, midi_onboard_usb); #endif */ - -void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity); -void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity); +void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity, byte device); +void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity, byte device); void handleControlChange(byte inChannel, byte inData1, byte inData2); void handleAfterTouch(byte inChannel, byte inPressure); void handlePitchBend(byte inChannel, int inPitch); void handleProgramChange(byte inChannel, byte inProgram); +void handleAfterTouchPoly(byte inChannel, byte inNumber, byte inVelocity); void handleSystemExclusive(byte *data, uint len); //void handleSystemExclusiveChunk(const byte *data, uint len, bool last); void handleTimeCodeQuarterFrame(byte data); -void handleAfterTouchPoly(byte inChannel, byte inNumber, byte inVelocity); void handleSongSelect(byte inSong); void handleTuneRequest(void); void handleClock(void); @@ -77,195 +69,427 @@ void handleActiveSensing(void); void handleSystemReset(void); //void handleRealTimeSystem(void); void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value); - -/***************************************** - MIDI_DEVICE_DIN - *****************************************/ -#ifdef MIDI_DEVICE_DIN -void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocity) -{ - seq.note_in=inNumber; - seq.note_in_velocity=inVelocity; - handleNoteOn(inChannel, inNumber, inVelocity); +#define MIDI_BY_DIN "MIDI_DIN" +#define MIDI_BY_USB_HOST "MIDI_USB_HOST" +#define MIDI_BY_USB "USB_MIDI" +void handle_generic(byte inChannel, byte inData1, byte inData2, const char *midi_device, midi::MidiType event) +{ + char text[10]; + switch(event) { + case midi::NoteOn: + handleNoteOn(inChannel, inData1, inData2, 0); + strcpy(text, "NoteOn"); + break; + case midi::NoteOff: + handleNoteOff(inChannel, inData1, inData2, 0); + strcpy(text, "NoteOff"); + break; + case midi::ControlChange: + handleControlChange(inChannel, inData1, inData2); + strcpy(text, "CC"); + break; + case midi::AfterTouchChannel: + handleAfterTouch(inChannel, inData1); + strcpy(text, "Mono AT"); + break; + case midi::PitchBend: + handlePitchBend(inChannel, inData1); + strcpy(text, "PB"); + break; + case midi::ProgramChange: + handleProgramChange(inChannel, inData1); + strcpy(text, "PC"); + break; + case midi::AfterTouchPoly: + handleAfterTouchPoly(inChannel, inData1, inData2); + strcpy(text, "Poly AT"); + break; + default: + break; + } +#ifdef DEBUG + Serial.printf("[%s] %s", midi_device, text); +#endif + // MIDI THRU + if (configuration.sys.soft_midi_thru == 1) + { +#ifdef MIDI_DEVICE_USB + if(strcmp(MIDI_BY_USB, midi_device)) { + switch(event) { + case midi::NoteOn: + usbMIDI.sendNoteOn(inData1, inData2, inChannel); + break; + case midi::NoteOff: + usbMIDI.sendNoteOff(inData1, inData2, inChannel); + break; + case midi::ControlChange: + usbMIDI.sendControlChange(inData1, inData2, inChannel); + break; + case midi::AfterTouchChannel: + usbMIDI.sendAfterTouch(inData1, inChannel); + break; + case midi::PitchBend: + usbMIDI.sendPitchBend(inData1, inChannel); + break; + case midi::ProgramChange: + usbMIDI.sendProgramChange(inData1, inChannel); + break; + case midi::AfterTouchPoly: + usbMIDI.sendAfterTouch(inData1, inData2, inChannel); + break; + default: + break; + } #ifdef DEBUG - Serial.print(F("[MIDI_DIN] NoteOn")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendNoteOn(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendNoteOn(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif + Serial.print(F(" THRU->MIDI_USB")); + #endif + } +#endif +#ifdef MIDI_DEVICE_DIN + if(strcmp(MIDI_BY_DIN, midi_device)) { + switch(event) { + case midi::NoteOn: + midi_serial.sendNoteOn(inData1, inData2, inChannel); + break; + case midi::NoteOff: + midi_serial.sendNoteOff(inData1, inData2, inChannel); + break; + case midi::ControlChange: + midi_serial.sendControlChange(inData1, inData2, inChannel); + break; + case midi::AfterTouchChannel: + midi_serial.sendAfterTouch(inData1, inChannel); + break; + case midi::PitchBend: + midi_serial.sendPitchBend(inData1, inChannel); + break; + case midi::ProgramChange: + midi_serial.sendProgramChange(inData1, inChannel); + break; + case midi::AfterTouchPoly: + midi_serial.sendAfterTouch(inData1, inData2, inChannel); + break; + default: + break; + } + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_DIN")); + #endif + } +#endif +#ifdef MIDI_DEVICE_USB_HOST + if(strcmp(MIDI_BY_USB_HOST, midi_device)) { + switch(event) { + case midi::NoteOn: + midi_usb.sendNoteOn(inData1, inData2, inChannel); + break; + case midi::NoteOff: + midi_usb.sendNoteOff(inData1, inData2, inChannel); + break; + case midi::ControlChange: + midi_usb.sendControlChange(inData1, inData2, inChannel); + break; + case midi::AfterTouchChannel: + midi_usb.sendAfterTouch(inData1, inChannel); + break; + case midi::PitchBend: + midi_usb.sendPitchBend(inData1, inChannel); + break; + case midi::ProgramChange: + midi_usb.sendProgramChange(inData1, inChannel); + break; + case midi::AfterTouchPoly: + midi_usb.sendAfterTouch(inData1, inData2, inChannel); + break; + default: + break; + } + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_USB_HOST")); + #endif + } #endif } #ifdef DEBUG Serial.println(); #endif } - -void handleNoteOff_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocity) -{ - handleNoteOff(inChannel, inNumber, inVelocity); +void handleSystemExclusive_generic(byte *data, uint len, const char *midi_device) { + handleSystemExclusive(data, len); #ifdef DEBUG - Serial.print(F("[MIDI_DIN] NoteOff")); + Serial.printf("[%s] SysEx", midi_device); #endif + // MIDI THRU if (configuration.sys.soft_midi_thru == 1) { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendNoteOff(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif #ifdef MIDI_DEVICE_USB - usbMIDI.sendNoteOff(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); + if(strcmp(MIDI_BY_USB, midi_device)) { + usbMIDI.sendSysEx(len, data); + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_USB")); + #endif + } +#endif +#ifdef MIDI_DEVICE_DIN + if(strcmp(MIDI_BY_DIN, midi_device)) { + midi_serial.sendSysEx(len, data); + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_DIN")); + #endif + } #endif +#ifdef MIDI_DEVICE_USB_HOST + if(strcmp(MIDI_BY_USB_HOST, midi_device)) { + midi_usb.sendSysEx(len, data); + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_USB_HOST")); + #endif + } #endif } #ifdef DEBUG Serial.println(); #endif } - -void handleControlChange_MIDI_DEVICE_DIN(byte inChannel, byte inData1, byte inData2) +void handleSystemCommon_generic(byte inData1, const char *midi_device, midi::MidiType event) { - handleControlChange(inChannel, inData1, inData2); + char text[10]; + switch(event) { + case midi::TimeCodeQuarterFrame: + handleTimeCodeQuarterFrame(inData1); + strcpy(text, "TimeCodeQuarterFrame"); + break; + case midi::SongSelect: + handleSongSelect(inData1); + strcpy(text, "SongSelect"); + break; + case midi::TuneRequest: + handleTuneRequest(); + strcpy(text, "TuneRequest"); + break; + default: + break; + } #ifdef DEBUG - Serial.print(F("[MIDI_DIN] CC")); + Serial.printf("[%s] %s", midi_device, text); #endif + // MIDI THRU if (configuration.sys.soft_midi_thru == 1) { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendControlChange(inData1, inData2, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif #ifdef MIDI_DEVICE_USB - usbMIDI.sendControlChange(inData1, inData2, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif + if(strcmp(MIDI_BY_USB, midi_device)) { + switch(event) { + case midi::TimeCodeQuarterFrame: + usbMIDI.sendTimeCodeQuarterFrame(0xF1, inData1); + break; + case midi::SongSelect: + usbMIDI.sendSongSelect(inData1); + break; + case midi::TuneRequest: + usbMIDI.sendTuneRequest(); + break; + default: + break; + } + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_USB")); + #endif + } +#endif +#ifdef MIDI_DEVICE_DIN + if(strcmp(MIDI_BY_DIN, midi_device)) { + switch(event) { + case midi::TimeCodeQuarterFrame: + midi_serial.sendTimeCodeQuarterFrame(inData1); + break; + case midi::SongSelect: + midi_serial.sendSongSelect(inData1); + break; + case midi::TuneRequest: + midi_serial.sendTuneRequest(); + break; + default: + break; + } + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_DIN")); + #endif + } +#endif +#ifdef MIDI_DEVICE_USB_HOST + if(strcmp(MIDI_BY_USB_HOST, midi_device)) { + switch(event) { + case midi::TimeCodeQuarterFrame: + midi_usb.sendTimeCodeQuarterFrame(0xF1, inData1); + break; + case midi::SongSelect: + midi_usb.sendSongSelect(inData1); + break; + case midi::TuneRequest: + midi_usb.sendTuneRequest(); + break; + default: + break; + } + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_USB_HOST")); + #endif + } #endif } #ifdef DEBUG Serial.println(); #endif } - -void handleAfterTouch_MIDI_DEVICE_DIN(byte inChannel, byte inPressure) +void handleRealtime_generic(const char *midi_device, midi::MidiType event) { - handleAfterTouch(inChannel, inPressure); + char text[10]; + switch(event) { + case midi::Clock: + handleClock(); + strcpy(text, "Clock"); + break; + case midi::Start: + handleStart(); + strcpy(text, "Start"); + break; + case midi::Continue: + handleContinue(); + strcpy(text, "Continue"); + break; + case midi::Stop: + handleStop(); + strcpy(text, "Stop"); + break; + case midi::ActiveSensing: + handleActiveSensing(); + strcpy(text, "ActiveSensing"); + break; + case midi::SystemReset: + handleSystemReset(); + strcpy(text, "SystemReset"); + break; + default: + break; + } #ifdef DEBUG - Serial.print(F("[MIDI_DIN] AT")); + Serial.printf("[%s] %s", midi_device, text); #endif + // MIDI THRU if (configuration.sys.soft_midi_thru == 1) { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendAfterTouch(inPressure, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif #ifdef MIDI_DEVICE_USB - usbMIDI.sendAfterTouch(inPressure, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif + if(strcmp(MIDI_BY_USB, midi_device)) { + usbMIDI.sendRealTime(event); + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_USB")); + #endif + } #endif - } -#ifdef DEBUG - Serial.println(); +#ifdef MIDI_DEVICE_DIN + if(strcmp(MIDI_BY_DIN, midi_device)) { + midi_serial.sendRealTime(event); + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_DIN")); + #endif + } #endif +#ifdef MIDI_DEVICE_USB_HOST + if(strcmp(MIDI_BY_USB_HOST, midi_device)) { + midi_usb.sendRealTime(event); + #ifdef DEBUG + Serial.print(F(" THRU->MIDI_USB_HOST")); + #endif + } +#endif + } +#ifdef DEBUG + Serial.println(); +#endif +} +///* void handleSystemExclusiveChunk_MIDI_DEVICE_DIN(byte *data, uint len, bool last) +// void handlRealTimeSystem_generic(byte inRealTime, byte midi_device) { +// handleRealTimeSystem(); +// #ifdef DEBUG +// switch(midi_device) { +// case MIDI_DIN: +// Serial.print(F("[MIDI_DIN] RealTimeSystem")); +// break; +// case MIDI_USB_HOST: +// Serial.print(F("[MIDI_USB_HOST] RealTimeSystem")); +// break; +// case USB_MIDI: +// Serial.print(F("[USB_MIDI] RealTimeSystem")); +// break; +// } +// #endif +// if (configuration.sys.soft_midi_thru == 1) +// { +// #ifdef MIDI_DEVICE_USB +// if(midi_device != USB_MIDI) { +// usbMIDI.sendRealTime(inRealTime); +// #ifdef DEBUG +// Serial.print(F(" THRU->MIDI_USB")); +// #endif +// } +// #endif +// #ifdef MIDI_DEVICE_DIN +// if(midi_device != MIDI_DIN) { +// midi_serial.sendRealTime((midi::MidiType)inRealTime); +// #ifdef DEBUG +// Serial.print(F(" THRU->MIDI_DIN")); +// #endif +// } +// #endif +// #ifdef MIDI_DEVICE_USB_HOST +// if(midi_device != MIDI_USB_HOST) { +// midi_usb.sendRealTime(inRealTime); +// #ifdef DEBUG +// Serial.print(F(" THRU->MIDI_USB_HOST")); +// #endif +// } +// #endif +// } +// #ifdef DEBUG +// Serial.println(); +// #endif +// } +/***************************************** + MIDI_DEVICE_DIN + *****************************************/ +#ifdef MIDI_DEVICE_DIN +void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, byte inNoteNumber, byte inVelocity) +{ + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOn); +} +void handleNoteOff_MIDI_DEVICE_DIN(byte inChannel, byte inNoteNumber, byte inVelocity) +{ + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOff); +} +void handleControlChange_MIDI_DEVICE_DIN(byte inChannel, byte inData1, byte inData2) +{ + handle_generic(inChannel, inData1, inData2, MIDI_BY_DIN, midi::ControlChange); +} +void handleAfterTouch_MIDI_DEVICE_DIN(byte inChannel, byte inPressure) +{ + handle_generic(inChannel, inPressure, '\0', MIDI_BY_DIN, midi::AfterTouchChannel); } - void handlePitchBend_MIDI_DEVICE_DIN(byte inChannel, int inPitch) { - handlePitchBend(inChannel, inPitch); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] PB")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendPitchBend(inPitch, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendPitchBend(inPitch, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inPitch, '\0', MIDI_BY_DIN, midi::PitchBend); } - void handleProgramChange_MIDI_DEVICE_DIN(byte inChannel, byte inProgram) { - handleProgramChange(inChannel, inProgram); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] PC")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendProgramChange(inProgram, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendProgramChange(inProgram, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inProgram, '\0', MIDI_BY_DIN, midi::ProgramChange); +} +void handleAfterTouchPoly_MIDI_DEVICE_DIN(byte inChannel, byte inNoteNumber, byte inVelocity) +{ + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::AfterTouchPoly); } - void handleSystemExclusive_MIDI_DEVICE_DIN(byte * data, uint len) { - handleSystemExclusive(data, len); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] SysEx")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendSysEx(len, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendSysEx(len, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemExclusive_generic(data, len, MIDI_BY_DIN); } - /* void handleSystemExclusiveChunk_MIDI_DEVICE_DIN(byte *data, uint len, bool last) { handleSystemExclusiveChunk(data, len, last); @@ -291,482 +515,83 @@ void handleSystemExclusive_MIDI_DEVICE_DIN(byte * data, uint len) Serial.println(); #endif } */ - void handleTimeCodeQuarterFrame_MIDI_DEVICE_DIN(byte data) { - handleTimeCodeQuarterFrame(data); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] TimeCodeQuarterFrame")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendTimeCodeQuarterFrame(0xF1, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendTimeCodeQuarterFrame(0xF1, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif -} - -void handleAfterTouchPoly_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocity) -{ - handleAfterTouchPoly(inChannel, inNumber, inVelocity); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] AT-Poly")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendAfterTouch(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendAfterTouch(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic(data, MIDI_BY_DIN, midi::TimeCodeQuarterFrame); } - void handleSongSelect_MIDI_DEVICE_DIN(byte inSong) { - handleSongSelect(inSong); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] SongSelect")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendSongSelect(inSong); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendSongSelect(inSong); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic(inSong, MIDI_BY_DIN, midi::SongSelect); } - void handleTuneRequest_MIDI_DEVICE_DIN(void) { - handleTuneRequest(); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] TuneRequest")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendTuneRequest(); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendTuneRequest(); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic('\0', MIDI_BY_DIN, midi::TuneRequest); } - void handleClock_MIDI_DEVICE_DIN(void) { - handleClock(); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] Clock")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Clock); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Clock); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_DIN, midi::Clock); } - void handleStart_MIDI_DEVICE_DIN(void) { - handleStart(); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] Start")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Start); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Start); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_DIN, midi::Start); } - void handleContinue_MIDI_DEVICE_DIN(void) { - handleContinue(); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] Continue")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Continue); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Continue); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_DIN, midi::Continue); } - void handleStop_MIDI_DEVICE_DIN(void) { - handleStop(); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] Stop")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Stop); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Stop); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_DIN, midi::Stop); } - void handleActiveSensing_MIDI_DEVICE_DIN(void) { - handleActiveSensing(); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] ActiveSensing")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::ActiveSensing); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::ActiveSensing); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_DIN, midi::ActiveSensing); } - void handleSystemReset_MIDI_DEVICE_DIN(void) { - handleSystemReset(); -#ifdef DEBUG - Serial.print(F("[MIDI_DIN] SystemReset")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::SystemReset); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::SystemReset); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_DIN, midi::SystemReset); } - /* void handlRealTimeSysteme_MIDI_DEVICE_DIN(byte inRealTime) { - handleRealTimeSystem(); - #ifdef DEBUG - Serial.print(F("[MIDI_DIN] RealTimeSystem")); - #endif - if (configuration.sys.soft_midi_thru == 1) - { - #ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(inRealTime); - #ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); - #endif - #endif - #ifdef MIDI_DEVICE_USB - //usbMIDI.sendRealTime(inRealTIme); - #ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB[NOTSUPPORTED]")); - #endif - #endif - } - #ifdef DEBUG - Serial.println(); - #endif + handleRealTimeSystem_generic(MIDI_DIN); } */ #endif // MIDI_DEVICE_DIN - /***************************************** MIDI_DEVICE_USB_HOST *****************************************/ #ifdef MIDI_DEVICE_USB_HOST -void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVelocity) +void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNoteNumber, byte inVelocity) { - seq.note_in=inNumber; - seq.note_in_velocity=inVelocity; - handleNoteOn(inChannel, inNumber, inVelocity); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] NoteOn")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendNoteOn(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendNoteOn(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOn); } - -void handleNoteOff_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVelocity) +void handleNoteOff_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNoteNumber, byte inVelocity) { - handleNoteOff(inChannel, inNumber, inVelocity); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] NoteOff")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendNoteOff(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendNoteOff(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOff); } - void handleControlChange_MIDI_DEVICE_USB_HOST(byte inChannel, byte inData1, byte inData2) { - handleControlChange(inChannel, inData1, inData2); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] CC")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendControlChange(inData1, inData2, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendControlChange(inData1, inData2, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inData1, inData2, MIDI_BY_USB_HOST, midi::ControlChange); } - void handleAfterTouch_MIDI_DEVICE_USB_HOST(byte inChannel, byte inPressure) { - handleAfterTouch(inChannel, inPressure); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] AT")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendAfterTouch(inPressure, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendAfterTouch(inPressure, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB_HOST, midi::AfterTouchChannel); } - void handlePitchBend_MIDI_DEVICE_USB_HOST(byte inChannel, int inPitch) { - handlePitchBend(inChannel, inPitch); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] PB")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendPitchBend(inPitch, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendPitchBend(inPitch, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB_HOST, midi::PitchBend); } - -void handleProgramChange_MIDI_DEVICE_USB_HOST(byte inChannel, byte inProgram) +void handleProgramChange_MIDI_DEVICE_USB_HOST(byte inChannel, byte inPitch) { - handleProgramChange(inChannel, inProgram); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] PC")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendProgramChange(inProgram, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendProgramChange(inProgram, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB_HOST, midi::ProgramChange); +} +void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNoteNumber, byte inVelocity) +{ + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::AfterTouchPoly); } - void handleSystemExclusive_MIDI_DEVICE_USB_HOST(byte * data, uint len) { - handleSystemExclusive(data, len); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] SysEx")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendSysEx(len, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendSysEx(len, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemExclusive_generic(data, len, MIDI_BY_USB_HOST); } - /* void handleSystemExclusiveChunk_MIDI_DEVICE_USB_HOST(byte *data, uint len, bool last) { handleSystemExclusiveChunk(data, len, last); @@ -792,481 +617,84 @@ void handleSystemExclusive_MIDI_DEVICE_USB_HOST(byte * data, uint len) Serial.println(); #endif } */ - void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB_HOST(midi::DataByte data) { - handleTimeCodeQuarterFrame(data); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] TimeCodeQuarterFrame")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendTimeCodeQuarterFrame(data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendTimeCodeQuarterFrame(0xF1, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif -} - -void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVelocity) -{ - handleAfterTouchPoly(inChannel, inNumber, inVelocity); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] AT-Poly")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendAfterTouch(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendAfterTouch(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic(data, MIDI_BY_USB_HOST, midi::TimeCodeQuarterFrame); } - void handleSongSelect_MIDI_DEVICE_USB_HOST(byte inSong) { - handleSongSelect(inSong); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] SongSelect")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendSongSelect(inSong); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendSongSelect(inSong); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic(inSong, MIDI_BY_USB_HOST, midi::SongSelect); } - void handleTuneRequest_MIDI_DEVICE_USB_HOST(void) { - handleTuneRequest(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] TuneRequest")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendTuneRequest(); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendTuneRequest(); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic('\0', MIDI_BY_USB_HOST, midi::TuneRequest); } - void handleClock_MIDI_DEVICE_USB_HOST(void) { - handleClock(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] Clock")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Clock); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Clock); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB_HOST, midi::Clock); } - void handleStart_MIDI_DEVICE_USB_HOST(void) { - handleStart(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] Start")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Start); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Start); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB_HOST, midi::Start); } - void handleContinue_MIDI_DEVICE_USB_HOST(void) { - handleContinue(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] Continue")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Continue); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Continue); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB_HOST, midi::Continue); } - void handleStop_MIDI_DEVICE_USB_HOST(void) { - handleStop(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] Stop")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Stop); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::Stop); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB_HOST, midi::Stop); } - void handleActiveSensing_MIDI_DEVICE_USB_HOST(void) { - handleActiveSensing(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] ActiveSensing")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::ActiveSensing); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::ActiveSensing); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB_HOST, midi::ActiveSensing); } - void handleSystemReset_MIDI_DEVICE_USB_HOST(void) { - handleSystemReset(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] SystemReset")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::SystemReset); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(midi::SystemReset); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB_HOST, midi::SystemReset); } - -/* void handlRealTimeSysteme_MIDI_DEVICE_USB_HOST(midi::MidiType inRealTime) +/* void handlRealTimeSystem_MIDI_DEVICE_USB_HOST(midi::MidiType inRealTime) { - handleRealTimeSystem(); - #ifdef DEBUG - Serial.print(F("[MIDI_USB_HOST] RealTimeSystem")); - #endif - if (configuration.sys.soft_midi_thru == 1) - { - #ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(inRealTime); - #ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); - #endif - #endif - #ifdef MIDI_DEVICE_USB - usbMIDI.sendRealTime(inRealTime); - #ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB")); - #endif - #endif - } - #ifdef DEBUG - Serial.println(); - #endif + handleRealTimeSystem_generic(inRealTime, MIDI_USB_HOST); } */ #endif // MIDI_DEVICE_USB_HOST - /***************************************** MIDI_DEVICE_USB *****************************************/ #ifdef MIDI_DEVICE_USB -void handleNoteOn_MIDI_DEVICE_USB(byte inChannel, byte inNumber, byte inVelocity) -{ - handleNoteOn(inChannel, inNumber, inVelocity); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] NoteOn")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendNoteOn(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendNoteOn(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif -} - -void handleNoteOff_MIDI_DEVICE_USB(byte inChannel, byte inNumber, byte inVelocity) -{ - handleNoteOff(inChannel, inNumber, inVelocity); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] NoteOff")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendNoteOff(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendNoteOff(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif -} - -void handleControlChange_MIDI_DEVICE_USB(byte inChannel, byte inData1, byte inData2) +void handleNoteOn_MIDI_DEVICE_USB(byte inChannel, byte inNoteNumber, byte inVelocity) { - handleControlChange(inChannel, inData1, inData2); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] CC")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendControlChange(inData1, inData2, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendControlChange(inData1, inData2, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif -} - -void handleAfterTouch_MIDI_DEVICE_USB(byte inChannel, byte inPressure) -{ - handleAfterTouch(inChannel, inPressure); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] AT")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendAfterTouch(inPressure, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendAfterTouch(inPressure, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif -} - -void handlePitchBend_MIDI_DEVICE_USB(byte inChannel, int inPitch) -{ - handlePitchBend(inChannel, inPitch); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] PB")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendPitchBend(inPitch, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendPitchBend(inPitch, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOn); +} +void handleNoteOff_MIDI_DEVICE_USB(byte inChannel, byte inNoteNumber, byte inVelocity) +{ + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOff); +} +void handleControlChange_MIDI_DEVICE_USB(byte inChannel, byte inData1, byte inData2) +{ + handle_generic(inChannel, inData1, inData2, MIDI_BY_USB, midi::ControlChange); +} +void handleAfterTouch_MIDI_DEVICE_USB(byte inChannel, byte inPressure) +{ + handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB, midi::AfterTouchChannel); +} +void handlePitchBend_MIDI_DEVICE_USB(byte inChannel, int inPitch) +{ + handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB, midi::PitchBend); } - void handleProgramChange_MIDI_DEVICE_USB(byte inChannel, byte inProgram) { - handleProgramChange(inChannel, inProgram); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] PC")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendProgramChange(inProgram, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendProgramChange(inProgram, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB, midi::ProgramChange); +} +void handleAfterTouchPoly_MIDI_DEVICE_USB(byte inChannel, byte inNoteNumber, byte inVelocity) +{ + handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::AfterTouchPoly); } - void handleSystemExclusive_MIDI_DEVICE_USB(byte * data, uint len) { - handleSystemExclusive(data, len); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] SysEx")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendSysEx(len, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendSysEx(len, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemExclusive_generic(data, len, MIDI_BY_USB); } - -/* void handleSystemExclusiveChunk_MIDI_DEVICE_USB(byte *data, uint len, bool last) +/* FLASHMEM void handleSystemExclusiveChunk_MIDI_DEVICE_USB(byte *data, uint len, bool last) { handleSystemExclusiveChunk(data, len, last); #ifdef DEBUG @@ -1291,293 +719,48 @@ void handleSystemExclusive_MIDI_DEVICE_USB(byte * data, uint len) Serial.println(); #endif } */ - void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB(midi::DataByte data) { - handleTimeCodeQuarterFrame(data); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] TimeCodeQuarterFrame")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendTimeCodeQuarterFrame(data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendTimeCodeQuarterFrame(0xF1, data); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif -} - -void handleAfterTouchPoly_MIDI_DEVICE_USB(byte inChannel, byte inNumber, byte inVelocity) -{ - handleAfterTouchPoly(inChannel, inNumber, inVelocity); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] AT-Poly")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendAfterTouch(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendAfterTouch(inNumber, inVelocity, inChannel); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic(data, MIDI_BY_USB, midi::TimeCodeQuarterFrame); } - void handleSongSelect_MIDI_DEVICE_USB(byte inSong) { - handleSongSelect(inSong); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] SongSelect")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendSongSelect(inSong); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendSongSelect(inSong); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic(inSong, MIDI_BY_USB, midi::SongSelect); } - void handleTuneRequest_MIDI_DEVICE_USB(void) { - handleTuneRequest(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] TuneRequest")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendTuneRequest(); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendTuneRequest(); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleSystemCommon_generic('\0', MIDI_BY_USB, midi::TuneRequest); } - void handleClock_MIDI_DEVICE_USB(void) { - handleClock(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] Clock")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Clock); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Clock); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB, midi::Clock); } - void handleStart_MIDI_DEVICE_USB(void) { - handleStart(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] Start")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Start); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Start); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB, midi::Start); } - void handleContinue_MIDI_DEVICE_USB(void) { - handleContinue(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] Continue")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Continue); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Continue); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB, midi::Continue); } - void handleStop_MIDI_DEVICE_USB(void) { - handleStop(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] Stop")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::Stop); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::Stop); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB, midi::Stop); } - void handleActiveSensing_MIDI_DEVICE_USB(void) { - handleActiveSensing(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] ActiveSensing")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::ActiveSensing); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::ActiveSensing); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB, midi::ActiveSensing); } - void handleSystemReset_MIDI_DEVICE_USB(void) { - handleSystemReset(); -#ifdef DEBUG - Serial.print(F("[MIDI_USB] SystemReset")); -#endif - if (configuration.sys.soft_midi_thru == 1) - { -#ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime(midi::SystemReset); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); -#endif -#endif -#ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(midi::SystemReset); -#ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); -#endif -#endif - } -#ifdef DEBUG - Serial.println(); -#endif + handleRealtime_generic(MIDI_BY_USB, midi::SystemReset); } - -/* void handleRealTimeSystem_MIDI_DEVICE_USB(byte inRealTime) +/* FLASHMEM void handleRealTimeSystem_MIDI_DEVICE_USB(byte inRealTime) { - handleRealTimeSystem(); - #ifdef DEBUG - Serial.print(F("[MIDI_USB] RealTimeSystem")); - #endif - #ifdef MIDI_DEVICE_DIN - midi_serial.sendRealTime((midi::MidiType)inRealTime); - #ifdef DEBUG - Serial.print(F(" THRU->MIDI_DIN")); - #endif - #endif - #ifdef MIDI_DEVICE_USB_HOST - midi_usb.sendRealTime(inRealTime); - #ifdef DEBUG - Serial.print(F(" THRU->MIDI_USB_HOST")); - #endif - #endif - } - #ifdef DEBUG - Serial.println(); - #endif + handleRealTimeSystem_generic(inRealTime, USB_MIDI); } */ #endif // MIDI_DEVICE_USB - -void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value) +FLASHMEM void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value) { #ifdef DEBUG Serial.print(F("[MD] SendControlChange CH:")); @@ -1609,11 +792,10 @@ void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value) Serial.println(); #endif } - /***************************************** - HELPER FUCNTIONS + HELPER FUNCTIONS *****************************************/ -void setup_midi_devices(void) +FLASHMEM void setup_midi_devices(void) { #ifdef MIDI_DEVICE_DIN // Start serial MIDI @@ -1641,7 +823,6 @@ void setup_midi_devices(void) Serial.println(F("MIDI_DEVICE_DIN enabled")); #endif #endif - // start up USB host #ifdef MIDI_DEVICE_USB_HOST usb_host.begin(); @@ -1668,7 +849,6 @@ void setup_midi_devices(void) Serial.println(F("MIDI_DEVICE_USB_HOST enabled.")); #endif #endif - // check for onboard USB-MIDI #ifdef MIDI_DEVICE_USB usbMIDI.begin(); @@ -1696,8 +876,7 @@ void setup_midi_devices(void) #endif #endif } - -void check_midi_devices(void) +FLASHMEM void check_midi_devices(void) { #ifdef MIDI_DEVICE_DIN midi_serial.read(); @@ -1710,12 +889,10 @@ void check_midi_devices(void) midi_usb.read(); #endif } - -void send_sysex_voice(uint8_t midi_channel, uint8_t* data) +FLASHMEM void send_sysex_voice(uint8_t midi_channel, uint8_t* data) { uint8_t checksum = 0; uint8_t vd[161]; - // Send SYSEX data also via MIDI //vd[0] = 0xF0; // SysEx start vd[0] = 0x43; // ID=Yamaha @@ -1730,29 +907,36 @@ void send_sysex_voice(uint8_t midi_channel, uint8_t* data) } vd[160] = checksum & 0x7f; // Checksum //vd[162] = 0xF7; // SysEx end - +#ifdef MIDI_DEVICE_DIN midi_serial.sendSysEx(161, vd); // Send to DIN MIDI - midi_usb.sendSysEx(161, vd); // Send to USB MIDI - usbMIDI.sendSysEx(161, vd); // Send to USB-HOST MIDI +#endif +#ifdef MIDI_DEVICE_USB + usbMIDI.sendSysEx(161, vd); // Send to USB MIDI +#endif +#ifdef MIDI_DEVICE_USB_HOST + midi_usb.sendSysEx(161, vd); // Send to USB-HOST MIDI +#endif } - -void send_sysex_bank(uint8_t midi_channel, uint8_t* bank_data) +FLASHMEM void send_sysex_bank(uint8_t midi_channel, uint8_t* bank_data) { #ifdef MIDI_DEVICE_DIN midi_serial.sendSysEx(4104, bank_data); // Send to DIN MIDI #endif #ifdef MIDI_DEVICE_USB - midi_usb.sendSysEx(4104, bank_data); // Send to USB MIDI + // Sysex bank dump is splitted due to Windows USB driver limitations + usbMIDI.sendSysEx(2048, bank_data, true); // Send to USB MIDI + delay(50); + usbMIDI.sendSysEx(2048, bank_data+2048, true); + delay(50); + usbMIDI.sendSysEx(8, bank_data+4096, true); #endif #ifdef MIDI_DEVICE_USB_HOST - usbMIDI.sendSysEx(4104, bank_data); // Send to USB-HOST MIDI + midi_usb.sendSysEx(4104, bank_data); // Send to USB-HOST MIDI #endif } - -void send_sysex_param(uint8_t midi_channel, uint8_t var, uint8_t val, uint8_t param_group) +FLASHMEM void send_sysex_param(uint8_t midi_channel, uint8_t var, uint8_t val, uint8_t param_group) { uint8_t s[5]; - s[0] = 0x43; // ID=Yamaha s[1] = midi_channel; // Sub-status and MIDI channel s[2] = (param_group & 5) << 2; // Format number (0=1 voice) @@ -1766,15 +950,14 @@ void send_sysex_param(uint8_t midi_channel, uint8_t var, uint8_t val, uint8_t pa s[3] = var & 0x7f; } s[4] = val & 0x7f; - #ifdef MIDI_DEVICE_DIN midi_serial.sendSysEx(5, s); // Send to DIN MIDI #endif #ifdef MIDI_DEVICE_USB - midi_usb.sendSysEx(5, s); // Send to USB MIDI + usbMIDI.sendSysEx(5, s); // Send to USB MIDI #endif #ifdef MIDI_DEVICE_USB_HOST - usbMIDI.sendSysEx(5, s); // Send to USB-HOST MIDI + midi_usb.sendSysEx(5, s); // Send to USB-HOST MIDI #endif } diff --git a/sequencer.cpp b/sequencer.cpp deleted file mode 100644 index 4071474..0000000 --- a/sequencer.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/* - MicroDexed - - MicroDexed is a port of the Dexed sound engine - (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield. - Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android - - (c)2021-2022 H. Wirtz , M. Koslowski - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "config.h" -#include "sequencer.h" -#include -#include - -extern LCDMenuLib2 LCDML; -//extern LiquidCrystal_I2C lcd; -extern config_t configuration; -extern uint8_t drum_midi_channel; -extern uint8_t activesample; -extern uint8_t get_sample_note(uint8_t sample); -extern void handleNoteOn(byte , byte , byte ); -extern void handleNoteOff(byte , byte , byte ); -extern void UI_func_seq_pattern_editor(uint8_t); -extern void UI_func_arpeggio(uint8_t); -extern const char* seq_find_shortname(uint8_t); -extern void set_sample_pitch (uint8_t, float); //float32_t not working -extern float get_sample_vol_max(uint8_t); -extern float get_sample_p_offset(uint8_t); -boolean interrupt_swapper = false; - -sequencer_t seq; - -void seq_live_recording(void) -{ - //record to sequencer if sequencer menu is active and recording is active - if (seq.note_in > 0 && seq.recording == true && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor)) - { - seq.note_data[seq.active_track][seq.step] = seq.note_in; - if ( get_sample_note(activesample) > 209 ) // pitched sample - { - seq.vel[seq.active_track][seq.step] = get_sample_note(activesample); - } - else - seq.vel[seq.active_track][seq.step] = seq.note_in_velocity; - - seq.note_in = 0; - seq.note_in_velocity = 0; - } -} -void sequencer_part1(void) -{ - //if (seq.note_in > 0 && seq.note_in < 62 && seq.recording == false ) { - //handleNoteOff(configuration.dexed[0].midi_channel, seq.note_data[3][seq.step] + seq.transpose , 0); - //handleNoteOff(configuration.dexed[0].midi_channel, seq.note_data[3][seq.step - 1] + seq.transpose , 0); - //if (seq.note_in>65)seq.note_in=seq.note_in-12; - //seq.transpose = seq.note_in % 12 ; - //seq.transpose=seq.transpose-12; - //seq.note_in = 0; - //} - - seq_live_recording(); - for (uint8_t d = 0; d < NUM_SEQ_TRACKS; d++) - { - if (seq.patternchain[seq.chain_active_step][d] < NUM_SEQ_PATTERN ) // sequence not empty or muted - { - if ( seq.track_type[d] == 0) - { // drum track (drum samples and pitched one-shot samples) - if (seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] > 0 ) - { - if (seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] > 209) // it is a pitched sample - { - // Drum[slot]->setPlaybackRate( pow (2, (inNote - 72) / 12.00) * drum_config[sample].pitch ); get_sample_vol_max(sample) - set_sample_pitch(seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 210 , (float)pow (2, (seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 72) / 12.00) * get_sample_p_offset( seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 210 ) ); - handleNoteOn(drum_midi_channel, seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] , 90 ); - } - else // else play normal drum sample - handleNoteOn(drum_midi_channel, seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] , seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step]); - } - } - else { - if (seq.note_data[seq.patternchain[seq.chain_active_step][d]][seq.step] > 0 ) // instrument track - { - if (seq.track_type[d] == 1 || (seq.track_type[d] == 3 && seq.arp_play_basenote) ) - { - if (seq.note_data[seq.patternchain[seq.chain_active_step][d]][seq.step] != 130 ) - { - handleNoteOn(configuration.dexed[seq.inst_dexed[d]].midi_channel, seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step], seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step]); - seq.prev_note[d] = seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step]; - seq.prev_vel[d] = seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step]; - } - } - else if (seq.track_type[d] == 2 ) //Chords - { - if (seq.vel[ seq.patternchain[seq.chain_active_step][d]][seq.step] > 199) - { - - //handleNoteOn(configuration.dexed[seq.inst_dexed[d]].midi_channel, seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step], seq.chord_velocity); // basenote - - for (uint8_t x = seq.element_shift; x < seq.element_shift + seq.chord_key_ammount; x++) //play chord notes - { - handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] + (seq.oct_shift * 12) + seq.arps[seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 200][x], seq.chord_velocity); - } - seq.prev_note[d] = seq.note_data[seq.patternchain[seq.chain_active_step][d]][seq.step] + (seq.oct_shift * 12); - seq.prev_vel[d] = seq.vel[seq.patternchain[seq.chain_active_step][d]][seq.step]; - } - } - if (seq.track_type[d] == 3) { //Arp - seq.arp_step = 0; - seq.arp_counter = 0; - seq.arp_note = seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] + (seq.oct_shift * 12); - seq.arp_chord = seq.vel[seq.patternchain[seq.chain_active_step][d] ][seq.step] - 200; - } - } - - // after here not triggered by a key input - arp only - if (seq.track_type[d] == 3) - { //Arp - if (seq.arp_speed == 0 || (seq.arp_speed == 1 && seq.arp_counter == 0) ) { - - { if (seq.arp_style == 0) { //arp up - handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step + seq.element_shift], seq.chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step + seq.element_shift] ; - } - else if (seq.arp_style == 1) { //arp down - handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght - seq.arp_step + seq.element_shift], seq.chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght - seq.arp_step + seq.element_shift] ; - } - else if (seq.arp_style == 2) { //arp up & down - if (seq.arp_step <= seq.arp_lenght) { - handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step ], seq.chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step ] ; - } - else { - handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght * 2 - seq.arp_step ], seq.chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght * 2 - seq.arp_step ] ; - } - } - else if (seq.arp_style == 3) { //arp random - uint8_t rnd1 = random(seq.arp_lenght); - handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][rnd1 + seq.element_shift] + (seq.oct_shift * 12), seq.chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][rnd1 + seq.element_shift] + (seq.oct_shift * 12); - } - } - } - } - } - } - seq.noteoffsent[d] = false; - } - seq.arp_counter++; - seq.step++; - if (seq.arp_speed == 0) // Arp Speed 1/16 - { - seq.arp_step++; - } - else - { - // Arp Speed 1/8 - if (seq.arp_counter > 1) { - seq.arp_counter = 0; - seq.arp_step++; - } - } - - if (seq.arp_style != 2) { - - if ( (seq.arp_step > 1 && seq.arps[seq.arp_chord][seq.arp_step] == 0) || seq.arp_step == seq.arp_lenght) - { - seq.arp_step = 0; - } - } - if (seq.arp_style == 1 || seq.arp_style == 2 ) - { - if (seq.arp_lenght == 0)seq.arp_lenght = 9; - - } - if ( seq.arp_style == 2 ) //only for up&down - { - if ( (seq.arp_step > 1 && seq.arps[seq.arp_chord][seq.arp_step] == 0) || seq.arp_step == seq.arp_lenght * 2) - { - seq.arp_step = 0; - } - - } - if (seq.step > 15) - { - seq.step = 0; - if (seq.chain_lenght > 0) { - seq.chain_active_step++; - if (seq.chain_active_step > seq.chain_lenght) - { - seq.chain_active_step = 0; - } - } - } -} - -void sequencer_part2(void) -{ - seq_live_recording(); - for (uint8_t d = 0; d < NUM_SEQ_TRACKS; d++) - { - if (seq.noteoffsent[d] == false) { - if ( seq.prev_note[d] > 0 && seq.track_type[d] > 0) - { - if (seq.note_data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] != 130) - { - handleNoteOff(configuration.dexed[seq.inst_dexed[d]].midi_channel, seq.prev_note[d] , 0); - seq.noteoffsent[d] = true; - } - if (seq.track_type[d] == 2) { //Chords - if ( seq.prev_vel[d] > 199) { - for (uint8_t x = seq.element_shift; x < seq.element_shift + seq.chord_key_ammount; x++) //play chord notes - { - handleNoteOff(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.prev_note[d] + seq.arps[seq.prev_vel[d] - 200][x], 0); - seq.noteoffsent[d] = true; - } - } - } - else if (seq.track_type[d] == 3) - { //Arp - handleNoteOff(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note_prev, 0); - seq.noteoffsent[d] = true; - } - } - } - } -} -void sequencer(void) -{ // Runs in Interrupt Timer. Switches between the Noteon and Noteoff Task, each cycle - - interrupt_swapper = !interrupt_swapper; - - if (interrupt_swapper) sequencer_part1(); - else sequencer_part2(); -} diff --git a/sequencer.h b/sequencer.h deleted file mode 100644 index a02739c..0000000 --- a/sequencer.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - MicroDexed - - MicroDexed is a port of the Dexed sound engine - (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield. - Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android - - (c)2018-2022 H. Wirtz - (c)2021-2022 H. Wirtz , M. Koslowski - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _SEQUENCER_H -#define _SEQUENCER_H - -typedef struct sequencer_s -{ - bool midi_learn_active = false; - float drums_volume; - uint8_t active_track = 0; - uint8_t menu; - bool noteoffsent[NUM_SEQ_TRACKS] = {false, false, false, false, false, false}; - uint8_t inst_dexed[NUM_SEQ_TRACKS] = { 0, 0, 1, 1 , 1, 1 }; - uint8_t step = 0; - bool running = false; - bool recording = false; - bool smartfilter = true; - uint8_t state_last_loadsave = 200; - char name[FILENAME_LEN]; - char name_temp[FILENAME_LEN]; - uint8_t note_in; - uint8_t note_in_velocity; - int transpose; - - uint8_t chord_dexed_inst = 0; - uint8_t chord_velocity = 60; - uint8_t chord_key_ammount = 4; - uint8_t element_shift = 0; - int oct_shift = 0; - uint8_t arp_style = 0; // up, down, up&down, random - - const uint8_t arps[6][23] = { - { 0, 4, 7, 12, 16, 19, 24, 28, 31, 36, 40, 43, 48, 52, 55, 60, 64, 67, 72, 76, 79, 84, 0}, //major - { 0, 3, 7, 12, 15, 19, 24, 27, 31, 36, 39, 43, 48, 51, 55, 60, 63, 67, 72, 75, 79, 84, 0}, //minor - { 0, 4, 7, 10, 12, 16, 19, 22, 24, 28, 31, 34, 36, 40, 43, 46, 48, 52, 55, 58, 60, 64, 0}, //seventh - { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 0}, //augmented - { 0, 3, 6, 12, 15, 18, 24, 27, 30, 36, 39, 42, 48, 51, 54, 60, 63, 66, 72, 75, 78, 84, 0}, //dim - { 0, 4, 7, 11, 12, 16, 19, 23, 24, 28, 31, 35, 36, 40, 43, 47, 48, 52, 55, 59, 60, 64, 0} //maj7 - }; - - const char chord_names[7][4] = { - {'M', 'a', 'j', ' '}, //major - {'M', 'i', 'n', ' '}, - {'s', 'e', 'v', ' '}, - {'a', 'u', 'g', ' '}, - {'d', 'i', 'm', ' '}, - { 'M', 'a', 'j', '7'}, - { 'N', 'o', 'C', 'd'} - }; - - const char arp_style_names[4][3] = { - { 'u', 'p', ' '}, - {'d', 'w', 'n'}, - {'u', '&', 'd'}, - {'R', 'N', 'D'} - }; - int tempo_ms = 180000; - int bpm = 102; - uint8_t temp_select_menu; - uint8_t temp_active_menu = 99; - uint8_t chain_active_chainstep; - uint8_t chain_lenght = 3; // 0 = 16 steps, 1 = 32 Steps, 2 = 46 Steps, 3 = 64 Steps - uint8_t chain_active_step = 0; - uint8_t prev_note[NUM_SEQ_TRACKS]; // note_offs for every (instr.) track - uint8_t prev_vel[NUM_SEQ_TRACKS]; - uint8_t arp_step; - uint8_t arp_note; - uint8_t arp_chord = 6; - bool arp_play_basenote = true; - uint8_t arp_note_prev; - uint8_t arp_octave; - uint8_t arp_prev_oct; - uint8_t arp_speed = 0; - uint8_t arp_counter = 0; - uint8_t arp_lenght = 8; - uint8_t data_buffer[16] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; - uint8_t note_data[NUM_SEQ_PATTERN][16] = { - { 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 , 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 , 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 , 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 , 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 } - }; - uint8_t vel[NUM_SEQ_PATTERN][16] = { - { 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, 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, 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, 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, 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 } - }; - uint8_t content_type[NUM_SEQ_PATTERN] = { 0, 0, 0, 0 , 0, 0, 0 , 0 , 0 , 0 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord or Arpeggio - uint8_t patternchain[4][NUM_SEQ_TRACKS] = { - { 0 , 2 , 6 , 9 , 99, 99 }, - { 1 , 2 , 5 , 8 , 99, 99 }, - { 0 , 2 , 6 , 9 , 99, 99 }, - { 1 , 2 , 5 , 7 , 99, 99 } - }; - uint8_t track_type[NUM_SEQ_TRACKS] = { 0, 0, 1, 1, 1, 1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp -} sequencer_t; - -#endif