-
Notifications
You must be signed in to change notification settings - Fork 1
/
max.jit.cl.noise.c
executable file
·86 lines (73 loc) · 2.3 KB
/
max.jit.cl.noise.c
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
/*
Copyright 2001-2005 - Cycling '74
Joshua Kit Clayton [email protected]
*/
#include "jit.common.h"
#include "max.jit.mop.h"
typedef struct _max_jit_cl_noise
{
t_object ob;
void *obex;
} t_max_jit_cl_noise;
t_jit_err jit_cl_noise_init(void);
void *max_jit_cl_noise_new(t_symbol *s, long argc, t_atom *argv);
void max_jit_cl_noise_free(t_max_jit_cl_noise *x);
void max_jit_cl_noise_outputmatrix(t_max_jit_cl_noise *x);
void *max_jit_cl_noise_class;
void main(void)
{
void *p,*q;
jit_cl_noise_init();
setup(&max_jit_cl_noise_class, max_jit_cl_noise_new, (method)max_jit_cl_noise_free, (short)sizeof(t_max_jit_cl_noise),
0L, A_GIMME, 0);
p = max_jit_classex_setup(calcoffset(t_max_jit_cl_noise,obex));
q = jit_class_findbyname(gensym("jit_cl_noise"));
max_jit_classex_mop_wrap(p,q,MAX_JIT_MOP_FLAGS_OWN_OUTPUTMATRIX|MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX);
max_jit_classex_standard_wrap(p,q,0);
max_addmethod_usurp_low((method)max_jit_cl_noise_outputmatrix, "outputmatrix");
addmess((method)max_jit_mop_assist, "assist", A_CANT,0);
}
void max_jit_cl_noise_outputmatrix(t_max_jit_cl_noise *x)
{
long outputmode=max_jit_mop_getoutputmode(x);
void *mop=max_jit_obex_adornment_get(x,_jit_sym_jit_mop);
t_jit_err err;
if (outputmode&&mop) { //always output unless output mode is none
if (outputmode==1) {
if (err=(t_jit_err)jit_object_method(
max_jit_obex_jitob_get(x),
_jit_sym_matrix_calc,
jit_object_method(mop,_jit_sym_getinputlist),
jit_object_method(mop,_jit_sym_getoutputlist)))
{
jit_error_code(x,err);
} else {
max_jit_mop_outputmatrix(x);
}
} else {
max_jit_mop_outputmatrix(x);
}
}
}
void max_jit_cl_noise_free(t_max_jit_cl_noise *x)
{
max_jit_mop_free(x);
jit_object_free(max_jit_obex_jitob_get(x));
max_jit_obex_free(x);
}
void *max_jit_cl_noise_new(t_symbol *s, long argc, t_atom *argv)
{
t_max_jit_cl_noise *x;
void *o;
if (x=(t_max_jit_cl_noise *)max_jit_obex_new(max_jit_cl_noise_class,gensym("jit_cl_noise"))) {
if (o=jit_object_new(gensym("jit_cl_noise"))) {
max_jit_mop_setup_simple(x,o,argc,argv);
max_jit_attr_args(x,argc,argv);
} else {
jit_object_error((t_object *)x,"jit.cl.noise: could not allocate object");
freeobject(x);
x = NULL;
}
}
return (x);
}