Commit 0e3c764fe1ae89dd4a3414bb2113110ab652f669

Thomas de Grivel 2020-01-24T23:29:20

rtbuf_var -> rtbuf_in

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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
diff --git a/rtbuf.c b/rtbuf.c
index c2dd484..a630ce8 100644
--- a/rtbuf.c
+++ b/rtbuf.c
@@ -65,22 +65,22 @@ int rtbuf_new (s_rtbuf_proc *rp)
   rtb->flags = 0;
   rtb->proc = rp;
   while (j < RTBUF_PROC_IN_MAX) {
-    rtb->var[j].rtb = -1;
+    rtb->in[j].rtb = -1;
     j++;
   }
   g_rtbuf_sort = 1;
   return i;
 }
 
-void rtbuf_var_unbind (s_rtbuf *rtb, unsigned int var)
+void rtbuf_in_unbind (s_rtbuf *rtb, unsigned int in)
 {
-  s_rtbuf_binding *v = &rtb->var[var];
+  s_rtbuf_binding *v = &rtb->in[in];
   if (v->rtb >= 0) {
     s_rtbuf *src = &g_rtbuf[v->rtb];
     src->refc--;
     v->rtb = -1;
     v->out = 0;
-    rtb->var_n--;
+    rtb->in_n--;
   }
 }
 
@@ -91,12 +91,12 @@ void rtbuf_unbind_all_out_rtbuf (s_rtbuf *rtb, unsigned int rtb_i,
   unsigned int i = 0;
   unsigned int n;
   assert(dest);
-  n = dest->var_n;
+  n = dest->in_n;
   while (i < dest->proc->in_n && n > 0 && rtb->refc) {
-    s_rtbuf_binding *v = &dest->var[i];
+    s_rtbuf_binding *v = &dest->in[i];
     if (v->rtb >= 0) {
       if ((unsigned int) v->rtb == rtb_i)
-        rtbuf_var_unbind(dest, i);
+        rtbuf_in_unbind(dest, i);
       n--;
     }
     i++;
@@ -126,8 +126,8 @@ void rtbuf_unbind_all (s_rtbuf *rtb)
   unsigned int i = 0;
   assert(rtb);
   assert(rtb->proc);
-  while (i < rtb->proc->in_n && rtb->var_n > 0) {
-    rtbuf_var_unbind(rtb, i);
+  while (i < rtb->proc->in_n && rtb->in_n > 0) {
+    rtbuf_in_unbind(rtb, i);
     i++;
   }
   rtbuf_unbind_all_out(rtb);
@@ -160,23 +160,23 @@ int rtbuf_clone (s_rtbuf *rtb)
     return -1;
   new = &g_rtbuf[new_i];
   while (j < rtb->proc->in_n) {
-    new->var[j] = rtb->var[j];
+    new->in[j] = rtb->in[j];
     j++;
   }
-  new->var_n = rtb->var_n;
+  new->in_n = rtb->in_n;
   return new_i;
 }
 
 void rtbuf_bind (unsigned int src, unsigned int out,
-                 s_rtbuf *dest, unsigned int var)
+                 s_rtbuf *dest, unsigned int in)
 {
-  s_rtbuf_binding *v = &dest->var[var];
+  s_rtbuf_binding *v = &dest->in[in];
   if ((unsigned int) v->rtb == src && v->out == out)
     return;
-  rtbuf_var_unbind(dest, var);
+  rtbuf_in_unbind(dest, in);
   v->rtb = src;
   v->out = out;
-  dest->var_n++;
+  dest->in_n++;
   g_rtbuf[src].refc++;
   g_rtbuf_sort = 1;
 }
@@ -196,60 +196,60 @@ int rtbuf_data_set (s_rtbuf *rtb, symbol name, void *value,
   return 0;
 }
 
-typedef struct rtbuf_var_ptr {
+typedef struct rtbuf_in_ptr {
   unsigned int rtb;
-  unsigned int var;
-} s_rtbuf_var_ptr;
+  unsigned int in;
+} s_rtbuf_in_ptr;
 
-typedef struct rtbuf_var_stack {
-  s_rtbuf_var_ptr st[RTBUF_MAX];
+typedef struct rtbuf_in_stack {
+  s_rtbuf_in_ptr st[RTBUF_MAX];
   unsigned int size;
-} s_rtbuf_var_stack;
+} s_rtbuf_in_stack;
 
-void rtbuf_var_stack_init (s_rtbuf_var_stack *rvs)
+void rtbuf_in_stack_init (s_rtbuf_in_stack *rvs)
 {
-  //printf("rtbuf_var_stack_init\n");
-  bzero(rvs, sizeof(s_rtbuf_var_stack));
+  //printf("rtbuf_in_stack_init\n");
+  bzero(rvs, sizeof(s_rtbuf_in_stack));
 }
 
-s_rtbuf_var_ptr * rtbuf_var_stack_push (s_rtbuf_var_stack *rvs,
+s_rtbuf_in_ptr * rtbuf_in_stack_push (s_rtbuf_in_stack *rvs,
                                         unsigned int rtb,
-                                        unsigned int var)
+                                        unsigned int in)
 {
-  //printf("rtbuf_var_stack_push %i %i\n", rtb, var);
-  s_rtbuf_var_ptr *top;
+  //printf("rtbuf_in_stack_push %i %i\n", rtb, in);
+  s_rtbuf_in_ptr *top;
   if (rvs->size >= RTBUF_MAX)
     return 0;
   top = &rvs->st[rvs->size];
   top->rtb = rtb;
-  top->var = var;
+  top->in = in;
   rvs->size++;
   return top;
 }
 
-s_rtbuf_var_ptr * rtbuf_var_stack_pop (s_rtbuf_var_stack *rvs)
+s_rtbuf_in_ptr * rtbuf_in_stack_pop (s_rtbuf_in_stack *rvs)
 {
-  //printf("rtbuf_var_stack_pop\n");
+  //printf("rtbuf_in_stack_pop\n");
   if (rvs->size <= 0)
     return 0;
   rvs->size--;
   return &rvs->st[rvs->size];
 }
 
-s_rtbuf_var_ptr * rtbuf_var_stack_top (s_rtbuf_var_stack *rvs)
+s_rtbuf_in_ptr * rtbuf_in_stack_top (s_rtbuf_in_stack *rvs)
 {
-  s_rtbuf_var_ptr *top;
-  //printf("rtbuf_var_stack_top\n");
+  s_rtbuf_in_ptr *top;
+  //printf("rtbuf_in_stack_top\n");
   if (rvs->size <= 0) {
-    //printf(" rtbuf_var_stack_top => 0\n");
+    //printf(" rtbuf_in_stack_top => 0\n");
     return 0;
   }
   top = &rvs->st[rvs->size - 1];
-  //printf(" rtbuf_var_stack_top => { %u, %u }\n", top->rtb, top->var);
+  //printf(" rtbuf_in_stack_top => { %u, %u }\n", top->rtb, top->in);
   return top;
 }
 
-void rtbuf_find_roots (s_rtbuf_var_stack *rvs)
+void rtbuf_find_roots (s_rtbuf_in_stack *rvs)
 {
   s_rtbuf *rtb = g_rtbuf;
   unsigned int i = 0;
@@ -263,7 +263,7 @@ void rtbuf_find_roots (s_rtbuf_var_stack *rvs)
         rtbuf_delete_(rtb);
       else {
         if (rtb->refc == 0) {
-          rtbuf_var_stack_push(rvs, i, 0);
+          rtbuf_in_stack_push(rvs, i, 0);
           c++;
         }
       }
@@ -275,15 +275,15 @@ void rtbuf_find_roots (s_rtbuf_var_stack *rvs)
   //printf(" rtbuf_find_roots => %u\n", c);
 }
 
-void rtbuf_sort_push_child (s_rtbuf_var_stack *rvs,
-                            s_rtbuf_var_ptr *ptr)
+void rtbuf_sort_push_child (s_rtbuf_in_stack *rvs,
+                            s_rtbuf_in_ptr *ptr)
 {
   int rtb;
   unsigned int i = 0;
   int found = 0;
-  //printf("rtbuf_sort_push_child { %u, %u }\n", ptr->rtb, ptr->var);
-  rtb = g_rtbuf[ptr->rtb].var[ptr->var].rtb;
-  ptr->var++;
+  //printf("rtbuf_sort_push_child { %u, %u }\n", ptr->rtb, ptr->in);
+  rtb = g_rtbuf[ptr->rtb].in[ptr->in].rtb;
+  ptr->in++;
   if (rtb >= 0) {
     while (i < g_rtbuf_sorted_n && !found) {
       if (g_rtbuf_sorted[i] == (unsigned) rtb)
@@ -297,24 +297,24 @@ void rtbuf_sort_push_child (s_rtbuf_var_stack *rvs,
       i++;
     }
     if (!found)
-      rtbuf_var_stack_push(rvs, rtb, 0);
+      rtbuf_in_stack_push(rvs, rtb, 0);
   }
 }
 
 void rtbuf_sort ()
 {
-  s_rtbuf_var_stack rvs;
-  s_rtbuf_var_ptr *ptr;
+  s_rtbuf_in_stack rvs;
+  s_rtbuf_in_ptr *ptr;
   //printf("rtbuf_sort\n");
   if (g_rtbuf_alloc.n == 0)
     return;
-  rtbuf_var_stack_init(&rvs);
+  rtbuf_in_stack_init(&rvs);
   rtbuf_find_roots(&rvs);
   g_rtbuf_sorted_n = 0;
-  while ((ptr = rtbuf_var_stack_top(&rvs))) {
-    if (ptr->var == g_rtbuf[ptr->rtb].proc->in_n) {
+  while ((ptr = rtbuf_in_stack_top(&rvs))) {
+    if (ptr->in == g_rtbuf[ptr->rtb].proc->in_n) {
       g_rtbuf_sorted[g_rtbuf_sorted_n++] = ptr->rtb;
-      rtbuf_var_stack_pop(&rvs);
+      rtbuf_in_stack_pop(&rvs);
     } else
       rtbuf_sort_push_child(&rvs, ptr);
   }
@@ -386,11 +386,11 @@ int rtbuf_find (const char *x)
   return -1;
 }
 
-int rtbuf_var_find (s_rtbuf *rtb, const char *x)
+int rtbuf_in_find (s_rtbuf *rtb, const char *x)
 {
   s_rtbuf_proc *proc = rtb->proc;
   symbol sym;
-  //printf("rtbuf_var_find %s\n", x);
+  //printf("rtbuf_in_find %s\n", x);
   if ('0' <= x[0] && x[0] <= '9') {
     int i = atoi(x);
     if (0 <= i && (unsigned int) i < proc->in_n)
@@ -398,7 +398,7 @@ int rtbuf_var_find (s_rtbuf *rtb, const char *x)
   }
   if ((sym = symbol_find(x))) {
     unsigned int i = 0;
-    //printf("rtbuf_var_find sym %s\n", sym);
+    //printf("rtbuf_in_find sym %s\n", sym);
     while (i < proc->in_n) {
       if (sym == proc->in[i].name)
         return i;
@@ -453,7 +453,7 @@ void rtbuf_print (unsigned int i)
   fflush(stdout);
 }
 
-void rtbuf_print_long_var (s_rtbuf *rtb, unsigned int j)
+void rtbuf_print_long_in (s_rtbuf *rtb, unsigned int j)
 {
   assert(rtb);
   assert(rtb->proc);
@@ -463,11 +463,11 @@ void rtbuf_print_long_var (s_rtbuf *rtb, unsigned int j)
   assert(rtb->proc->in[j].type->name);
   printf("\n  in %i %s:%s", j, rtb->proc->in[j].name,
          rtb->proc->in[j].type->name);
-  if (rtb->var[j].rtb >= 0) {
-    s_rtbuf *target = &g_rtbuf[rtb->var[j].rtb];
-    unsigned int target_out = rtb->var[j].out;
+  if (rtb->in[j].rtb >= 0) {
+    s_rtbuf *target = &g_rtbuf[rtb->in[j].rtb];
+    unsigned int target_out = rtb->in[j].out;
     printf (" = ");
-    rtbuf_print(rtb->var[j].rtb);
+    rtbuf_print(rtb->in[j].rtb);
     printf(" out %u %s:%s", target_out,
            target->proc->out[target_out].name,
            target->proc->out[target_out].type->name);
@@ -487,7 +487,7 @@ void rtbuf_print_long (unsigned int i)
   if (rtb->data) {
     printf(" %d", rtb->refc);
     while (j < proc->in_n)
-      rtbuf_print_long_var(rtb, j++);
+      rtbuf_print_long_in(rtb, j++);
     j = 0;
     while (j < proc->out_n) {
       printf("\n  out %i %s:%s", j, proc->out[j].name,
diff --git a/rtbuf.h b/rtbuf.h
index 931319a..59f226a 100644
--- a/rtbuf.h
+++ b/rtbuf.h
@@ -36,8 +36,8 @@ struct rtbuf
   unsigned int    flags;
   s_rtbuf_proc   *proc;
   unsigned int    refc;
-  s_rtbuf_binding var[RTBUF_PROC_IN_MAX];
-  unsigned int    var_n;
+  s_rtbuf_binding in[RTBUF_PROC_IN_MAX];
+  unsigned int    in_n;
 };
 
 #define RTBUF_MAX 1000
@@ -50,12 +50,12 @@ int   librtbuf_init ();
 
 int   rtbuf_err (const char *msg);
 int   rtbuf_new (s_rtbuf_proc *rp);
-void  rtbuf_var_unbind (s_rtbuf *rtb, unsigned int var);
+void  rtbuf_in_unbind (s_rtbuf *rtb, unsigned int var);
 void  rtbuf_unbind_all (s_rtbuf *rtb);
 void  rtbuf_delete (s_rtbuf *rtb);
 int   rtbuf_clone (s_rtbuf *rtb);
 int   rtbuf_find (symbol sym);
-int   rtbuf_var_find (s_rtbuf *rtb, const char *x);
+int   rtbuf_in_find (s_rtbuf *rtb, const char *x);
 void  rtbuf_bind (unsigned int src, unsigned int out,
                   s_rtbuf *dest, unsigned int var);
 int   rtbuf_out_find (s_rtbuf *rtb, symbol sym);
diff --git a/rtbuf_cli.c b/rtbuf_cli.c
index cbbc15c..eee9cc7 100644
--- a/rtbuf_cli.c
+++ b/rtbuf_cli.c
@@ -138,18 +138,18 @@ int rtbuf_cli_bind (int argc, const char *argv[])
   int src;
   int out;
   int dest;
-  int var;
+  int in;
   if (argc != 4)
-    return rtbuf_err("usage: bind SOURCE OUT DEST VAR");
+    return rtbuf_err("usage: bind SOURCE OUT DEST IN");
   if ((src = rtbuf_find(argv[1])) < 0)
     return rtbuf_err("source buffer not found");
   if ((out = rtbuf_out_find(&g_rtbuf[src], argv[2])) < 0)
     return rtbuf_err("output not found");
   if ((dest = rtbuf_find(argv[3])) < 0)
     return rtbuf_err("destination buffer not found");
-  if ((var = rtbuf_var_find(&g_rtbuf[dest], argv[4])) < 0)
-    return rtbuf_err("variable not found");
-  rtbuf_bind(src, out, &g_rtbuf[dest], var);
+  if ((in = rtbuf_in_find(&g_rtbuf[dest], argv[4])) < 0)
+    return rtbuf_err("input not found");
+  rtbuf_bind(src, out, &g_rtbuf[dest], in);
   rtbuf_print_long(dest);
   return 0;
 }
@@ -158,14 +158,14 @@ int rtbuf_cli_unbind (int argc, const char *argv[])
 {
   int rtb;
   if (argc < 1 || argc > 2)
-    return rtbuf_err("usage: unbind BUFFER [VARIABLE]");
+    return rtbuf_err("usage: unbind BUFFER [INPUT]");
   if ((rtb = rtbuf_find(argv[1])) < 0)
     return rtbuf_err("buffer not found");
   if (argc == 2) {
-    int var = atoi(argv[2]);
-    if (var < 0 || (unsigned int) var >= g_rtbuf[rtb].proc->in_n)
-      return rtbuf_err("variable not found");
-    rtbuf_var_unbind(&g_rtbuf[rtb], var);
+    int in = atoi(argv[2]);
+    if (in < 0 || (unsigned int) in >= g_rtbuf[rtb].proc->in_n)
+      return rtbuf_err("input not found");
+    rtbuf_in_unbind(&g_rtbuf[rtb], in);
   }
   else
     rtbuf_unbind_all(&g_rtbuf[rtb]);
@@ -222,8 +222,8 @@ int rtbuf_cli_help (int argc, const char *argv[])
          " buffer N                    Show buffer N.\n"
          " new LIB PROC                Instanciate library procedure.\n"
          " delete BUFFER               Unlink and delete RTBUF.\n"
-         " bind SOURCE OUT DEST VAR    Bind SOURCE OUT to DEST VAR.\n"
-         " unbind BUFFER VAR           Unbind BUFFER VAR.\n"
+         " bind SOURCE OUT DEST IN     Bind SOURCE OUT to DEST IN.\n"
+         " unbind BUFFER IN            Unbind BUFFER IN.\n"
          " help                        Show this help message.\n"
          " exit                        Quit RTBUF.\n");
   return 0;
diff --git a/rtbuf_music.c b/rtbuf_music.c
index f5ecf81..eee7737 100644
--- a/rtbuf_music.c
+++ b/rtbuf_music.c
@@ -119,12 +119,12 @@ void rtbuf_music_notes_dt (s_rtbuf_music_notes *notes, double dt)
 }
 
 s_rtbuf_music_notes * rtbuf_music_notes (s_rtbuf *rtb,
-                                         unsigned int var)
+                                         unsigned int in)
 {
   s_rtbuf_binding *v;
   s_rtbuf *target;
   unsigned int offset;
-  v = &rtb->var[var];
+  v = &rtb->in[in];
   if (v->rtb < 0)
     return 0;
   assert(v->rtb < RTBUF_MAX);
diff --git a/rtbuf_signal.c b/rtbuf_signal.c
index 225c66f..2760a3e 100644
--- a/rtbuf_signal.c
+++ b/rtbuf_signal.c
@@ -86,7 +86,7 @@ rtbuf_signal_sample (s_rtbuf *rtb,
   assert(rtb);
   assert(rtb->proc);
   assert(in < rtb->proc->in_n);
-  v = &rtb->var[in];
+  v = &rtb->in[in];
   if (v->rtb >= 0) {
     s_rtbuf *src;
     s_rtbuf_proc_out *out;
@@ -135,7 +135,7 @@ void rtbuf_signal_fun (s_rtbuf *rtb,
   default_value = &rtb->proc->in[in].def;
   rsf->signal = default_value;
   rsf->sample_fun = rtbuf_signal_sample_from_sample;
-  v = &rtb->var[in];
+  v = &rtb->in[in];
   if (v->rtb >= 0) {
     s_rtbuf *dest;
     s_rtbuf_proc_out *out;
diff --git a/rtbuf_synth_synth.c b/rtbuf_synth_synth.c
index 9521ff5..ac0e790 100644
--- a/rtbuf_synth_synth.c
+++ b/rtbuf_synth_synth.c
@@ -21,11 +21,11 @@
 #include "rtbuf_synth.h"
 #include "rtbuf_synth_type.h"
 
-s_rtbuf * rtbuf_var_rtbuf (s_rtbuf *rtb, unsigned int var)
+s_rtbuf * rtbuf_in_rtbuf (s_rtbuf *rtb, unsigned int in)
 {
   int i;
-  assert(var < rtb->proc->in_n);
-  if ((i = rtb->var[var].rtb) < 0)
+  assert(in < rtb->proc->in_n);
+  if ((i = rtb->in[in].rtb) < 0)
     return 0;
   return &g_rtbuf[i];
 }
@@ -35,7 +35,7 @@ s_rtbuf * rtbuf_synth_synth_note_envelope (s_rtbuf *rtb, unsigned int i)
   unsigned int j;
   assert(i < RTBUF_MUSIC_NOTE_MAX);
   j = RTBUF_SYNTH_SYNTH_IN_NOTE_ENVELOPE(i);
-  return rtbuf_var_rtbuf(rtb, j);
+  return rtbuf_in_rtbuf(rtb, j);
 }
 
 s_rtbuf * rtbuf_synth_synth_note_oscillator (s_rtbuf *rtb,
@@ -44,7 +44,7 @@ s_rtbuf * rtbuf_synth_synth_note_oscillator (s_rtbuf *rtb,
   unsigned int j;
   assert(i < RTBUF_MUSIC_NOTE_MAX);
   j = RTBUF_SYNTH_SYNTH_IN_NOTE_OSCILLATOR(i);
-  return rtbuf_var_rtbuf(rtb, j);
+  return rtbuf_in_rtbuf(rtb, j);
 }
 
 void rtbuf_synth_synth_delete_note (s_rtbuf *rtb,
@@ -78,14 +78,14 @@ void rtbuf_synth_synth_delete_notes (s_rtbuf *rtb)
 s_rtbuf * rtbuf_synth_synth_new_envelope (s_rtbuf *rtb,
                                           unsigned int i)
 {
-  s_rtbuf *ref = rtbuf_var_rtbuf(rtb, RTBUF_SYNTH_SYNTH_IN_ENVELOPE);
+  s_rtbuf *ref = rtbuf_in_rtbuf(rtb, RTBUF_SYNTH_SYNTH_IN_ENVELOPE);
   int env_i;
   s_rtbuf *env;
   unsigned int env_vel;
   unsigned int env_freq;
   unsigned int env_start;
   unsigned int env_stop;
-  s_rtbuf_binding *v = &rtb->var[RTBUF_SYNTH_SYNTH_IN_NOTES];
+  s_rtbuf_binding *v = &rtb->in[RTBUF_SYNTH_SYNTH_IN_NOTES];
   unsigned int kbd_i = v->rtb;
   unsigned int kbd_notes = v->out;
   unsigned int note_vel = RTBUF_MUSIC_NOTE_IN_VELOCITY(kbd_notes, i);
@@ -98,10 +98,10 @@ s_rtbuf * rtbuf_synth_synth_new_envelope (s_rtbuf *rtb,
   if((env_i = rtbuf_clone(ref)) < 0)
     return 0;
   env = &g_rtbuf[env_i];
-  env_vel = rtbuf_var_find(env, "velocity");
-  env_freq = rtbuf_var_find(env, "frequency");
-  env_start = rtbuf_var_find(env, "start");
-  env_stop = rtbuf_var_find(env, "stop");
+  env_vel = rtbuf_in_find(env, "velocity");
+  env_freq = rtbuf_in_find(env, "frequency");
+  env_start = rtbuf_in_find(env, "start");
+  env_stop = rtbuf_in_find(env, "stop");
   rtbuf_bind(kbd_i, note_vel  , env, env_vel);
   rtbuf_bind(kbd_i, note_freq , env, env_freq);
   rtbuf_bind(kbd_i, note_start, env, env_start);
@@ -120,11 +120,11 @@ s_rtbuf * rtbuf_synth_synth_new_oscillator (s_rtbuf *rtb,
                                             unsigned int i)
 {
   s_rtbuf *ref =
-    rtbuf_var_rtbuf(rtb, RTBUF_SYNTH_SYNTH_IN_OSCILLATOR);
+    rtbuf_in_rtbuf(rtb, RTBUF_SYNTH_SYNTH_IN_OSCILLATOR);
   int osc_i;
   s_rtbuf *osc;
   unsigned int osc_freq;
-  s_rtbuf_binding *v = &rtb->var[RTBUF_SYNTH_SYNTH_IN_NOTES];
+  s_rtbuf_binding *v = &rtb->in[RTBUF_SYNTH_SYNTH_IN_NOTES];
   unsigned int kbd_i = v->rtb;
   unsigned int kbd_notes = v->out;
   unsigned int note_freq = RTBUF_MUSIC_NOTE_IN_FREQUENCY(kbd_notes, i);
@@ -134,7 +134,7 @@ s_rtbuf * rtbuf_synth_synth_new_oscillator (s_rtbuf *rtb,
   if ((osc_i = rtbuf_clone(ref)) < 0)
     return 0;
   osc = &g_rtbuf[osc_i];
-  osc_freq = rtbuf_var_find(osc, "frequency");
+  osc_freq = rtbuf_in_find(osc, "frequency");
   rtbuf_bind(kbd_i, note_freq, osc, osc_freq);
   rtbuf_bind(osc_i, 0, rtb, RTBUF_SYNTH_SYNTH_IN_NOTE_OSCILLATOR(i));
   if (osc->proc->start)