From b6e8006b6a45bd49ac851feb65daa5c70e050233 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Fri, 6 Aug 2021 11:50:14 +0200 Subject: [PATCH] Fixes for schowing the sample filenames. --- MicroDexed.ino | 67 ++++++++++++++++++++++++++++++++++++++++++++++---- UI.hpp | 14 ++++------- config.h | 2 +- drums.cpp | 2 +- drums.h | 2 +- 5 files changed, 70 insertions(+), 17 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 31c465e..fa63663 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -109,9 +109,66 @@ AudioMixer8 drum_reverb_send_mixer_l; #endif #endif - -//AudioConnection patchCord[] = { -// {wavetable[0], 0, mixer[0], 0}, {wavetable[1], 0, mixer[0], 1}, {wavetable[2], 0, mixer[0], 2}, {wavetable[3], 0, mixer[0], 3}, {mixer[0], 0, mixer[TOTAL_MIXERS - 2], 0}, +/* + AudioConnection patchCord[] = { + // Audio chain tail + #if defined(USE_FX) + #ifdef USE_PLATEREVERB + {reverb_mixer_r, 0, reverb, 0}, + {reverb_mixer_l, 0, reverb, 1}, + {reverb, 0, master_mixer_r, 3}, + {reverb, 1, master_mixer_l, 3}, + #else + {reverb_mixer_r, 0, freeverb, 0}, + {reverb_mixer_l, 0, freeverb, 1}, + {freeverb, 0, master_mixer_r, 3}, + {freeverb, 1, master_mixer_l, 3}, + #endif + #endif + {master_mixer_r,0, volume_r,0}, + {master_mixer_l,0, volume_l,0}, + {volume_r, 0, stereo2mono, 0}, + {volume_l, 0, stereo2mono, 1}, + {stereo2mono, 0, master_peak_r, 0}, + {stereo2mono, 0, master_peak_l, 0}, + + // Outputs + #if defined(TEENSY_AUDIO_BOARD) + #ifndef SGTL5000_AUDIO_THRU + {stereo2mono, 0, i2s1, 0}, + {stereo2mono, 1, i2s1, 1}, + #endif + #elif defined (I2S_AUDIO_ONLY) +AudioOutputI2S i2s1; +AudioConnection patchCord10(stereo2mono, 0, i2s1, 0); +AudioConnection patchCord11(stereo2mono, 1, i2s1, 1); +#elif defined(TGA_AUDIO_BOARD) +AudioOutputI2S i2s1; +AudioConnection patchCord10(stereo2mono, 0, i2s1, 0); +AudioConnection patchCord11(stereo2mono, 1, i2s1, 1); +AudioControlWM8731master wm8731_1; +#elif defined(PT8211_AUDIO) +AudioOutputPT8211 pt8211_1; +AudioConnection patchCord10(stereo2mono, 0, pt8211_1, 0); +AudioConnection patchCord11(stereo2mono, 1, pt8211_1, 1); +#elif defined(TEENSY_DAC_SYMMETRIC) +AudioOutputAnalogStereo dacOut; +AudioMixer4 invMixer; +AudioConnection patchCord10(stereo2mono, 0, dacOut , 0); +AudioConnection patchCord11(stereo2mono, 1, invMixer, 0); +AudioConnection patchCord12(invMixer, 0, dacOut , 1); +#elif defined(TEENSY_DAC) +AudioOutputAnalogStereo dacOut; +AudioConnection patchCord10(stereo2mono, 0, dacOut, 0); +AudioConnection patchCord11(stereo2mono, 1, dacOut, 1); +#endif +#ifdef AUDIO_DEVICE_USB +AudioOutputUSB usb1; +AudioConnection patchCord13(stereo2mono, 0, usb1, 0); +AudioConnection patchCord14(stereo2mono, 1, usb1, 1); +#endif + +*/ // Audio chain tail #if defined(USE_FX) @@ -137,11 +194,11 @@ AudioConnection patchCord9(stereo2mono, 0, master_peak_l, 0); // Outputs #if defined(TEENSY_AUDIO_BOARD) AudioOutputI2S i2s1; +AudioControlSGTL5000 sgtl5000_1; #ifndef SGTL5000_AUDIO_THRU AudioConnection patchCord10(stereo2mono, 0, i2s1, 0); AudioConnection patchCord11(stereo2mono, 1, i2s1, 1); #endif -AudioControlSGTL5000 sgtl5000_1; #elif defined (I2S_AUDIO_ONLY) AudioOutputI2S i2s1; AudioConnection patchCord10(stereo2mono, 0, i2s1, 0); @@ -777,7 +834,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) drum_reverb_send_mixer_r.gain(slot, (1.0 - fsin) * pseudo_log_curve(drum_config[d].reverb_send)); drum_reverb_send_mixer_l.gain(slot, fsin * pseudo_log_curve(drum_config[d].reverb_send)); - char f[DRUM_CFG_GILENAME_LEN]; + char f[DRUM_CFG_FILENAME_LEN]; strcpy(f, drum_config[d].filename); strcat(f, ".wav"); diff --git a/UI.hpp b/UI.hpp index 92f8427..0221b54 100644 --- a/UI.hpp +++ b/UI.hpp @@ -3614,8 +3614,7 @@ void UI_func_drum_reverb_send(uint8_t param) lcd.setCursor(1, 1); sprintf(displayname, "%02d", activesample); lcd.print(displayname); - lcd.setCursor(4, 1); - lcd.print(basename(drum_config[activesample].filename)); + lcd.show(4, 1, 6, basename(drum_config[activesample].filename)); sprintf(displayname, "%03d", (int)(drum_config[activesample].reverb_send * 100) ); lcd.setCursor(12, 1); lcd.print(displayname); @@ -3702,8 +3701,7 @@ void UI_func_drum_volume(uint8_t param) lcd.setCursor(1, 1); sprintf(displayname, "%02d", activesample); lcd.print(displayname); - lcd.setCursor(4, 1); - lcd.print(basename(drum_config[activesample].filename)); + lcd.show(1, 4, 6, basename(drum_config[activesample].filename)); sprintf(displayname, "%03d", (int)(drum_config[activesample].vol_max * 100) ); lcd.setCursor(12, 1); lcd.print(displayname); @@ -3790,8 +3788,7 @@ void UI_func_drum_pan(uint8_t param) lcd.setCursor(1, 1); sprintf(displayname, "%02d", activesample); lcd.print(displayname); - lcd.setCursor(4, 1); - lcd.print(basename(drum_config[activesample].filename)); + lcd.show(1, 4, 6, basename(drum_config[activesample].filename)); sprintf(displayname, "%+f", drum_config[activesample].pan); lcd.setCursor(12, 1); lcd.print(displayname); @@ -3940,7 +3937,7 @@ void UI_func_sequencer(uint8_t param) seq_note_in = 0; // setup function lcd.setCursor(1, 0); - lcd.print(basename(drum_config[activesample].filename)); + lcd.show(0, 1, 6, basename(drum_config[activesample].filename)); lcd.setCursor(9, 0); if (seq_running == false && seq_recording == false) { @@ -4061,8 +4058,7 @@ void UI_func_sequencer(uint8_t param) lcd.print("["); if (activesample < num_drums) { - lcd.setCursor(1, 0); - lcd.print(basename(drum_config[activesample].filename)); + lcd.show(0, 1, 6, basename(drum_config[activesample].filename)); } else if (activesample == num_drums) { lcd.setCursor(1, 0); lcd.print("EMPTY "); diff --git a/config.h b/config.h index c32ace2..f4bd917 100644 --- a/config.h +++ b/config.h @@ -281,7 +281,7 @@ #define BANK_NAME_LEN 11 // 10 (plus '\0') #define VOICE_NAME_LEN 12 // 11 (plus '\0') #define FILENAME_LEN BANK_NAME_LEN + VOICE_NAME_LEN -#define DRUM_CFG_GILENAME_LEN 42 +#define DRUM_CFG_FILENAME_LEN 42 #define FX_CONFIG_PATH "FXCFG" #define FX_CONFIG_NAME "FXCFG" diff --git a/drums.cpp b/drums.cpp index e45c960..108eaf9 100644 --- a/drums.cpp +++ b/drums.cpp @@ -91,7 +91,7 @@ uint8_t read_drum_config(const char* drumset) { sprintf(drum_config[drum].filename, "%s/%s", ds, kv.key().c_str()); - char f[DRUM_CFG_GILENAME_LEN]; + char f[DRUM_CFG_FILENAME_LEN]; strcpy(f, drum_config[drum].filename); strcat(f, ".wav"); diff --git a/drums.h b/drums.h index 4b2976a..437e003 100644 --- a/drums.h +++ b/drums.h @@ -36,7 +36,7 @@ uint8_t read_drum_config(const char* drumset); typedef struct drum_config_s { uint8_t drum_class; // Type of drum uint8_t midinote; // Triggered by note - char filename[28]; // 44.1kHz mono LSB wav-sample + char filename[DRUM_CFG_FILENAME_LEN]; // 44.1kHz mono LSB wav-sample char shortname[2]; // 1 char name for sequencer float32_t pan; // Panorama (-1.0 - +1.0) float32_t vol_max; // max. Volume (0.0 - 1.0)