【Open-Source】Reverb and Echo Control for Mixing Console Microphone Based on T5L
——From DWIN Developer Forum
We are pleased to present an award-winning open-source case from the DWIN Developer Forum today: reverb and echo control for mixing console microphone based on the T5L chip. Our engineer uses an 800x480 resolution display to interact with the reverb development board through the UART 4 of T5L, enabling precise adjustment of critical audio parameters such as reverb, echo, wet sound, dry sound, acoustic, decay and delay for superior audio effects.
[UI Materials]
[GUI Project Design]
【C51 Project】
(1) The main program for the screen is as follows:
void main(){
INIT_CPU();//System Initialisation
PORT_Init();//Initialize IO port
T0_Init();//Initialize timer 0
T2_Init();//Initialize timer 2
my_UART4_Init(115200);
uart_init();//Initialize serial port
ws2812_writ_byte(8);//Initialize LED light
RetMicSet();
delay_ms(1000);
ChangePage(1);
while(1){
Uart_Handle_all();
OneMsHandle();//1Ms each time
TenMsHandle();
Read_0xF00();//Data automatic upload
}
}
void TenMsHandle(void)
{
if(!TenmsFlag)
return;
TenmsFlag=0;
HunX_Wet();
HunX_Dry();
HunX_WeiYing();
HunX_ShuaiJian();
HunX_Switch();
Echo_Wet();
Echo_Dry();
Echo_Delay();
Echo_ShuaiJian();
Echo_Switch();
}
void HunX_Wet(void)
{
u16readst=0;
readst=Read_Dgus(0x1200);
if(readst==Mic_Set.MicWetNum)
return;
Mic_Set.MicWetNum=readst;
MicEffectSend(Mic_Set.MicWetNum*10,
Mic_Set.MicDryNum*10,
Mic_Set.MicDiffNum*5,
Mic_Set.MicDecayNum*5,
Mic_Set.HunXiangSW);
(2) The reverb-related parameters are as follows
#if 1
intreverb_parameter_val(u16 wet,u16 dry,u8 diffusion,u8 decayfactor,
u8 is_bypass,u8 idmode)
{
#if defined(TCFG_MIC_EFFECT_ENABLE)&& TCFG_MIC_EFFECT_ENABLE
#if 1
u8 mode_id = idmode+5;
Plate_reverb_TOOL_SET *parmt = &eff_mode[mode_id - mic_mode_seq0].plate_reverb_parm;
parmt->parm.wet=wet;
parmt->parm.dry=dry;
parmt->parm.diffusion=diffusion;
parmt->parm.decayfactor=decayfactor;
parmt->is_bypass=is_bypass;
plate_reverb_update_parm(&parmt->parm, parmt->is_bypass);
#elif 1
u8 mode_id = idmode+5;
//memcpy(&eff_mode[mode_id - mic_mode_seq0].echo_parm,&packet->data[1], sizeof(EF_ECHO_TOOL_SET));
EF_ECHO_TOOL_SET *parmt = &eff_mode[mode_id -mic_mode_seq0].echo_parm;
parmt->parm.delay=delay_ms;
echo_updata_parm(&parmt->parm, parmt->is_bypass);
#elif 0//PARM_DEBUG
ECHO_PARM_SET *parm = &parmt->parm;
log_debug("delay%d, decayval %d, filt_enable %d, lpf_cutoff %d, wetgain %d, drygain %d\n",
parm->delay, parm->decayval,parm->filt_enable, parm->lpf_cutoff, parm->wetgain, parm->drygain);
#endif
#endif
return 0;
}
(3) The echo-related parameters are as follows:
int Echo_parameter_val(u16 wet,u16 dry,u16 delay,u16 decayfactor,
u16 is_bypass,u16 idmode)
{
#ifdefined(TCFG_MIC_EFFECT_ENABLE) &&TCFG_MIC_EFFECT_ENABLE
#ifTCFG_MIC_EFFECT_SEL==MIC_EFFECT_REVERB_ECHO
u8 mode_id = idmode+5;
EF_ECHO_TOOL_SET*parmt = &eff_mode[mode_id - mic_mode_seq0].echo_parm;
parmt->parm.wetgain=wet;
parmt->parm.drygain=dry;
parmt->parm.delay=delay;
parmt->parm.decayval=decayfactor;
parmt->is_bypass=is_bypass;
echo_updata_parm(&parmt->parm, parmt->is_bypass);
#endif
return 0;
#endif
}