Beispiel #1
0
END_TEST


START_TEST(Note_end_is_reached_correctly_during_note_off)
{
    set_audio_rate(440);
    set_mix_volume(0);
    setup_debug_instrument();
    pause();

    float actual_buf[buf_len] = { 0.0f };
    const int note_off_frame = 70;

    kqt_Handle_fire_event(handle, 0, Note_On_55_Hz);
    check_unexpected_error();
    mix_and_fill(actual_buf, note_off_frame);

    // Note Off
    kqt_Handle_fire_event(handle, 0, "[\"n-\", null]");
    check_unexpected_error();
    mix_and_fill(actual_buf + note_off_frame, buf_len - note_off_frame);

    float expected_buf[buf_len] = { 0.0f };
    float seq_on[] = { 1.0f, 0.5f, 0.5f, 0.5f,
                       0.5f, 0.5f, 0.5f, 0.5f };
    int offset = repeat_seq_local(expected_buf, 8, seq_on);
    float seq_on_tail[] = { 1.0f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f };
    offset += repeat_seq_local(expected_buf + offset, 1, seq_on_tail);
    float seq_off[] = { -0.5f, -0.5f, -1.0f, -0.5f, -0.5f, -0.5f,
                                      -0.5f, -0.5f, -0.5f, -0.5f };
    repeat_seq_local(expected_buf + offset, 1, seq_off);

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #2
0
END_TEST


START_TEST(Independent_notes_mix_correctly)
{
    set_audio_rate(220);
    set_mix_volume(0);
    setup_debug_instrument();
    pause();

    float actual_buf[buf_len] = { 0.0f };
    const int note_2_frame = 2;

    kqt_Handle_fire_event(handle, 0, Note_On_55_Hz);
    check_unexpected_error();
    mix_and_fill(actual_buf, note_2_frame);

    kqt_Handle_fire_event(handle, 1, Note_On_55_Hz);
    check_unexpected_error();
    mix_and_fill(actual_buf + note_2_frame, buf_len - note_2_frame);

    float expected_buf[buf_len] = { 0.0f };
    float single_seq[] = { 1.0f, 0.5f, 0.5f, 0.5f };
    repeat_seq_local(expected_buf, 10, single_seq);
    for (int i = 40; i >= 0; --i)
        expected_buf[i + note_2_frame] += expected_buf[i];

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #3
0
END_TEST


START_TEST(Implicit_note_off_is_triggered_correctly)
{
    set_audio_rate(220);
    set_mix_volume(0);
    setup_debug_instrument();
    pause();

    float actual_buf[buf_len] = { 0.0f };
    const int note_2_frame = 2;

    kqt_Handle_fire_event(handle, 0, Note_On_55_Hz);
    check_unexpected_error();
    mix_and_fill(actual_buf, note_2_frame);

    kqt_Handle_fire_event(handle, 0, Note_On_55_Hz);
    check_unexpected_error();
    mix_and_fill(actual_buf + note_2_frame, buf_len - note_2_frame);

    float expected_buf[buf_len] = { 0.0f };
    float seq_1_on[] = { 1.0f, 0.5f };
    int offset = repeat_seq_local(expected_buf, 1, seq_1_on);
    float seq_1_off[] = { 0.5f, 0.0f, -0.5f, 0.0f };
    offset += repeat_seq_local(expected_buf + offset, 2, seq_1_off);
    float seq_2[] = { 1.0f, 0.5f, 0.5f, 0.5f };
    repeat_seq_local(expected_buf + offset, 8, seq_2);

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #4
0
END_TEST


#if 0
START_TEST(Removing_manifest_disables_instrument)
{
    set_mix_volume(0);
    pause();

    setup_debug_instrument();
    setup_debug_single_pulse();
    set_data("au_00/p_manifest.json", "");
    validate();
    check_unexpected_error();

    float actual_buf[buf_len] = { 0.0f };

    kqt_Handle_fire_event(handle, 0, "[\"n+\", 0]");
    check_unexpected_error();
    mix_and_fill(actual_buf, buf_len);

    float expected_buf[buf_len] = { 0.0f };

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #5
0
END_TEST


START_TEST(Pattern_playback_pauses_zero_length_pattern)
{
    set_audio_rate(mixing_rates[MIXING_RATE_LOW]);
    set_mix_volume(0);
    setup_debug_instrument();
    setup_debug_single_pulse();

    set_data("album/p_manifest.json", "{}");
    set_data("album/p_tracks.json", "[0]");
    set_data("song_00/p_manifest.json", "{}");
    set_data("song_00/p_order_list.json", "[ [1, 0], [0, 0], [1, 1] ]");

    set_data("pat_000/p_manifest.json", "{}");
    set_data("pat_000/p_length.json", "[0, 0]");
    set_data("pat_000/instance_000/p_manifest.json", "{}");
    set_data("pat_000/col_00/p_triggers.json", "[ [[0, 0], [\"n+\", \"0\"]] ]");

    set_data("pat_001/p_manifest.json", "{}");
    set_data("pat_001/p_length.json", "[16, 0]");
    set_data("pat_001/instance_000/p_manifest.json", "{}");
    set_data("pat_001/instance_001/p_manifest.json", "{}");
    set_data("pat_001/col_01/p_triggers.json",
            "[ [[0, 0], [\"n+\", \"0\"]], [[1, 0], [\"n+\", \"0\"]] ]");

    validate();

    kqt_Handle_fire_event(handle, 0, "[\"cpattern\", [0, 0]]");

    float actual_buf[buf_len] = { 0.0f };
    long frames_left = buf_len;
    long buf_offset = 0;
    for (int i = 0; i < 100 && frames_left > 0; ++i)
    {
        kqt_Handle_play(handle, frames_left);
        check_unexpected_error();
        const long frames_available = kqt_Handle_get_frames_available(handle);
        const float* ret_buf = kqt_Handle_get_audio(handle, 0);
        check_unexpected_error();
        memcpy(actual_buf + buf_offset,
                ret_buf,
                (size_t)frames_available * sizeof(float));

        buf_offset += frames_available;
        frames_left -= frames_available;
    }

    fail_if(frames_left == buf_len,
            "Pattern playback of zero-length pattern produces no audio");

    float expected_buf[buf_len] = { 0.0f };
    expected_buf[0] = 1.0f;

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #6
0
END_TEST


START_TEST(Empty_pattern_contains_silence)
{
    set_audio_rate(mixing_rates[_i]);
    setup_debug_instrument();

    set_data("album/p_manifest.json", "{}");
    set_data("album/p_tracks.json", "[0]");
    set_data("song_00/p_manifest.json", "{}");
    set_data("song_00/p_order_list.json", "[ [0, 0] ]");
    set_data("pat_000/p_manifest.json", "{}");
    set_data("pat_000/p_length.json", "[16, 0]");
    set_data("pat_000/instance_000/p_manifest.json", "{}");

    validate();

    const long expected_length = 8 * mixing_rates[_i];
    long actual_length = 0;

    kqt_Handle_play(handle, 4096);
    check_unexpected_error();
    while (!kqt_Handle_has_stopped(handle))
    {
        const long nframes = kqt_Handle_get_frames_available(handle);
        check_unexpected_error();
        actual_length += nframes;

        // Don't want to spend too much time on this...
        if (_i == MIXING_RATE_LOW)
        {
            const float* bufs[] =
            {
                kqt_Handle_get_audio(handle, 0),
                kqt_Handle_get_audio(handle, 1),
            };
            check_unexpected_error();

            float expected_buf[128] = { 0.0f };
            assert(nframes <= 128);
            check_buffers_equal(expected_buf, bufs[0], nframes, 0.0f);
            check_buffers_equal(expected_buf, bufs[1], nframes, 0.0f);
        }

        kqt_Handle_play(handle, 4096);
        check_unexpected_error();
    }

    const long nframes = kqt_Handle_get_frames_available(handle);
    check_unexpected_error();
    actual_length += nframes;

    fail_unless(actual_length == expected_length,
            "Wrong number of frames rendered"
            KT_VALUES("%ld", expected_length, actual_length));
}
Beispiel #7
0
static void setup_single_pulse_without_instrument_manifest(void)
{
    assert(handle != 0);

    set_data("p_dc_blocker_enabled.json", "false");

    set_data("out_00/p_manifest.json", "{}");
    set_data("p_connections.json",
            "[ [\"au_00/out_00\", \"out_00\"] ]");

    set_data("au_00/out_00/p_manifest.json", "{}");
    set_data("au_00/p_connections.json",
            "[ [\"proc_00/C/out_00\", \"out_00\"] ]");

    set_data("p_control_map.json", "[ [0, 0] ]");
    set_data("control_00/p_manifest.json", "{}");

    set_data("au_00/proc_00/p_manifest.json", "{ \"type\": \"debug\" }");
    set_data("au_00/proc_00/p_signal_type.json", "\"voice\"");
    set_data("au_00/proc_00/out_00/p_manifest.json", "{}");
    set_data("au_00/proc_00/c/p_b_single_pulse.json", "true");

    check_unexpected_error();

    return;
}
Beispiel #8
0
END_TEST


START_TEST(Paused_empty_composition_contains_silence)
{
    pause();

    kqt_Handle_play(handle, buf_len);
    check_unexpected_error();

    const long frames_available = kqt_Handle_get_frames_available(handle);
    fail_if(frames_available != buf_len,
            "kqt_Handle_play rendered %ld instead of %d frames",
            frames_available, buf_len);

    const float* ret_bufs[] =
    {
        kqt_Handle_get_audio(handle, 0),
        kqt_Handle_get_audio(handle, 1),
    };

    float expected_buf[buf_len] = { 0.0f };

    check_buffers_equal(expected_buf, ret_bufs[0], buf_len, 0.0f);
    check_buffers_equal(expected_buf, ret_bufs[1], buf_len, 0.0f);
}
Beispiel #9
0
END_TEST


START_TEST(Events_appear_in_event_buffer)
{
    setup_debug_instrument();
    setup_debug_single_pulse();

    const char* actual_events = kqt_Handle_receive_events(handle);
    check_unexpected_error();
    const char expected_events_none[] = "[]";

    fail_unless(strcmp(actual_events, expected_events_none) == 0,
            "Wrong events received"
            KT_VALUES("%s", expected_events_none, actual_events));

    kqt_Handle_fire_event(handle, 0, "[\"cpause\", null]");
    check_unexpected_error();

    actual_events = kqt_Handle_receive_events(handle);
    check_unexpected_error();
    const char expected_events_1[] =
        "[[0, [\"cpause\", null]]]";

    fail_unless(strcmp(actual_events, expected_events_1) == 0,
            "Wrong events received"
            KT_VALUES("%s", expected_events_1, actual_events));

    kqt_Handle_fire_event(handle, 2, "[\".arpi\", 0]");
    check_unexpected_error();

    actual_events = kqt_Handle_receive_events(handle);
    check_unexpected_error();
    const char expected_events_2[] =
        "[[2, [\".arpi\", 0]]]";

    fail_unless(strcmp(actual_events, expected_events_2) == 0,
            "Wrong events received"
            KT_VALUES("%s", expected_events_2, actual_events));
}
Beispiel #10
0
END_TEST


START_TEST(Adding_manifest_enables_generator)
{
    set_mix_volume(0);
    pause();

    setup_single_pulse_without_generator_manifest();
    set_data("ins_00/gen_00/p_manifest.json", "{}");
    validate();
    check_unexpected_error();

    float actual_buf[buf_len] = { 0.0f };

    kqt_Handle_fire_event(handle, 0, "[\"n+\", 0]");
    check_unexpected_error();
    mix_and_fill(actual_buf, buf_len);

    float expected_buf[buf_len] = { 1.0f };

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #11
0
END_TEST


START_TEST(Fire_with_complex_bind_can_be_processed_with_multiple_receives)
{
    set_mix_volume(0);
    setup_debug_instrument();
    setup_debug_single_pulse();

    const int event_count = 2048;
    setup_complex_bind(event_count);

    pause();
    kqt_Handle_fire_event(handle, 0, "[\"#\", \"\"]");
    check_unexpected_error();

    // Receive and make sure all events are found
    const char* events = kqt_Handle_receive_events(handle);
    int32_t expected = 0;
    int loop_count = 0;
    while (strcmp("[]", events) != 0)
    {
        Streader* sr = Streader_init(STREADER_AUTO, events, (int64_t)strlen(events));
        fail_if(!Streader_read_list(sr, read_received_events_bind, &expected),
                "Event list reading failed: %s",
                Streader_get_error_desc(sr));

        events = kqt_Handle_receive_events(handle);
        ++loop_count;
    }

    fail_if(loop_count <= 1,
            "Test did not fill the event buffer, increase event count!");

    fail_if(expected != event_count,
            "Read %" PRId32 " instead of %d events",
            expected, event_count);

    // Continue playing
    kqt_Handle_play(handle, 10);
    fail_if(kqt_Handle_get_frames_available(handle) != 10,
            "Kunquat handle rendered %ld instead of 10 frames",
            kqt_Handle_get_frames_available(handle));

    // FIXME: We can only check for 512 notes as we run out of voices :-P
    const float expected_buf[10] = { min((float)event_count, 512) };
    const float* actual_buf = kqt_Handle_get_audio(handle, 0);
    check_buffers_equal(expected_buf, actual_buf, 10, 0.0f);
}
Beispiel #12
0
END_TEST


START_TEST(Read_audio_unit_control_vars)
{
    setup_single_pulse_without_instrument_manifest();
    set_data("au_00/p_manifest.json", "{ \"type\": \"instrument\" }");
    validate();
    check_unexpected_error();

    set_data(
            "au_00/p_control_vars.json",
            "[[\"float\", \"test\", 0.0, [0.0, 1.0],"
                " [[\"proc_00\", \"target\", \"float\", 0.0, 1.0]]]]");
}
Beispiel #13
0
END_TEST


START_TEST(Empty_composition_renders_zero_frames)
{
    kqt_Handle_play(handle, 256);
    check_unexpected_error();

    const long nframes = kqt_Handle_get_frames_available(handle);

    fail_unless(
            nframes == 0,
            "Wrong number of frames rendered"
            KT_VALUES("%ld", 0L, nframes));
}
Beispiel #14
0
END_TEST


START_TEST(Effect_with_double_volume_dsp_and_bypass_triples_volume)
{
    set_audio_rate(220);
    set_mix_volume(0);
    pause();

    set_data("p_control_map.json", "[ [0, 0] ]");
    set_data("control_00/p_manifest.json", "{}");

    make_debug_instrument();

    set_data("au_01/p_manifest.json", "{ \"type\": \"effect\" }");
    set_data("au_01/in_00/p_manifest.json", "{}");
    set_data("au_01/out_00/p_manifest.json", "{}");
    set_data("au_01/proc_00/p_manifest.json", "{ \"type\": \"volume\" }");
    set_data("au_01/proc_00/p_signal_type.json", "\"mixed\"");
    set_data("au_01/proc_00/in_00/p_manifest.json", "{}");
    set_data("au_01/proc_00/out_00/p_manifest.json", "{}");
    set_data("au_01/proc_00/c/p_f_volume.json", "6");
    set_data("au_01/p_connections.json",
            "[ [\"in_00\", \"out_00\"],"
            "  [\"in_00\", \"proc_00/C/in_00\"],"
            "  [\"proc_00/C/out_00\", \"out_00\"] ]");

    set_data("out_00/p_manifest.json", "{}");
    set_data("p_connections.json",
            "[ [\"au_00/out_00\", \"au_01/in_00\"],"
            "  [\"au_01/out_00\", \"out_00\"] ]");

    validate();

    float actual_buf[buf_len] = { 0.0f };
    kqt_Handle_fire_event(handle, 0, Note_On_55_Hz);
    check_unexpected_error();
    mix_and_fill(actual_buf, buf_len);

    float expected_buf[buf_len] = { 0.0f };
    float seq[] = { 3.0f, 1.5f, 1.5f, 1.5f };
    repeat_seq_local(expected_buf, 10, seq);

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #15
0
END_TEST


START_TEST(Debug_single_shot_renders_one_pulse)
{
    set_mix_volume(0);
    setup_debug_instrument();
    setup_debug_single_pulse();
    pause();

    float actual_buf[buf_len] = { 0.0f };

    kqt_Handle_fire_event(handle, 0, "[\"n+\", 0]");
    check_unexpected_error();
    mix_and_fill(actual_buf, buf_len);

    float expected_buf[buf_len] = { 1.0f };

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #16
0
END_TEST


START_TEST(Events_from_many_triggers_are_skipped_by_fire)
{
    const int event_count = 2048;

    setup_many_triggers(event_count);

    kqt_Handle_play(handle, 10);

    kqt_Handle_fire_event(handle, 0, "[\".a\", 0]");
    check_unexpected_error();

    const char* events = kqt_Handle_receive_events(handle);
    const char* expected = "[[0, [\".a\", 0]]]";
    fail_if(strcmp(events, expected) != 0,
            "Received event list %s instead of %s",
            events, expected);
}
Beispiel #17
0
END_TEST


START_TEST(Skipping_moves_position_forwards)
{
    set_audio_rate(mixing_rates[MIXING_RATE_LOW]);
    set_mix_volume(0);
    setup_debug_instrument();
    setup_debug_single_pulse();

    set_data("album/p_manifest.json", "{}");
    set_data("album/p_tracks.json", "[0]");
    set_data("song_00/p_manifest.json", "{}");
    set_data("song_00/p_order_list.json", "[ [0, 0] ]");
    set_data("pat_000/p_manifest.json", "{}");
    set_data("pat_000/p_length.json", "[8, 0]");
    set_data("pat_000/instance_000/p_manifest.json", "{}");
    set_data("pat_000/col_00/p_triggers.json",
            "[ [[0, 0], [\"n+\", \"0\"]],"
            "  [[1, 0], [\"n+\", \"0\"]],"
            "  [[2, 0], [\"n+\", \"0\"]],"
            "  [[3, 0], [\"n+\", \"0\"]],"
            "  [[4, 0], [\"n+\", \"0\"]] ]");

    validate();

    static const long long second = 1000000000LL;
    kqt_Handle_set_position(handle, 0, _i * second / 2);
    //Player_skip(player, _i * mixing_rates[MIXING_RATE_LOW] / 2);
    check_unexpected_error();

    float actual_buf[buf_len] = { 0.0f };
    mix_and_fill(actual_buf, buf_len);

    float expected_buf[buf_len] = { 0.0f };
    for (int i = 0; i < 5 - _i; ++i)
        expected_buf[i * mixing_rates[MIXING_RATE_LOW] / 2] = 1.0f;

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #18
0
END_TEST


START_TEST(Setting_type_syncs_keys)
{
    set_mix_volume(0);
    set_audio_rate(220);
    pause();

    setup_debug_single_pulse();
    setup_debug_instrument();

    float actual_buf[buf_len] = { 0.0f };

    kqt_Handle_fire_event(handle, 0, Note_On_55_Hz);
    check_unexpected_error();
    mix_and_fill(actual_buf, buf_len);

    float expected_buf[buf_len] = { 0.0f };
    expected_buf[0] = 1.0f;

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #19
0
END_TEST


START_TEST(Infinite_mode_loops_composition)
{
    set_audio_rate(mixing_rates[MIXING_RATE_LOW]);
    set_mix_volume(0);
    setup_debug_instrument();
    setup_debug_single_pulse();

    set_data("album/p_manifest.json", "{}");
    set_data("album/p_tracks.json", "[0]");
    set_data("song_00/p_manifest.json", "{}");
    set_data("song_00/p_order_list.json", "[ [0, 0] ]");
    set_data("pat_000/p_manifest.json", "{}");
    set_data("pat_000/p_length.json", "[2, 0]");
    set_data("pat_000/instance_000/p_manifest.json", "{}");
    set_data("pat_000/col_00/p_triggers.json", "[ [[0, 0], [\"n+\", \"0\"]] ]");

    validate();

    kqt_Handle_fire_event(handle, 0, "[\"cinfinite+\", null]");
    check_unexpected_error();

    float actual_buf[buf_len] = { 0.0f };
    const long mixed = mix_and_fill(actual_buf, buf_len);
    fail_unless(mixed == buf_len,
            "Wrong number of frames mixed"
            KT_VALUES("%ld", buf_len, mixed));

    float expected_buf[buf_len] = { 0.0f };
    for (long i = 0; i < buf_len; i += mixing_rates[MIXING_RATE_LOW])
        expected_buf[i] = 1.0f;

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}
Beispiel #20
0
END_TEST


START_TEST(Add_and_remove_internal_effect_and_render)
{
    set_audio_rate(220);
    set_mix_volume(0);

    setup_debug_instrument();
    setup_debug_single_pulse();

    float actual_buf[buf_len] = { 0.0f };

    // Add silence
    set_data("album/p_manifest.json", "{}");
    set_data("album/p_tracks.json", "[0]");
    set_data("song_00/p_manifest.json", "{}");
    set_data("song_00/p_order_list.json", "[ [0, 0] ]");
    set_data("pat_000/p_manifest.json", "{}");
    set_data("pat_000/p_length.json", "[16, 0]");
    set_data("pat_000/instance_000/p_manifest.json", "{}");

    // Add internal audio unit
    set_data("au_00/au_00/p_manifest.json", "{ \"type\": \"effect\" }");
    set_data("au_00/au_00/in_00/p_manifest.json", "{}");
    set_data("au_00/au_00/out_00/p_manifest.json", "{}");
    set_data(
            "au_00/p_connections.json",
            "[ [\"proc_00/C/out_00\", \"out_00\"]"
            ", [\"proc_00/C/out_00\", \"au_00/in_00\"]"
            ", [\"au_00/out_00\", \"out_00\"] ]");

    // Add processor inside the internal audio unit
    set_data("au_00/au_00/proc_00/in_00/p_manifest.json", "{}");
    set_data("au_00/au_00/proc_00/out_00/p_manifest.json", "{}");
    set_data("au_00/au_00/proc_00/p_manifest.json", "{ \"type\": \"volume\" }");
    set_data("au_00/au_00/proc_00/p_signal_type.json", "\"mixed\"");
    set_data(
            "au_00/au_00/p_connections.json",
            "[ [\"in_00\", \"proc_00/C/in_00\"]"
            ", [\"proc_00/C/out_00\", \"out_00\"] ]");

    validate();
    check_unexpected_error();

    // Test rendering
    mix_and_fill(actual_buf, buf_len);

    // Remove the internal audio unit
    set_data("au_00/p_connections.json", "[ [\"proc_00/C/out_00\", \"out_00\"] ]");
    set_data("au_00/au_00/in_00/p_manifest.json", "");
    set_data("au_00/au_00/out_00/p_manifest.json", "");
    set_data("au_00/au_00/p_connections.json", "");
    set_data("au_00/au_00/p_manifest.json", "");
    set_data("au_00/au_00/proc_00/in_00/p_manifest.json", "");
    set_data("au_00/au_00/proc_00/out_00/p_manifest.json", "");
    set_data("au_00/au_00/proc_00/p_manifest.json", "");
    set_data("au_00/au_00/proc_00/p_signal_type.json", "");

    validate();
    check_unexpected_error();

    // Test rendering again
    kqt_Handle_set_position(handle, 0, 0);
    mix_and_fill(actual_buf, buf_len);
}
Beispiel #21
0
END_TEST
#endif


START_TEST(Input_map_maintains_indices)
{
    set_audio_rate(220);
    set_mix_volume(0);
    pause();

    // Set up two debug instruments
    set_data("p_dc_blocker_enabled.json", "false");

    set_data("out_00/p_manifest.json", "{}");
    set_data("p_connections.json",
            "[ [\"au_00/out_00\", \"out_00\"],"
            "  [\"au_01/out_00\", \"out_00\"] ]");

    set_data("p_control_map.json", "[[0, 0], [1, 1]]");
    set_data("control_00/p_manifest.json", "{}");
    set_data("control_01/p_manifest.json", "{}");

    set_data("au_00/p_manifest.json", "{ \"type\": \"instrument\" }");
    set_data("au_00/out_00/p_manifest.json", "{}");
    set_data("au_00/p_connections.json",
            "[ [\"proc_00/C/out_00\", \"out_00\"] ]");

    set_data("au_00/proc_00/p_manifest.json", "{ \"type\": \"debug\" }");
    set_data("au_00/proc_00/p_signal_type.json", "\"voice\"");
    set_data("au_00/proc_00/out_00/p_manifest.json", "{}");

    set_data("au_00/proc_00/c/p_b_single_pulse.json", "true");

    set_data("au_01/p_manifest.json", "{ \"type\": \"instrument\" }");
    set_data("au_01/out_00/p_manifest.json", "{}");
    set_data("au_01/p_connections.json",
            "[ [\"proc_00/C/out_00\", \"out_00\"]"
            ", [\"proc_01/C/out_00\", \"proc_00/C/in_00\"]"
            "]");

    set_data("au_01/proc_00/p_manifest.json", "{ \"type\": \"debug\" }");
    set_data("au_01/proc_00/p_signal_type.json", "\"voice\"");
    set_data("au_01/proc_00/in_00/p_manifest.json", "{}");
    set_data("au_01/proc_00/out_00/p_manifest.json", "{}");

    set_data("au_01/proc_01/p_manifest.json", "{ \"type\": \"pitch\" }");
    set_data("au_01/proc_01/p_signal_type.json", "\"voice\"");
    set_data("au_01/proc_01/out_00/p_manifest.json", "{}");

    validate();
    check_unexpected_error();

    // Test rendering
    float actual_buf[buf_len] = { 0.0f };

    kqt_Handle_fire_event(handle, 0, "[\".a\", 0]");
    kqt_Handle_fire_event(handle, 0, Note_On_55_Hz);
    check_unexpected_error();

    const int note_offset = 10;

    mix_and_fill(actual_buf, note_offset);

    kqt_Handle_fire_event(handle, 1, "[\".a\", 1]");
    kqt_Handle_fire_event(handle, 1, Note_On_55_Hz);
    check_unexpected_error();

    mix_and_fill(actual_buf + note_offset, buf_len - note_offset);

    float expected_buf[buf_len] = { 0.0f };
    expected_buf[0] = 1.0f;
    const float seq[] = { 1.0f, 0.5f, 0.5f, 0.5f };
    repeat_seq_local(expected_buf + note_offset, 10, seq);

    check_buffers_equal(expected_buf, actual_buf, buf_len, 0.0f);
}