-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
187 lines (186 loc) · 6.57 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="src/style.css">
<title>Sketch: OP-Z</title>
<link rel="icon" type="image/png" sizes="16x16" href="src/img/favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<meta name="title" content="Sketch: OP-Z">
<meta name="description" content="Sketch with the OP-Z">
<meta property="og:type" content="website">
<meta property="og:url" content="https://sketch.nathanwillson.com">
<meta property="og:title" content="Sketch: OP-Z">
<meta property="og:description" content="Sketch with the OP-Z">
<meta property="og:image" content="https://sketch.nathanwillson.com/src/img/banner.png">
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://sketch.nathanwillson.com">
<meta property="twitter:title" content="Sketch: OP-Z">
<meta property="twitter:description" content="Sketch with the OP-Z">
<meta property="twitter:image" content="https://sketch.nathanwillson.com/src/img/banner.png">
<script async defer src="https://buttons.github.io/buttons.js"></script>
</head>
<body>
<div class="container">
<div id="menu">
<div class="content">
<h1>Sketch OPZ</h1>
<hr/>
<p>
Etch A Sketch meets the OP-Z.
</p>
<p class="error">
REQUIRES AN OP-Z SYNTHESIZER.
</p>
<iframe
style="display: block; margin: auto;"
width="560"
height="315"
src="https://www.youtube.com/embed/4yl8og1ltdM"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<hr/>
<h2>Instructions</h2>
</hr>
<ol>
<li>Plug in your OP-Z into your computer</li>
<li>Make sure it's set to output midi (I used <a href="https://tenage.engineering/guides/op-z/app" target="_blank">the iOS app</a> to do this)</li>
<li>Click on the connect button</li>
</ol>
<button class="mobile">
Desktop only
</button>
<button id="connect" class="desktop">
Connect
</button>
<p id="connect-error" class="error"></p>
<hr/>
<h3>OP-Z Controls</h3>
<p>
A number of the params are controllable with the OP-Z directly. Specifically using the <u>MOTION</u> track (far right).
</p>
<ul>
<li><b class='green'>GREEN DIAL</b>: ← / → ・left/right</li>
<li><b class='blue'>BLUE DIAL</b>: brush size</li>
<li><b class='yellow'>YELLOW DIAL</b>: erase (fully clockwise) </li>
<li><b class='red'>RED DIAL</b>: ↑ / ↓ ・ up/down</li>
</ul>
<p>
Just try and you'll get it.
</p>
<hr/>
<h2>Browser Support</h2>
<p>
<a href="https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess#Browser_compatibility">Unfortunately Web MIDI is supported by a limited number of browsers</a>.
</p>
<p>
<b>tl;dr, I'd recommend using Chrome.</b>
</p>
<hr/>
<h2>Code</h2>
<p>
Uses <a class="github-button" href="https://github.com/nbw/opz" data-icon="octicon-star" aria-label="Star nbw/opz on GitHub">OPZ.js</a> to parse midi. A link to the code can be found in the libary's example section.
</p>
<hr/>
<img id="opz" src="src/img/opz_white.svg"/>
</div>
</div>
<div id="sketch">
<div class="topbar">
<div class="bar">
<div class="fill">
<div class="x">
<div>
<i></i>
<i></i>
</div>
</div>
<span class="lines">
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
</span>
</div>
<div class="title">
<a href="/">SKETCH</a>
</div>
<div class="fill">
<span class="lines">
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
</span>
</div>
</div>
</div>
<div id="start">
<div>
<p>
Move both the <b class='green'>GREEN</b> and <b class='red'>RED</b> dials (motion track) to configure the brush, then click:
</p>
<button>Start</button>
</div>
</div>
<div id="screen">
<canvas id="canvas"></canvas>
</div>
<div id="keyboard">
<div class="row">
<div class="col col-4">
<div data-key="1"></div>
<div data-key="3"></div>
<div data-key="5"></div>
</div>
<div class="col col-3">
<div data-key="8"></div>
<div data-key="10"></div>
</div>
<div class="col col-4">
<div data-key="13"></div>
<div data-key="15"></div>
<div data-key="17"></div>
</div>
<div class="col col-3">
<div data-key="20"></div>
<div data-key="22"></div>
</div>
<div class="col col-14 between">
<div data-key="0"></div>
<div data-key="2"></div>
<div data-key="4"></div>
<div data-key="6"></div>
<div data-key="7"></div>
<div data-key="9"></div>
<div data-key="11"></div>
<div data-key="12"></div>
<div data-key="14"></div>
<div data-key="16"></div>
<div data-key="18"></div>
<div data-key="19"></div>
<div data-key="21"></div>
<div data-key="23"></div>
</div>
</div>
</div>
<div class="knob left">
<div>
<div class="plus"></div>
<div class="plus thin"></div>
</div>
</div>
<div class="knob right">
<div>
<div class="plus"></div>
<div class="plus thin"></div>
</div>
</div>
</div>
</div>
<script src="src/script.js"></script>
</body>
</html>