This repository was archived by the owner on Mar 30, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestFile.js
More file actions
77 lines (60 loc) · 1.53 KB
/
TestFile.js
File metadata and controls
77 lines (60 loc) · 1.53 KB
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
autowatch = 1;
// 1st test: classes don't exist on max msp' javascript:
// class Rectangle {
// constructor(height, width) {
// this.height = height;
// this.width = width;
// }
// }
function Rectangle(width, height) {
this.width = width;
this.height = height;
}
var rectangle = new Rectangle(10, 10)
function bang() {
post("\n");
post("rectangle 3->", rectangle.width, rectangle.height);
post("\n");
}
// 2nd test: Where is patcher?
function whereIsPatcher() {
post("\n");
post(" --> whereIsPatcher??")
post("\n");
post("top level function this.patcher ->", this.patcher)
post("\n");
function secondLevelFunction() {
post("\n");
post("second level function this.patcher ->", this.patcher);
post("second level function patcher ->", patcher)
post("patcher is global!!")
post("\n");
}
secondLevelFunction()
}
function whereIsPatcherFixed() {
post("\n");
post(" --> whereIsPatcherFixed??")
post("\n");
post("\n");
post("top level function this.patcher ->", this.patcher)
post("\n");
post("top level function p ->", p)
post("\n");
const patcher = this.patcher
function secondLevelFunction() {
post("\n");
post("second level function this.patcher ->", this.patcher);
post("\n");
post("second level function patcher ->", patcher)
post("\n");
post("second level function p ->", p)
post("\n");
}
secondLevelFunction()
}
// 3nd test: get box rect
function getPatchPresentationRect(){
var object = this.patcher.getnamed("multislider_0")
post("object ->", object.getattr('presentation_rect') )
}