Update with Holger's latest changes

Merge remote-tracking branch 'upstream/dev' into dev
pull/6/head
Dirk Niggemann 5 years ago
commit 78185214ed
  1. 18
      UI.hpp
  2. 24
      config.h
  3. 10
      effect_stereo_mono.cpp

@ -232,9 +232,9 @@ void setup_ui(void) {
lcd.setFont(u8x8_font_amstrad_cpc_extended_f);
#endif
lcd.setCursor(1, 0);
lcd.print("MicroDexed");
lcd.print(F("MicroDexed"));
lcd.setCursor(0, 1);
lcd.print("(c)parasiTstudio");
lcd.print(F("(c)parasiTstudio"));
#ifdef I2C_DISPLAY
// set special chars for scrollbar
@ -703,7 +703,7 @@ void lcdml_menu_display(void)
}
else {
lcd.setCursor((_LCDML_DISP_cols - 1), n);
lcd.print(' ');
lcd.print(F(" "));
}
}
}
@ -948,7 +948,7 @@ void UI_func_chorus_frequency(uint8_t param)
lcd.setCursor(0, 1);
lcd_display_float(configuration.chorus_frequency / 10.0, 2, 1, false, true, false);
lcd.print(" Hz");
lcd.print(F(" Hz"));
modulator.frequency(configuration.chorus_frequency / 10.0);
}
@ -995,15 +995,15 @@ void UI_func_chorus_waveform(uint8_t param)
{
case 0:
modulator.begin(WAVEFORM_TRIANGLE);
lcd.print("[TRIANGLE]");
lcd.print(F("[TRIANGLE]"));
break;
case 1:
modulator.begin(WAVEFORM_SINE);
lcd.print("[SINE ]");
lcd.print(F("[SINE ]"));
break;
default:
modulator.begin(WAVEFORM_TRIANGLE);
lcd.print("[TRIANGLE]");
lcd.print(F("[TRIANGLE]"));
break;
}
}
@ -1708,9 +1708,9 @@ void UI_func_volume(uint8_t param)
for (uint8_t i = 0; i < LCD_cols; i++)
{
if (i < int((LCD_cols - 2) * configuration.vol / 100.0))
lcd.print("*");
lcd.print(F("*"));
else
lcd.print(" ");
lcd.print(F(" "));
}
lcd.show(1, 0, 1, "[");
lcd.show(1, 15, 1, "]");

@ -45,12 +45,16 @@
//* DEVICE SETTINGS
//*************************************************************************************************
// MIDI
//*************************************************************************************************
//* MIDI HARDWARE SETTINGS
//*************************************************************************************************
//#define MIDI_DEVICE_DIN Serial1
#define MIDI_DEVICE_USB 1
#define MIDI_DEVICE_USB_HOST 1
// AUDIO
//*************************************************************************************************
//* AUDIO HARDWARE SETTINGS
//*************************************************************************************************
// If nothing is defined Teensy internal DAC is used as audio output device!
// Left and right channel audio signal is presented on pins A21 and A22.
#define AUDIO_DEVICE_USB
@ -62,9 +66,8 @@
#define PT8211_AUDIO
//*************************************************************************************************
//* MIDI SETTINGS
//* MIDI SOFTWARE SETTINGS
//*************************************************************************************************
#define DEFAULT_MIDI_CHANNEL MIDI_CHANNEL_OMNI
#define MIDI_MERGE_THRU 1
#define SYSEXBANK_DEFAULT 0
@ -83,7 +86,7 @@
//#define USE_REVERB 1
//*************************************************************************************************
//* AUDIO SETTINGS
//* AUDIO SOFTWARE SETTINGS
//*************************************************************************************************
// https://rechneronline.de/funktionsgraphen/
#ifndef TEENSY_AUDIO_BOARD
@ -142,7 +145,6 @@
#endif
#define CONTROL_RATE_MS 50
#define BACK_FROM_VOLUME_MS 1000
//*************************************************************************************************
@ -157,7 +159,6 @@
//*************************************************************************************************
//* HARDWARE SETTINGS
//*************************************************************************************************
#if defined(__IMXRT1062__) //Teensy-4.0
#define TEENSY4
#endif
@ -249,9 +250,8 @@
// Some optimizations
#define USE_TEENSY_DSP 1
#define SUM_UP_AS_INT 1
/* HELPER MACROS */
// HELPER MACROS
#define TIME_MS2SAMPLES(x) floor(uint32_t(x) * AUDIO_SAMPLE_RATE / 1000)
#define SAMPLES2TIME_MS(x) float(uint32_t(x) * 1000 / AUDIO_SAMPLE_RATE)
// Modulated delay options
@ -368,12 +368,6 @@ struct config_t {
uint8_t engine;
};
// struct for smoothing value changes
struct value_change_t {
float diff;
uint16_t steps;
};
inline float mapfloat(float val, float in_min, float in_max, float out_min, float out_max)
{
return (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;

@ -45,6 +45,7 @@ void AudioEffectStereoMono::update(void)
{
if (block[0] && block[1])
{
#ifdef USE_OLD_STEREO_TO_MONO
int16_t *bp[2] = { block[0]->data, block[1]->data };
for (uint16_t i = 0; i < AUDIO_BLOCK_SAMPLES; i++)
@ -54,6 +55,15 @@ void AudioEffectStereoMono::update(void)
bp[0]++;
bp[1]++;
}
#else
// device every channel by 2
arm_shift_q15(block[0]->data, -1, block[0]->data, AUDIO_BLOCK_SAMPLES);
arm_shift_q15(block[1]->data, -1, block[1]->data, AUDIO_BLOCK_SAMPLES);
// add channel 2 to channel 1
arm_add_q15(block[0]->data, block[1]->data, block[0]->data, AUDIO_BLOCK_SAMPLES);
// copy channel 1 to channel 2
arm_copy_q15(block[0]->data, block[1]->data, AUDIO_BLOCK_SAMPLES);
#endif
}
}

Loading…
Cancel
Save