feat: implement grid-of-grids with 8 separate 8x8 clip grids and zoom mode

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-02 23:07:35 +00:00
parent cf42996967
commit 8c9804d2ef
6 changed files with 179 additions and 64 deletions

View File

@@ -95,18 +95,21 @@ static int process_callback(jack_nframes_t nframes, void *arg) {
rack_in[i] = 0.0f;
for (int s = 0; s < MAX_SCENES; s++) {
int clip_idx = CLIP_INDEX(s, ch);
Clip *clip = &state.clips[clip_idx];
if (clip->state == CLIP_RECORDING) {
if (clip->write_position < MAX_BUFFER_SIZE) {
clip->buffer[clip->write_position++] = audio_in[ch][i];
// Iterate over all grids for this scene and channel
for (int g = 0; g < 8; g++) {
int clip_idx = g * GRID_ROWS * GRID_COLS + s * GRID_COLS + ch;
Clip *clip = &state.clips[clip_idx];
if (clip->state == CLIP_RECORDING) {
if (clip->write_position < MAX_BUFFER_SIZE) {
clip->buffer[clip->write_position++] = audio_in[ch][i];
}
}
if (clip->state == CLIP_LOOPING && clip->buffer_size > 0) {
rack_in[i] += clip->buffer[clip->read_position];
clip->read_position = (clip->read_position + 1) % clip->buffer_size;
}
}
if (clip->state == CLIP_LOOPING && clip->buffer_size > 0) {
rack_in[i] += clip->buffer[clip->read_position];
clip->read_position = (clip->read_position + 1) % clip->buffer_size;
}
}
}