Normal mode: pick sounds held chord; release stops accompaniment.

Require left-hand pad held (PressFlag) before pick starts; skip the default I-chord fallback in normal mode. Release (key 0) stops AutoBand immediately instead of looping.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yuquanjun 2026-09-14 12:55:22 +08:00
parent 713a768733
commit f841d9e7b1
1 changed files with 35 additions and 22 deletions

View File

@ -693,20 +693,27 @@ void TM1629_Handle(uint8_t key)
switch(key) switch(key)
{ {
case 0: case 0:
PressFlag = 0; PressFlag = 0;
if(/*StartFlag &&*/ mGuiData[GUI_TAB_INDEX].Current == 0) if(mGuiData[GUI_TAB_INDEX].Current == 2)
{
/* 普通:松手立即结束当前和弦伴奏 */
KEY_ID_1629 = 0;
if (StartFlag)
Stop_AutoBand();
}
else if(mGuiData[GUI_TAB_INDEX].Current == 0)
{ {
//StartFlag = 0; //StartFlag = 0;
//tick_ever_positive = false; //tick_ever_positive = false;
//osTimerStart(Delay_stop_timer,1000); //osTimerStart(Delay_stop_timer,1000);
rt_timer_start(OutTime_Stop_timer); rt_timer_start(OutTime_Stop_timer);
} }
break; break;
case 22:Tap_to_Speed(); break; case 22:Tap_to_Speed(); break;
case 23:Stop_AutoBand(); break; case 23:Stop_AutoBand(); break;
default: // 1 - 21 default: // 1 - 21
if (key >= 1 && key <= 21) if (key >= 1 && key <= 21)
{ {
if(mGuiData[GUI_TAB_INDEX].Current == 0) if(mGuiData[GUI_TAB_INDEX].Current == 0)
{ {
@ -714,6 +721,11 @@ void TM1629_Handle(uint8_t key)
rt_timer_stop(OutTime_Stop_timer); rt_timer_stop(OutTime_Stop_timer);
//osTimerStop(Delay_stop_timer); //osTimerStop(Delay_stop_timer);
} }
else if(mGuiData[GUI_TAB_INDEX].Current == 2)
{
/* 普通:按住指板,等待拨片起奏当前和弦 */
PressFlag = 1;
}
uint8_t group = (key - 1) / 3; /* 1~3→0, 4~6→1, ..., 19~21→6 */ uint8_t group = (key - 1) / 3; /* 1~3→0, 4~6→1, ..., 19~21→6 */
KEY_ID_1629 = key; KEY_ID_1629 = key;
MIDI = (STRING_MIDI *)Chord_Midi_Table[group]; MIDI = (STRING_MIDI *)Chord_Midi_Table[group];
@ -802,8 +814,10 @@ void Pick_Handle()
uint8_t note_cnt = 0; uint8_t note_cnt = 0;
uint8_t chord_id = KEY_ID_1629; uint8_t chord_id = KEY_ID_1629;
/* 左手未触发和弦板(或落在拍速/停止键)时:拨片默认发当前调一级大和弦伴奏 */ /* 左手未触发和弦板(或落在拍速/停止键)时:拨片默认发当前调一级大和弦伴奏;
if (chord_id == 0 || chord_id == 22 || chord_id == 23) * 普通模式除外——必须左手按住指板再拨,不做一级兜底 */
if (mGuiData[GUI_TAB_INDEX].Current != 2 &&
(chord_id == 0 || chord_id == 22 || chord_id == 23))
{ {
KEY_ID_1629 = 1; KEY_ID_1629 = 1;
chord_type_index_map[1].type = 0; chord_type_index_map[1].type = 0;
@ -848,21 +862,20 @@ void Pick_Handle()
break; break;
case 2: case 2:
/* 普通:节奏/本地曲目均用 StartWithNote;切库后允许再次拨片起奏 */ /* 普通:左手按住指板 + 拨片起奏当前和弦;松手由 TM1629 停 */
if (StartFlag == 0 || mGuiData[GUI_AUTOBAND_SW].Current) if (PressFlag == 0 || chord_id == 0 || chord_id > 21)
{ break; /* 未按指板:不响、不兜底一级 */
StartFlag = 1; StartFlag = 1;
AutoBandTop1_Stop(); AutoBandTop1_Stop();
AutoBandTop1_SetLoopMode(0,1); AutoBandTop1_SetLoopMode(0,1);
AutoBandTop1_SetRunVar(mGuiData[GUI_PLAY_SECTION].Current); AutoBandTop1_SetRunVar(mGuiData[GUI_PLAY_SECTION].Current);
/* 起调必须用 0x3C+移调;勿用和弦音区 MIDI(如 48),否则本地曲目起奏异常 */ /* 起调必须用 0x3C+移调;勿用和弦音区 MIDI(如 48),否则本地曲目起奏异常 */
midi = 0x3C + mGuiData[GUI_TRANSPOSE].Current; midi = 0x3C + mGuiData[GUI_TRANSPOSE].Current;
AutoBandTop1_StartWithNote(midi); AutoBandTop1_StartWithNote(midi);
AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt); AutoBandTop1_StartWithNotes(midi_note_buff, note_cnt);
if (mGuiData[GUI_AUTOBAND_SW].Current) if (mGuiData[GUI_AUTOBAND_SW].Current)
LOG_I("pick", "local/normal root=%u name=%s", midi, LOG_I("pick", "local/normal root=%u name=%s", midi,
AutoBandTop1_GetPresetName() ? AutoBandTop1_GetPresetName() : "?"); AutoBandTop1_GetPresetName() ? AutoBandTop1_GetPresetName() : "?");
}
break; break;
case 1: case 1: