10. DONE Step Graforge Nodes

CLOSED: [2019-02-24 Sun 14:17]

10.1. DONE Step Clock Node

CLOSED: [2019-02-23 Sat 12:22] The step clock node will take in an audio rate clock signal as input. Every time the clock triggers, it will step the sequence forward in time.

10.1.1. DONE Step Clock Node Setup

CLOSED: [2019-02-23 Sat 12:22]

<<step_function_declarations>>=
static void node_stepclk(gf_node *node, page_step_d *step);
<<step_functions>>=
static void node_stepclk(gf_node *node, page_step_d *step)
{
    gf_node_cables_alloc(node, 1);
    gf_node_set_compute(node, stepclk_compute);
    gf_node_set_destroy(node, stepclk_destroy);
    gf_node_set_data(node, step);
}

10.1.2. DONE Step Clock Node Compute

CLOSED: [2019-02-23 Sat 12:22]

<<step_function_declarations>>=
static void stepclk_compute(gf_node *node);
<<step_functions>>=
static void stepclk_compute(gf_node *node)
{
    int s;
    int blksize;
    gf_cable *in;
    page_step_d *step;

    gf_node_get_cable(node, 0, &in);
    blksize = gf_node_blksize(node);
    step = gf_node_get_data(node);

    for(s = 0; s < blksize; s++) {
        if(gf_cable_get(in, s) != 0) {
            step_step(step);
        }
    }
}

10.1.3. DONE Step Clock Node Destroy

CLOSED: [2019-02-23 Sat 11:49]

<<step_function_declarations>>=
static void stepclk_destroy(gf_node *node);
<<step_functions>>=
static void stepclk_destroy(gf_node *node)
{
    gf_node_cables_free(node);
}

10.2. DONE Step Note Node

CLOSED: [2019-02-23 Sat 13:59] The step node function returns the current note value.

10.2.1. DONE Step Note Node Setup

CLOSED: [2019-02-23 Sat 12:48]

<<step_function_declarations>>=
static void node_stepnt(gf_node *node, page_step_d *step);
<<step_functions>>=
static void node_stepnt(gf_node *node, page_step_d *step)
{
    gf_node_cables_alloc(node, 1);
    gf_node_set_block(node, 0);
    gf_node_set_compute(node, stepnt_compute);
    gf_node_set_destroy(node, stepclk_destroy); /* re-use */
    gf_node_set_data(node, step);
}

10.2.2. DONE Step Note Node Compute

CLOSED: [2019-02-23 Sat 12:48]

<<step_function_declarations>>=
static void stepnt_compute(gf_node *node);
<<step_functions>>=
static void stepnt_compute(gf_node *node)
{
    int s;
    int blksize;
    gf_cable *out;
    page_step_d *step;

    gf_node_get_cable(node, 0, &out);
    blksize = gf_node_blksize(node);
    step = gf_node_get_data(node);

    for(s = 0; s < blksize; s++) {
        gf_cable_set(out, s, get_performed_note(step));
    }
}

10.2.3. DONE Step Note Node Destroy

CLOSED: [2019-02-23 Sat 11:51] For now, this will just use stepclk_destroy because the functionality is identical.

10.3. DONE Step Gate Node

CLOSED: [2019-02-23 Sat 13:59] The step gate node returns the current gate value.

10.3.1. DONE Step Gate Node Setup

CLOSED: [2019-02-23 Sat 13:04]

<<step_function_declarations>>=
static void node_stepgt(gf_node *node, page_step_d *step);
<<step_functions>>=
static void node_stepgt(gf_node *node, page_step_d *step)
{
    gf_node_cables_alloc(node, 1);
    gf_node_set_block(node, 0);
    gf_node_set_compute(node, stepgt_compute);
    gf_node_set_destroy(node, stepclk_destroy); /* re-use */
    gf_node_set_data(node, step);
}

10.3.2. DONE Step Gate Node Compute

CLOSED: [2019-02-23 Sat 13:11]

<<step_function_declarations>>=
static void stepgt_compute(gf_node *node);
<<step_functions>>=
static void stepgt_compute(gf_node *node)
{
    int s;
    int blksize;
    gf_cable *out;
    page_step_d *step;

    gf_node_get_cable(node, 0, &out);
    blksize = gf_node_blksize(node);
    step = gf_node_get_data(node);

    for(s = 0; s < blksize; s++) {
        gf_cable_set(out, s, get_performed_gate(step));
    }
}

10.3.3. DONE Step Gate Node Destroy

CLOSED: [2019-02-23 Sat 11:51] For now, this will just use stepclk_destroy because the functionality is identical.

10.4. DONE Step Play Node

CLOSED: [2019-02-24 Sun 14:17] The step play node returns a gate signal indicating if there is playback or not.

10.4.1. Step Play Node Setup

<<step_function_declarations>>=
static void node_play(gf_node *node, page_step_d *step);
<<step_functions>>=
static void node_play(gf_node *node, page_step_d *step)
{
    gf_node_cables_alloc(node, 1);
    gf_node_set_block(node, 0);
    gf_node_set_compute(node, stepplay_compute);
    gf_node_set_destroy(node, stepclk_destroy); /* re-use */
    gf_node_set_data(node, step);
}

10.4.2. Step Play Node Compute

<<step_function_declarations>>=
static void stepplay_compute(gf_node *node);
<<step_functions>>=
static void stepplay_compute(gf_node *node)
{
    int s;
    int blksize;
    gf_cable *out;
    page_step_d *step;

    gf_node_get_cable(node, 0, &out);
    blksize = gf_node_blksize(node);
    step = gf_node_get_data(node);

    for(s = 0; s < blksize; s++) {
        gf_cable_set(out, s, page_step_playing_get(step));
    }
}

10.4.3. Step Play Node Destroy

For now, this will just use stepclk_destroy because the functionality is identical.

10.5. TODO Step Step Node

The Step-Step node sets the step size of sequencer. A step size of 1 is normal, 2 skips every other, etc. Negative values go backwards.

10.5.1. Step Step Node Setup

<<step_function_declarations>>=
static void node_step(gf_node *node, page_step_d *step);
<<step_functions>>=
static void node_step(gf_node *node, page_step_d *step)
{
    gf_node_cables_alloc(node, 1);
    gf_node_set_compute(node, stepstep_compute);
    gf_node_set_destroy(node, stepclk_destroy); /* re-use */
    gf_node_set_data(node, step);
}

10.5.2. Step Step Node Compute

<<step_function_declarations>>=
static void stepstep_compute(gf_node *node);
<<step_functions>>=
static void stepstep_compute(gf_node *node)
{
    int s;
    gf_cable *in;
    page_step_d *step;

    gf_node_get_cable(node, 0, &in);
    step = gf_node_get_data(node);
    s = floor(gf_cable_get(in, 0));

    page_step_step_set(step, s);
}

10.5.3. Step Step Node Destroy

For now, this will just use stepclk_destroy because the functionality is identical.



prev | home | next