~pbatch/patchwerk

ref: 9896a10de32869a9113db33bb0dfc4bb4450e73c patchwerk/runt/ftbl/gen_triangle.c -rw-r--r-- 790 bytes
9896a10d — paul added gen_triangle 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#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_gen_triangle(runt_vm *vm, runt_ptr p)
{
    sp_ftbl *ft;
    runt_int rc;
    runt_stacklet *s;
    pw_patch *patch;
    sp_data *sp;

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

    patch = rpw_get_patch(p);
    sp = pw_patch_data_get(patch);

    sp_gen_triangle(sp, ft);

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

    return RUNT_OK;
}


runt_int rpw_gen_triangle(runt_vm *vm, runt_ptr p)
{
    patchwerk_word_define(vm, p,
                          "gen_triangle", 12,
                          rproc_gen_triangle);
    return RUNT_OK;
}