feat: integrate Carla plugin host with rack view, fuzzy search, and volume control

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-02 21:29:56 +00:00
parent fd00d51ff7
commit 6bd2e762cb
7 changed files with 932 additions and 5 deletions

View File

@@ -80,7 +80,19 @@ static int process_callback(jack_nframes_t nframes, void *arg) {
for (int ch = 0; ch < MAX_CHANNELS; ch++) {
memset(audio_out[ch], 0, sizeof(jack_default_audio_sample_t) * nframes);
// Create temporary buffer for rack processing
float *rack_in = malloc(nframes * sizeof(float));
float *rack_out = malloc(nframes * sizeof(float));
if (!rack_in || !rack_out) {
free(rack_in);
free(rack_out);
continue;
}
for (jack_nframes_t i = 0; i < nframes; i++) {
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];
@@ -92,11 +104,20 @@ static int process_callback(jack_nframes_t nframes, void *arg) {
}
if (clip->state == CLIP_LOOPING && clip->buffer_size > 0) {
audio_out[ch][i] += clip->buffer[clip->read_position];
rack_in[i] += clip->buffer[clip->read_position];
clip->read_position = (clip->read_position + 1) % clip->buffer_size;
}
}
}
// Process through Carla rack
carla_process(&state.carla_host, ch, rack_in, rack_out, nframes);
// Copy to output
memcpy(audio_out[ch], rack_out, nframes * sizeof(jack_default_audio_sample_t));
free(rack_in);
free(rack_out);
}
return 0;