From cd21e4e45e39cb39b992c7f78296f4e280fe2c47 Mon Sep 17 00:00:00 2001 From: yuquanjun Date: Wed, 9 Sep 2026 11:35:14 +0800 Subject: [PATCH] Always enable loop on universal-mode pick so accompaniment can play. Without SetLoopMode the piece path often produced no audible output when the chord pad was not held. Co-authored-by: Cursor --- APP/app_log.c | 14 ++++++++++++++ Global/Global.c | 30 +++++++++++------------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/APP/app_log.c b/APP/app_log.c index a4f37b7..860322a 100644 --- a/APP/app_log.c +++ b/APP/app_log.c @@ -381,6 +381,20 @@ uint8_t app_log_try_command(const char *cmd) return 1U; } if (strncmp(cmd, "tone pick", 9) == 0) { + /* tone pick uni → 万能;默认仍测专业+本地曲目 */ + if (cmd[9] == ' ' && (cmd[10] == 'u' || cmd[10] == 'U')) { + mGuiData[GUI_TAB_INDEX].Current = 0; + mGuiData[GUI_AUTOBAND_SW].Current = 0; + UI_ApplyToneAddress(); + AutoBandTop1_Stop(); + StartFlag = 0; + (void)AutoBandTop1_LoadPresetItemFromFlash(ParamGuiData[ALL_MODE_PARAM].Current); + KEY_ID_1629 = 0; + PressFlag = 0; + Pick_Handle(); + SEGGER_RTT_WriteString(APP_LOG_RTT_CHANNEL, "TONE_PICK_UNI_DONE\n"); + return 1U; + } /* 模拟专业+本地曲目拨片(无和弦板) */ mGuiData[GUI_TAB_INDEX].Current = 1; mGuiData[GUI_AUTOBAND_SW].Current = 1; diff --git a/Global/Global.c b/Global/Global.c index b94513e..3d8b500 100644 --- a/Global/Global.c +++ b/Global/Global.c @@ -783,15 +783,10 @@ void Pick_Handle() AutoBandTop1_SetLoopMode(0,1); break; case 0: - if(PressFlag) - { - AutoBandTop1_SetLoopMode(0,1); - AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt); - }else - { - AutoBandTop1_SetPiecePlayMode(1,0,480); - AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt); - } + /* 设置页内沿用万能:与主路径一致,始终 loop */ + AutoBandTop1_SetPiecePlayMode(1, 0, 480); + AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt); + AutoBandTop1_SetLoopMode(0, 1); StartFlag = 1; break; } @@ -842,17 +837,14 @@ void Pick_Handle() } break; case 0: + /* 万能:和弦走向用 piece 模式;须 SetLoopMode,否则无循环时常听不到伴奏 */ StartFlag = 1; - if(PressFlag) - { - AutoBandTop1_SetPiecePlayMode(1,0,480); - AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt); - AutoBandTop1_SetLoopMode(0,1); - }else - { - AutoBandTop1_SetPiecePlayMode(1,0,480); - AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt); - } + AutoBandTop1_SetPiecePlayMode(1, 0, 480); + AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt); + AutoBandTop1_SetLoopMode(0, 1); + LOG_I("pick", "universal piece name=%s press=%u notes=%u chord=%u", + AutoBandTop1_GetPresetName() ? AutoBandTop1_GetPresetName() : "?", + (unsigned)PressFlag, (unsigned)note_cnt, (unsigned)chord_id); break; } }