-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeMachine(v2).scd
executable file
·124 lines (87 loc) · 3.57 KB
/
TimeMachine(v2).scd
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
/*
GuitarAMI-TStick patch SC version 1.01 -- Edu Meneses
GuitarAMI MPU (Sound Processing Unit) v.5.0 - Rpi 4
*/
// s = Server.local;
// ServerOptions.devices; // if needed to check the available interfaces
(
//Server.default.options.device_("AudioBox USB");
/*Server.local.options.blockSize = 256;
Server.local.options.numOutputBusChannels = 2; // change number of input and$
Server.local.options.numInputBusChannels = 2;
Server.internal.options.numOutputBusChannels = 2;
Server.internal.options.numInputBusChannels = 2;*/
s.waitForBoot{
//OSCdef.freeAll;
//0.5.wait;
// ........................... Global defs ............................
~id="XXX";
~midi = False;
~oscForward = False;
~oscForwardIP= "174.172.24.121"; // replace X by last IP address digits
~oscForwardPort = 8000; // has to be an int
~guitarami_input = 0;
~guitarami_output = 0;
~osc_patch_module = "/GuitarAMI_module_" ++ ~id;
~osc_patch_mpu = "/guitarami_mpu";
~lcd = NetAddr.new("127.0.0.1", 20000); // Setting LCD - Loopback NetAddr and Python code listening port
~client = NetAddr.new("172.24.1.121", 8000); // Setting LCD - Loopback NetAddr and Python code listening port
thisProcess.openUDPPort(8000);
// ......................... Global variables .........................
~lcd.sendMsg('/lcd', "GuitarAMI: ", 1, 1);
~lcd.sendMsg('/lcd', "Loading Time-Machine", 2, 1);
~lcd.sendMsg('/lcd', "[ ]", 3, 1);
(thisProcess.nowExecutingPath.dirname +/+ "common/GuitarAMI_OSC.scd").load;
~lcd.sendMsg('/lcd', "===", 3, 2);
// .............................. SYNTHS ..............................
(thisProcess.nowExecutingPath.dirname +/+ "common/TimeMachine_TM.scd").load;
// TIme-Machine starts its synths automatically to ensure sync
~lcd.sendMsg('/lcd', "====", 3, 5);
(thisProcess.nowExecutingPath.dirname +/+ "common/InfiniteReverb.scd").load;
~infinitereverb = Synth.new(\infinitereverb, [
input: ~guitarami_input,
output: ~guitarami_output
]);
~lcd.sendMsg('/lcd', "====", 3, 9);
// ............................. MAPPING ..............................
~timemachine.set(
\speed, ~sensors[\ult].asMap,
\freeze, ~sensors[\tap].asMap,
//\pitch, ,
\reset, ~sensors[\button1].asMap,
//\gatebp, ,
//\gatefreeze, ,
//\gatefft,
);
~infinitereverb.set(
\gate, ~sensors[\acclY].asMap,
\feedback, ~sensors[\acclY].asMap
);
~lcd.sendMsg('/lcd', "====", 3, 13);
// .............................. CHIME ...............................
s.sync;
(dur:1, strum: 0.1, degree: [0,4,7]).play;
// ........................... LCD MESSAGE ............................
// done LCD message
~lcd.sendMsg('/lcd', "===", 3, 17);
~lcd.sendMsg('/lcd', "Loading complete ", 2, 1);
(1.0).wait;
AppClock.sched(0.0,{
~lcd.sendMsg('/lcd', " Time-Machine", 1, 1);
~lcd.sendMsg('/lcd', "Speed: Frz: ", 2, 1);
~lcd.sendMsg('/lcd', "Fdbk: RST: ", 3, 1);
10; // delay between LCD updates
});
AppClock.sched(0.0,{
~lcd.sendMsg('/lcd', ~sensors_client[\ult].round(0.001).asString.padRight(5," "), 2, 8);
~lcd.sendMsg('/lcd', ~sensors_client[\acclY].round(0.001).asString.padRight(7," "), 3, 7);
~lcd.sendMsg('/lcd', ~sensors_client[\tap].asCompileString, 2, 20);
~lcd.sendMsg('/lcd', ~sensors_client[\button1].asCompileString, 3, 20);
~lcd.sendMsg('/lcd', ~sensors_client[\battery].asInteger.asString.padRight(3," "), 1, 1);
~lcd.sendMsg('/lcd', "%", 1, 4);
0.04; // delay between LCD updates
});
}; // end of "waitForBoot"
);
// ............................ SENSITIVITY ............................
~infinitereverb.set(\gate, 0.5);