feat: add parallel MIDI grid with separate clip storage and view toggle

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-03 18:49:21 +00:00
parent 5e4d4e4d44
commit 61ab2f0b19
6 changed files with 216 additions and 25 deletions

12
cli.c
View File

@@ -58,6 +58,7 @@ int cli_process_line(Engine *engine, const char *line) {
printf(" bpm <value> - Set BPM (1.0-999.0)\n");
printf(" load <clip> <file> - Load WAV file into clip\n");
printf(" save <clip> - Save clip to samples/clip_<N>.wav\n");
printf(" grid audio|midi - Switch between Audio and MIDI grid\n");
printf(" help - Show this help\n");
printf(" quit - Exit CLI\n");
return 1;
@@ -189,6 +190,17 @@ int cli_process_line(Engine *engine, const char *line) {
engine->dispatch(action);
printf("Saving clip %d...\n", clip_idx);
}
else if (strcasecmp(token, "grid") == 0) {
char *mode_str = strtok(NULL, " \t");
if (!mode_str) {
printf("Usage: grid audio|midi\n");
return 1;
}
bool show_midi = (strcasecmp(mode_str, "midi") == 0);
Action action = { .type = ACTION_SET_SHOW_MIDI_GRID, .data.set_show_midi_grid = { .show = show_midi } };
engine->dispatch(action);
printf("Grid: %s\n", show_midi ? "MIDI" : "AUDIO");
}
else if (strcasecmp(token, "bpm") == 0) {
char *bpm_str = strtok(NULL, " \t");
if (!bpm_str) {