本期为大家推送迪文开发者论坛获奖开源案例——基于T5L芯片的调音台麦克风混响回声控制。工程师采用800×480分辨率屏幕,通过T5L串口4与混响开发板进行数据交互,精准控制音响的混响、回声、湿声、原声、尾声、衰减、延时等关键参数,实现高品质的音响效果。
UI素材展示
GUI工程设计
C51工程设计 (1)屏幕主程序如下:
void main(){ INIT_CPU();//系统初始化 PORT_Init();//IO口初始化 T0_Init();//定时器0初始化 T2_Init();//定时器2初始化 my_UART4_Init(115200); uart_init();//串口初始化 ws2812_writ_byte(8);//LED初始化 RetMicSet(); delay_ms(1000); ChangePage(1); while(1){ Uart_Handle_all(); OneMsHandle();//1Ms一次 TenMsHandle(); Read_0xF00();//数据自动上传 }}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)混响相关参数如下:
#if 1intreverb_parameter_val(u16 wet,u16 dry,u8 diffusion,u8 decayfactor, u8 is_bypass,u8 idmode){ #ifdefined(TCFG_MIC_EFFECT_ENABLE)&&TCFG_MIC_EFFECT_ENABLE #if1 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)回声相关参数如下:
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}
-
芯片
+关注
关注
456文章
50935浏览量
424634 -
麦克风
+关注
关注
15文章
641浏览量
54850 -
开源
+关注
关注
3文章
3368浏览量
42567
发布评论请先 登录
相关推荐
评论