~pbatch/patchwerk

ref: 654f2fef7d07357547a173bb6856dcc8b312fd0d patchwerk/runt/runt_patchwerk.h -rw-r--r-- 2.6 KiB
654f2fef — paul re-enabled gen_sinesum and gen_composite 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef RUNT_PATCHWERK_H
#define RUNT_PATCHWERK_H

#define PW_RUNT_ERROR_CHECK(rc) if(rc != PW_OK) {\
    runt_print(vm, "Error: %s\n", pw_error(rc));\
    return RUNT_NOT_OK;\
}

typedef struct {
    char type;
    union {
        pw_cable *c;
        runt_float f;
    } data;
} rpw_param;

void patchwerk_word_define(runt_vm *vm, runt_ptr p,
    const char *str,
    runt_uint size,
    runt_proc proc);

void patchwerk_word_define_with_copy(runt_vm *vm, runt_ptr p,
    const char *str,
    runt_uint size,
    runt_proc proc,
    runt_copy_proc copy);

runt_int runt_load_nodes(runt_vm *vm, runt_ptr p);

runt_int rpw_get_param(runt_vm *vm, rpw_param *par);

runt_int rpw_peak_param(runt_vm *vm, rpw_param *par);

runt_int rpw_set_param(
    runt_vm *vm,
    pw_node *node,
    rpw_param *par,
    runt_int cable_id
);

runt_int rpw_override_param(
    runt_vm *vm,
    pw_node *node,
    rpw_param *par,
    runt_int cable_id
);

runt_int rpw_push_output (
    runt_vm *vm,
    pw_node *node,
    runt_stacklet *s,
    runt_int id
);

runt_int rpw_get_end(void);
runt_int rpw_stack_is_cable(runt_stacklet *s);
void rpw_stacklet_set_cable(runt_vm *vm,
                            runt_stacklet *s,
                            pw_cable *c);

runt_ptr runt_load_patchwerk(runt_vm *vm);
runt_ptr runt_load_patchwerk_withdata(runt_vm *vm, pw_patch *patch);

pw_patch * rpw_get_patch(runt_ptr p);

/* f-table */
runt_int rpw_ftnew(runt_vm *vm, runt_ptr p);
runt_int rpw_gen_sine(runt_vm *vm, runt_ptr p);
runt_int rpw_gen_vals(runt_vm *vm, runt_ptr p);
runt_int rpw_loadwav(runt_vm *vm, runt_ptr p);
runt_int rpw_gen_padsynth(runt_vm *vm, runt_ptr p);
runt_int rpw_ftbl_get(runt_vm *vm, const char *name, runt_ptr *p);
runt_int rpw_ftbl(runt_vm *vm, runt_ptr p);
runt_int rpw_gen_sinesum(runt_vm *vm, runt_ptr p);
runt_int rpw_ftnew(runt_vm *vm, runt_ptr p);
runt_int rpw_tblsize(runt_vm *vm, runt_ptr p);
runt_int rpw_tbldur(runt_vm *vm, runt_ptr p);
runt_int rpw_gen_composite(runt_vm *vm, runt_ptr p);

/* buffer stack operations */
runt_int rpw_bdup(runt_vm *vm, runt_ptr p);
runt_int rpw_bswap(runt_vm *vm, runt_ptr p);
runt_int rpw_bhold(runt_vm *vm, runt_ptr p);
runt_int rpw_bunhold(runt_vm *vm, runt_ptr p);
runt_int rpw_bdrop(runt_vm *vm, runt_ptr p);

/* cable type */
runt_int rpw_cable(runt_vm *vm, runt_ptr p);
runt_int rpw_param_is_constant(rpw_param *par);
runt_int rpw_param_is_cable(rpw_param *par);
pw_cable * rpw_param_get_cable(rpw_param *par);
PWFLT rpw_param_get_constant(rpw_param *par);

/* plugins */

runt_int rpw_plugin_data(runt_vm *vm, runt_ptr *p);

/* variable node */

void rpw_node_var(runt_vm *vm,
                  const char *name,
                  PWFLT *val);
#endif