-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
235 lines (197 loc) · 9.37 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Espnode86 - Audio Designer</title>
<!-- replace double equals signs with double dashes to get html head like below generated -->
<!-- gulp html-head ==style quartz ==renderer html ==toolkit util ==toolkit timbre ==root .. -->
<!-- or run this, and get everything combined in two files: rpd.js and rpd.css -->
<!-- gulp ==style quartz ==renderer html ==toolkit util ==toolkit timbre -->
<!-- Built with RPD v2.0.0 <http://shamansir.github.io/rpd> -->
<!-- RPD Renderer: html -->
<!-- <link rel="stylesheet" href="vendor/render/html.css"></style> -->
<!-- RPD Style: quartz (html) -->
<!-- <link rel="stylesheet" href="vendor/style/quartz/html.css"></style> -->
<!-- RPD Toolkit: timbre (html) -->
<!-- <link rel="stylesheet" href="vendor/timbre/html.css"></style> -->
<!-- RPD Toolkit: util (html) -->
<!-- <link rel="stylesheet" href="vendor/util/html.css"></style> -->
<!-- <link rel="stylesheet" href="vendor/rpd.css"></style> -->
<!-- Timbre -->
<!-- <script src="http://mohayonao.github.io/timbre.js/timbre.js"></script> -->
<!-- Mithril -->
<script src="vendor/mithril_1.1.6.js"></script>
<!-- Kefir -->
<script src="vendor/kefir.min.js"></script>
<!-- RPD -->
<script src="vendor/rpd.min.js"></script>
<!-- RPD Toolkit: util -->
<script src="vendor/util/shared.js"></script>
<!-- <script src="vendor/util/toolkit.js"></script> -->
<!-- RPD Toolkit: util (html) -->
<!-- <script src="vendor/util/html.js"></script> -->
<!-- RPD Toolkit: timbre -->
<!-- <script src="../src/toolkit/timbre/shared.js"></script> -->
<!-- <script src="../src/toolkit/timbre/toolkit.js"></script> -->
<!-- RPD Toolkit: timbre (html) -->
<!-- <script src="../src/toolkit/timbre/html.js"></script> -->
<!-- <script src="../src/io/json.js"></script> -->
<script src="vendor/vex.combined.min.js"></script>
<script>vex.defaultOptions.className = 'vex-theme-wireframe'</script>
<link rel="stylesheet" href="vendor/vex.css" />
<link rel="stylesheet" href="vendor/vex-theme-wireframe.css" />
<!-- drag drop file open -->
<script src="vendor/filereader.js"></script>
<!-- underscore -->
<script src="vendor/underscore.js"></script>
<script src="vendor/hotkeys.min.js"></script>
<!-- Espnode custom node -->
<script src="js/espnode.js"></script>
<script src="js/nodes/espbeatbyte.js"></script>
<script src="js/nodes/esposc.js"></script>
<script src="js/nodes/esppot.js"></script>
<script src="js/nodes/espwavetable.js"></script>
<!-- Espnode system -->
<script src="js/espeditor.js"></script>
<script src="js/espexport.js"></script>
<link rel="stylesheet" href="css/espnode.css"></style>
<link id="theme_css" rel="stylesheet" href="css/rpd-dark.css"></style>
</head>
<body id="main">
<div class="egolab" style="z-index: 1; line-height: 1.5em; font-size: 0.8em;color: #fff; position: absolute; bottom: 50px; left: 50px; z-index: 100000;">
Espnode86 : Audio Design Tools For Espsynth86<br> Press CTRL+L to Save Code, CTRL+O To Load Code, CTRL+K to Copy Code <br> <span style="line-height: 1.5em; font-size:0.8em">Code by Budi Prakosa powered by RPD 2.1.1 and MicrobeModular Equation Player sound engine</span>
</div>
<div id="splash" style="display: none;">
<div style="width: 500px">
<img src="images/esptiny.png">
</div>
</div>
<script>
var modalOpen = 0;
function replaceAll(str, find, replace) {
return str.replace(new RegExp(find, 'g'), replace);
}
var finalize = Rpd.export.plain("TEST");
Rpd.renderNext('html', document.body, { style: 'quartz', fullPage: true });
var root = Rpd.addPatch('root');
espRoot = root;
var nodeList = root.addNode('espnode/nodelist');
FileReaderJS.setupDrop(document.body, {
readAsDefault: "Text",
on: {
load: function(e, file) {
NodeImportCpp(e.target.result);
// espRoot.close();
// espNodeReset();
// NodeImportCpp(e.target.result);
}
}
});
var chooseTheme = function(theme) {
console.log(theme);
document.getElementById('theme_css').href = 'css/' + theme;
}
hotkeys('ctrl+o,ctrl+k,ctrl+l,ctrl+1,ctrl+2,ctrl+3,ctrl+4', function(event, handler) {
event.preventDefault();
switch(handler.key){
case "ctrl+o": loadNodeCode(); break;
case "ctrl+k": showNodeCode(); break;
case "ctrl+l": NodeToCPPDownload(); break;
case "ctrl+1": chooseTheme('rpd-pink.css'); break;
case "ctrl+2": chooseTheme('rpd-coco.css'); break;
case "ctrl+3": chooseTheme('rpd-dark.css'); break;
case "ctrl+4": chooseTheme('rpd-90s.css'); break;
}
return false;
});
var showNodeCode = function()
{
if (modalOpen === 1) return;
modalOpen = 1;
vex.dialog.defaultOptions.showCloseButton = false;
vex.dialog.open({
message: 'Copy paste to your Synth.h file',
showCloseButton: false,
buttons: [{ text: 'OK' }],
input: [
'<style>',
'.vex-custom-field-wrapper {',
'margin: 1em 0;',
'}',
'.vex-custom-field-wrapper > label {',
'display: inline-block;',
'margin-bottom: .0em;',
'}',
'</style>',
'<div class="vex-custom-field-wrapper">',
'<div class="vex-custom-input-wrapper">',
'<textarea rows="20" cols="80" style="font-size: 0.6em; border: solid 1px">' + NodeToCPPandNetwork() + '</textarea>',
'</div>',
'</div>'
].join(''),
beforeOpen: function(){
// modalOpen = 1;
},
beforeClose: function(){
modalOpen = 0;
},
callback: function (data) {
}
})
}
var loadNodeCode = function()
{
if (modalOpen === 1) return;
modalOpen = 1;
vex.dialog.defaultOptions.showCloseButton = false;
vex.dialog.open({
message: 'Paste your Synth.h file here',
showCloseButton: false,
buttons: [{ text: 'OK' }],
input: [
'<style>',
'.vex-custom-field-wrapper {',
'margin: 1em 0;',
'}',
'.vex-custom-field-wrapper > label {',
'display: inline-block;',
'margin-bottom: .0em;',
'}',
'</style>',
'<div class="vex-custom-field-wrapper">',
'<div class="vex-custom-input-wrapper">',
'<textarea id="txtimport" name="code" rows="20" cols="80" style="font-size: 0.6em; border: solid 1px">' + '</textarea>',
'</div>',
'</div>'
].join(''),
beforeClose: function(){
modalOpen = 0;
},
callback: function(data)
{
// console.log(data)
},
onSubmit: function(event)
{
var code_import = (document.getElementById('txtimport').value);
NodeImportCpp(code_import);
//NodeToCPPandNetwork().substr(42+22,261-65)
event.stopPropagation();
event.preventDefault();
modalOpen = 0;
return this.close()
}
})
}
</script>
<script>
vex.dialog.alert({
className: "vex-theme-wireframe vex-splash",
contentClassName: "vex-content vex-content-splash",
unsafeMessage: document.getElementById("splash").innerHTML,
callback: function(){
}
});
</script>
</body>
</html>