~pbatch/patchwerk

2f4e1f275e929a6e32c10b9733227e5819399d6a — paul 8 months ago 9a8cc72
added missing fftcut files

FossilOrigin-Name: 2cd9b990bc1dc51172eec1dc1cfcfe9e19b06578b5838904f5a1807e38baaf82
1 files changed, 42 insertions(+), 0 deletions(-)

A runt/ftbl/fftcut.c
A runt/ftbl/fftcut.c => runt/ftbl/fftcut.c +42 -0
@@ 0,0 1,42 @@
#include <stdio.h>
#include <runt.h>
#include <soundpipe.h>
#include "patchwerk.h"
#include "runt_patchwerk.h"
#include "runt_ftbl.h"
#include "ugen_enums.h"

static runt_int rproc_fftcut(runt_vm *vm, runt_ptr p)
{
    sp_ftbl *ft;
    runt_int rc;
    runt_stacklet *s;
    pw_patch *patch;
    int cut;

    rc = rpw_get_ftable(vm, &ft);
    RUNT_ERROR_CHECK(rc);

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    cut = s->f;

    patch = rpw_get_patch(p);

    sp_ftbl_fftcut(ft, cut);

    rc = runt_ppush(vm, &s);
    RUNT_ERROR_CHECK(rc);
    rpw_stacklet_ftable(vm, s, ft);

    return RUNT_OK;
}


runt_int rpw_fftcut(runt_vm *vm, runt_ptr p)
{
    patchwerk_word_define(vm, p,
                          "fftcut", 6,
                          rproc_fftcut);
    return RUNT_OK;
}