-
Notifications
You must be signed in to change notification settings - Fork 1
/
synfactory_objects.m4
62 lines (56 loc) · 1.79 KB
/
synfactory_objects.m4
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
module([objects])
#
# Object macros
#
define([defobj],[
Enum([Object],[OBJECT_$1])
Enum([Menu],[MENU_OBJECT_$1])
MacroBack([__ObjectTitles],[case OBJECT_$1: return "[$2]";])
ifelse([$3],,,[MacroBack([__ObjectKeys],[[case '$3': return OBJECT_$1;]])])
ifelse([$7],NULL,,[MacroBack([__ObjectMenus],[[case OBJECT_$1: return $7;]])])
])
#
# Object support functions
#
code4([block([[Get the module title for given object type]])[
static const char *objectToTitle(Object_t aObject) {
switch(aObject) {]indent(1,__ObjectTitles)[
default:
break;
}
return "???";
}]])
code4([block([[Convert a key pressed on the keyboard to object type]])[
static Object_t keyToObject(int aKey) {
switch(aKey) {]indent(1,__ObjectKeys)[
default:
break;
}
return OBJECT_NONE;
}]])
code4([block([[Convert from object to menu name]])[
static const char *objectToMenu(Object_t aObject) {
switch(aObject) {]indent(1,__ObjectMenus)[
default:
break;
}
return NULL;
}]])
#
# Object definitions
# flags
# |
# Object id Title key | dsp help menu
#
defobj([NONE], [---], , , , , [NULL])
defobj([UNKNOWN], [???], , , , , [NULL])
defobj([ADD], [ADD], a, , , , ["ADD - Adder\tA"])
defobj([MUL], [MUL], m, , , , ["MUL - Multiplier/Ringmodulator\tM"])
defobj([SUB], [SUB], s, , , , ["SUB - Subtractor\tU"])
defobj([SPLIT], [SPLIT], I, , , , ["SPLIT - Positive and negative signal splitter\tShift+I"])
defobj([MINMAX], [MINMAX], , , , , ["MINMAX - Get minimum and maximum of two input signals"])
defobj([BETWEEN], [BETWEEN], , , , , ["BETWEEN - Window comparator"])
defobj([EXPLIN], [EXPLIN], , , , , ["EXPLIN - Convert exponential input to linear range"])
# Cleanup
#
undefine([defobj])