Compare commits
10 Commits
7e9224cdc7
...
multichann
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b4531f3f3 | |||
|
|
b4a65a5788 | ||
|
|
20c0820910 | ||
|
|
934843e9b1 | ||
|
|
2fa1d159e7 | ||
|
|
982dd4dc02 | ||
|
|
b02c45e7ab | ||
|
|
aa0b191b46 | ||
|
|
c2df024350 | ||
|
|
d2e39f3451 |
4
.githooks/pre-push
Executable file
4
.githooks/pre-push
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
make test
|
||||
make check
|
||||
make format
|
||||
5
makefile
5
makefile
@@ -22,8 +22,11 @@ clean:
|
||||
rm -f looper integration_test src/*.o
|
||||
|
||||
check:
|
||||
cppcheck --enable=all --error-exitcode=1 src/*.c
|
||||
cppcheck --enable=all --error-exitcode=1 --suppress=missingIncludeSystem --suppress=normalCheckLevelMaxBranches src/*.c --library=posix .
|
||||
|
||||
# Optional: Format code using clang-format
|
||||
format:
|
||||
clang-format -i src/*.c
|
||||
|
||||
install-hooks:
|
||||
git config core.hooksPath .githooks
|
||||
|
||||
@@ -1,42 +1,40 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
// cppcheck-suppress missingIncludeSystem
|
||||
#include "channel.h"
|
||||
#include <jack/jack.h>
|
||||
#include <stdatomic.h>
|
||||
#include "channel.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void channel_add(jack_client_t *client, int idx)
|
||||
{
|
||||
char in_name[64], out_name[64];
|
||||
snprintf(in_name, sizeof(in_name), "channel%d_input", next_channel_id);
|
||||
snprintf(out_name, sizeof(out_name), "channel%d_output", next_channel_id);
|
||||
void channel_add(jack_client_t *client, int idx) {
|
||||
char in_name[64], out_name[64];
|
||||
snprintf(in_name, sizeof(in_name), "channel%d_input", next_channel_id);
|
||||
snprintf(out_name, sizeof(out_name), "channel%d_output", next_channel_id);
|
||||
|
||||
channels[idx].audio_in = jack_port_register(client, in_name,
|
||||
JACK_DEFAULT_AUDIO_TYPE,
|
||||
JackPortIsInput, 0);
|
||||
channels[idx].audio_out = jack_port_register(client, out_name,
|
||||
JACK_DEFAULT_AUDIO_TYPE,
|
||||
JackPortIsOutput, 0);
|
||||
if (!channels[idx].audio_in || !channels[idx].audio_out) {
|
||||
fprintf(stderr, "Failed to register ports for channel %d\n", next_channel_id);
|
||||
/* Do NOT mark channel active – process loop will skip it */
|
||||
atomic_store(&channels[idx].active, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
atomic_store(&channels[idx].active, 1);
|
||||
atomic_store(&channels[idx].state, STATE_IDLE);
|
||||
channels[idx].prev_state = -1;
|
||||
channels[idx].loop_count = 0;
|
||||
channels[idx].record_pos = 0;
|
||||
channels[idx].playback_pos = 0;
|
||||
|
||||
next_channel_id++;
|
||||
channel_count++;
|
||||
}
|
||||
|
||||
void channel_remove(jack_client_t *client, int idx)
|
||||
{
|
||||
(void)client;
|
||||
channels[idx].audio_in = jack_port_register(
|
||||
client, in_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
|
||||
channels[idx].audio_out = jack_port_register(
|
||||
client, out_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
|
||||
if (!channels[idx].audio_in || !channels[idx].audio_out) {
|
||||
fprintf(stderr, "Failed to register ports for channel %d\n",
|
||||
next_channel_id);
|
||||
/* Do NOT mark channel active – process loop will skip it */
|
||||
atomic_store(&channels[idx].active, 0);
|
||||
channel_count--;
|
||||
return;
|
||||
}
|
||||
|
||||
atomic_store(&channels[idx].active, 1);
|
||||
atomic_store(&channels[idx].state, STATE_IDLE);
|
||||
channels[idx].prev_state = -1;
|
||||
channels[idx].loop_count = 0;
|
||||
channels[idx].record_pos = 0;
|
||||
channels[idx].playback_pos = 0;
|
||||
|
||||
next_channel_id++;
|
||||
channel_count++;
|
||||
}
|
||||
|
||||
void channel_remove(jack_client_t *client, int idx) {
|
||||
(void)client;
|
||||
atomic_store(&channels[idx].active, 0);
|
||||
channel_count--;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef CHANNEL_H
|
||||
#define CHANNEL_H
|
||||
|
||||
// cppcheck-suppress missingIncludeSystem
|
||||
#include <jack/jack.h>
|
||||
#include <stdatomic.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// cppcheck-suppress missingIncludeSystem
|
||||
#include "looper.h"
|
||||
#include "channel.h"
|
||||
#include "midi.h"
|
||||
@@ -78,12 +79,13 @@ int process_callback(jack_nframes_t nframes, void *arg) {
|
||||
switch (state) {
|
||||
case STATE_RECORD:
|
||||
if (in) {
|
||||
float *f_out = (float *)out;
|
||||
const float *f_in = (const float *)in;
|
||||
for (i = 0; i < nframes; i++) {
|
||||
if (channels[c].record_pos < LOOP_BUF_SIZE)
|
||||
channels[c].loop_buffer[channels[c].record_pos++] =
|
||||
((const float *)in)[i];
|
||||
// cppcheck-suppress unreadVariable
|
||||
((float *)out)[i] = ((const float *)in)[i];
|
||||
f_in[i];
|
||||
f_out[i] = f_in[i];
|
||||
}
|
||||
} else {
|
||||
memset(out, 0, sizeof(jack_default_audio_sample_t) * nframes);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef LOOPER_H
|
||||
#define LOOPER_H
|
||||
|
||||
// cppcheck-suppress missingIncludeSystem
|
||||
#include <jack/jack.h>
|
||||
|
||||
/* Initialisation – must be called after setting process callback */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// cppcheck-suppress missingIncludeSystem
|
||||
#include "looper.h"
|
||||
#include <jack/jack.h>
|
||||
#include <stdio.h>
|
||||
|
||||
179
src/midi.c
179
src/midi.c
@@ -1,102 +1,111 @@
|
||||
// cppcheck-suppress missingIncludeSystem
|
||||
#include "midi.h"
|
||||
#include "channel.h"
|
||||
#include <jack/jack.h>
|
||||
#include <jack/midiport.h>
|
||||
#include <stdatomic.h>
|
||||
#include "midi.h"
|
||||
#include "channel.h"
|
||||
|
||||
extern atomic_int control_key_active;
|
||||
extern atomic_int cmd_add;
|
||||
extern atomic_int cmd_remove;
|
||||
extern atomic_int bind_channel;
|
||||
|
||||
void midi_handle_events(void *port_buffer, jack_nframes_t nframes)
|
||||
{
|
||||
(void)nframes;
|
||||
jack_nframes_t nevents = jack_midi_get_event_count(port_buffer);
|
||||
jack_midi_event_t ev;
|
||||
void midi_handle_events(void *port_buffer, jack_nframes_t nframes) {
|
||||
(void)nframes;
|
||||
jack_nframes_t nevents = jack_midi_get_event_count(port_buffer);
|
||||
jack_midi_event_t ev;
|
||||
|
||||
for (jack_nframes_t i = 0; i < nevents; i++) {
|
||||
if (jack_midi_event_get(&ev, port_buffer, i) != 0) continue;
|
||||
if (ev.size < 3) continue;
|
||||
for (jack_nframes_t i = 0; i < nevents; i++) {
|
||||
if (jack_midi_event_get(&ev, port_buffer, i) != 0)
|
||||
continue;
|
||||
if (ev.size < 3)
|
||||
continue;
|
||||
|
||||
unsigned char status = ev.buffer[0];
|
||||
unsigned char note = ev.buffer[1];
|
||||
unsigned char vel = ev.buffer[2];
|
||||
unsigned char status = ev.buffer[0];
|
||||
unsigned char note = ev.buffer[1];
|
||||
unsigned char vel = ev.buffer[2];
|
||||
|
||||
/* note‑on */
|
||||
if ((status & 0xf0) == 0x90 && vel > 0) {
|
||||
if (note == 64) {
|
||||
atomic_store(&control_key_active, 1);
|
||||
} else {
|
||||
int ck = atomic_load(&control_key_active);
|
||||
if (ck) {
|
||||
atomic_store(&control_key_active, 0);
|
||||
if (note < 16) {
|
||||
atomic_store(&bind_channel, note);
|
||||
} else {
|
||||
switch (note) {
|
||||
case 60: atomic_store(&cmd_add, 1); break;
|
||||
case 61: atomic_store(&cmd_remove, 1); break;
|
||||
case 62: /* trigger looper – channel via bind_channel */
|
||||
{
|
||||
int bch = atomic_load(&bind_channel);
|
||||
if (bch >= 0 && bch < MAX_CHANNELS) {
|
||||
int cur = atomic_load(&channels[bch].state);
|
||||
switch (cur) {
|
||||
case STATE_IDLE:
|
||||
atomic_store(&channels[bch].state, STATE_RECORD);
|
||||
break;
|
||||
case STATE_RECORD:
|
||||
atomic_store(&channels[bch].state, STATE_LOOPING);
|
||||
break;
|
||||
case STATE_LOOPING:
|
||||
atomic_store(&channels[bch].state, STATE_PAUSED);
|
||||
break;
|
||||
case STATE_PAUSED:
|
||||
atomic_store(&channels[bch].state, STATE_LOOPING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 63: /* unbind – reset bind to channel 0 */
|
||||
atomic_store(&bind_channel, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* direct mapping */
|
||||
switch (note) {
|
||||
case 1: /* toggle channel 0 */
|
||||
{
|
||||
int cur0 = atomic_load(&channels[0].state);
|
||||
switch (cur0) {
|
||||
case STATE_IDLE:
|
||||
atomic_store(&channels[0].state, STATE_RECORD);
|
||||
break;
|
||||
case STATE_RECORD:
|
||||
atomic_store(&channels[0].state, STATE_LOOPING);
|
||||
break;
|
||||
case STATE_LOOPING:
|
||||
atomic_store(&channels[0].state, STATE_PAUSED);
|
||||
break;
|
||||
case STATE_PAUSED:
|
||||
atomic_store(&channels[0].state, STATE_LOOPING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 60: atomic_store(&cmd_add, 1); break;
|
||||
case 61: atomic_store(&cmd_remove, 1); break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* note‑on */
|
||||
if ((status & 0xf0) == 0x90 && vel > 0) {
|
||||
if (note == 64) {
|
||||
atomic_store(&control_key_active, 1);
|
||||
} else {
|
||||
int ck = atomic_load(&control_key_active);
|
||||
if (ck) {
|
||||
atomic_store(&control_key_active, 0);
|
||||
if (note < 16) {
|
||||
atomic_store(&bind_channel, note);
|
||||
} else {
|
||||
switch (note) {
|
||||
case 60:
|
||||
atomic_store(&cmd_add, 1);
|
||||
break;
|
||||
case 61:
|
||||
atomic_store(&cmd_remove, 1);
|
||||
break;
|
||||
case 62: /* trigger looper – channel via bind_channel */
|
||||
{
|
||||
int bch = atomic_load(&bind_channel);
|
||||
if (bch >= 0 && bch < MAX_CHANNELS) {
|
||||
int cur = atomic_load(&channels[bch].state);
|
||||
switch (cur) {
|
||||
case STATE_IDLE:
|
||||
atomic_store(&channels[bch].state, STATE_RECORD);
|
||||
break;
|
||||
case STATE_RECORD:
|
||||
atomic_store(&channels[bch].state, STATE_LOOPING);
|
||||
break;
|
||||
case STATE_LOOPING:
|
||||
atomic_store(&channels[bch].state, STATE_PAUSED);
|
||||
break;
|
||||
case STATE_PAUSED:
|
||||
atomic_store(&channels[bch].state, STATE_LOOPING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case 63: /* unbind – reset bind to channel 0 */
|
||||
atomic_store(&bind_channel, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if ((status & 0xf0) == 0x80 || ((status & 0xf0) == 0x90 && vel == 0)) {
|
||||
atomic_store(&control_key_active, 0);
|
||||
}
|
||||
} else {
|
||||
/* direct mapping */
|
||||
switch (note) {
|
||||
case 1: /* toggle channel 0 */
|
||||
{
|
||||
int cur0 = atomic_load(&channels[0].state);
|
||||
switch (cur0) {
|
||||
case STATE_IDLE:
|
||||
atomic_store(&channels[0].state, STATE_RECORD);
|
||||
break;
|
||||
case STATE_RECORD:
|
||||
atomic_store(&channels[0].state, STATE_LOOPING);
|
||||
break;
|
||||
case STATE_LOOPING:
|
||||
atomic_store(&channels[0].state, STATE_PAUSED);
|
||||
break;
|
||||
case STATE_PAUSED:
|
||||
atomic_store(&channels[0].state, STATE_LOOPING);
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
case 60:
|
||||
atomic_store(&cmd_add, 1);
|
||||
break;
|
||||
case 61:
|
||||
atomic_store(&cmd_remove, 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ((status & 0xf0) == 0x80 ||
|
||||
((status & 0xf0) == 0x90 && vel == 0)) {
|
||||
atomic_store(&control_key_active, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef MIDI_H
|
||||
#define MIDI_H
|
||||
|
||||
// cppcheck-suppress missingIncludeSystem
|
||||
#include <jack/types.h>
|
||||
|
||||
void midi_handle_events(void *port_buffer, jack_nframes_t nframes);
|
||||
|
||||
@@ -68,8 +68,8 @@ static int passthrough_process(jack_nframes_t nframes, void *arg) {
|
||||
const jack_default_audio_sample_t *in =
|
||||
(const jack_default_audio_sample_t *)jack_port_get_buffer(passthrough_input_port, nframes);
|
||||
if (!out || !in) return 0;
|
||||
float *outf = out;
|
||||
const float *inf = in;
|
||||
float *f_out = (float *)out;
|
||||
const float *f_in = (const float *)in;
|
||||
for (jack_nframes_t i = 0; i < nframes; i++) {
|
||||
/* generate beep while beep_remaining > 0 or continuous sine */
|
||||
float out_val;
|
||||
@@ -82,17 +82,17 @@ static int passthrough_process(jack_nframes_t nframes, void *arg) {
|
||||
} else {
|
||||
out_val = 0.0f;
|
||||
}
|
||||
outf[i] = out_val;
|
||||
f_out[i] = out_val;
|
||||
|
||||
/* detect bursts on the input (looper output) */
|
||||
float sample = inf[i];
|
||||
float sample = f_in[i];
|
||||
int above = (fabsf(sample) > 0.05f);
|
||||
if (above && !prev_above) {
|
||||
bursts++;
|
||||
}
|
||||
prev_above = above;
|
||||
|
||||
passthrough_sum_sq += (double)inf[i] * (double)inf[i];
|
||||
passthrough_sum_sq += (double)f_in[i] * (double)f_in[i];
|
||||
passthrough_total_samples++;
|
||||
}
|
||||
if (passthrough_total_samples >= passthrough_sample_rate * 2) {
|
||||
@@ -165,7 +165,7 @@ static int test_audio_pass_through(void) {
|
||||
waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
const char *looper_input = "looper:input";
|
||||
const char *looper_output = "looper:output";
|
||||
char my_output[64], my_input[64];
|
||||
@@ -259,7 +259,7 @@ static int send_jack_note_on(const char *target_port, unsigned char note, unsign
|
||||
}
|
||||
/* wait for the process callback to clear the flag (event delivered) */
|
||||
for (int attempts = 0; attempts < 50; attempts++) { /* ~50 * 10ms = 500ms */
|
||||
usleep(10000);
|
||||
safe_usleep(10000);
|
||||
if (!midi_inject_pending) break;
|
||||
}
|
||||
jack_deactivate(midi_inject_client);
|
||||
@@ -303,7 +303,7 @@ static int test_looper_looping(void) {
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000); /* wait for ports to appear */
|
||||
safe_usleep(200000); /* wait for ports to appear */
|
||||
/* connect test:out -> looper:input, looper:output -> test:in */
|
||||
char my_out[64], my_in[64];
|
||||
snprintf(my_out, sizeof(my_out), "test_looping:out");
|
||||
@@ -448,7 +448,7 @@ static int test_control_key_modifier(void) {
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
char my_out[64], my_in[64];
|
||||
snprintf(my_out, sizeof(my_out), "test_ctrl_key:out");
|
||||
snprintf(my_in, sizeof(my_in), "test_ctrl_key:in");
|
||||
@@ -465,7 +465,7 @@ static int test_control_key_modifier(void) {
|
||||
fprintf(stderr, " FAIL: send note 64 failed\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
/* Now send note 62 (toggle channel 0) */
|
||||
if (send_jack_note_on("looper:control", 62, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
@@ -493,7 +493,7 @@ static int test_control_key_modifier(void) {
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000); /* allow beep */
|
||||
safe_usleep(200000); /* allow beep */
|
||||
/* send note 62 again under control key to move RECORD->LOOPING */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
@@ -501,7 +501,7 @@ static int test_control_key_modifier(void) {
|
||||
fprintf(stderr, " FAIL: control key re‑send\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 62, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
@@ -547,7 +547,7 @@ static int test_bind_channel(void) {
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
char my_out[64], my_in[64];
|
||||
snprintf(my_out, sizeof(my_out), "test_bind:out");
|
||||
snprintf(my_in, sizeof(my_in), "test_bind:in");
|
||||
@@ -564,14 +564,14 @@ static int test_bind_channel(void) {
|
||||
fprintf(stderr, " FAIL: send control key failed\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 0, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
fprintf(stderr, " FAIL: send bind note 0 failed\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
/* Now toggle using control+note62 – should toggle channel 0 */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
@@ -579,7 +579,7 @@ static int test_bind_channel(void) {
|
||||
fprintf(stderr, " FAIL: send control key again failed\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 62, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
@@ -606,7 +606,7 @@ static int test_bind_channel(void) {
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000); /* allow beep */
|
||||
safe_usleep(200000); /* allow beep */
|
||||
/* send control+note62 again to move RECORD->LOOPING */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
@@ -614,7 +614,7 @@ static int test_bind_channel(void) {
|
||||
fprintf(stderr, " FAIL: control key for loop\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 62, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
@@ -660,7 +660,7 @@ static int test_bind_unbind(void) {
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
char my_out[64], my_in[64];
|
||||
snprintf(my_out, sizeof(my_out), "test_unbind:out");
|
||||
snprintf(my_in, sizeof(my_in), "test_unbind:in");
|
||||
@@ -677,14 +677,14 @@ static int test_bind_unbind(void) {
|
||||
fprintf(stderr, " FAIL: send control key failed\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 5, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
fprintf(stderr, " FAIL: bind to 5 failed\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
/* Unbind (reset to 0) */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
@@ -692,14 +692,14 @@ static int test_bind_unbind(void) {
|
||||
fprintf(stderr, " FAIL: control key for unbind\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 63, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
fprintf(stderr, " FAIL: send unbind note 63 failed\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
/* Now toggle with control+62 – should affect channel 0 */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
@@ -707,7 +707,7 @@ static int test_bind_unbind(void) {
|
||||
fprintf(stderr, " FAIL: control key for toggle\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 62, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
@@ -734,7 +734,7 @@ static int test_bind_unbind(void) {
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
usleep(200000); /* allow beep */
|
||||
safe_usleep(200000); /* allow beep */
|
||||
/* second control+62 -> loop */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
@@ -742,7 +742,7 @@ static int test_bind_unbind(void) {
|
||||
fprintf(stderr, " FAIL: control key for loop\n");
|
||||
return 1;
|
||||
}
|
||||
usleep(200000);
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 62, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
|
||||
Reference in New Issue
Block a user