-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
247 lines (243 loc) · 12.2 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
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>RedNoise</title>
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="redshift.css">
<link rel="stylesheet" href="playbackcontrols.css">
<link rel="shortcut icon" href="favicon.png">
<script src="note.js" charset="utf-8"></script>
<script src="instruments.js" charset="utf-8"></script>
<script src="redshift.js" charset="utf-8"></script>
</head>
<body>
<main>
<div id="patterneditor">
<div id="song">
<div class="flexrow">
<div id="songtitle" contenteditable="true" spellcheck="false">NEW TITLE</div>
<button id="fileButton" onclick="saveSong()">
<svg width="22" height="22">
<rect x="5.5" y="10" width="11" height="7"
fill="var(--pink-grey)" rx="1" />
<rect x="5.5" y="8" width="11" height="1"
fill="var(--pink-grey)" rx="1" />
<rect x="5.5" y="7" width="6" height="2"
fill="var(--pink-grey)" rx="2" />
</svg>
</button>
</div>
<div id="songcontainer"></div>
<button class="addpatternbutton" onclick="song.addPattern()">CREATE NEW PATTERN</button>
</div>
</div>
<div id="display">
<div class="checkerboard">
<div class="displayholder">
<div id="codeoutput">
<textarea id="exacode" rows="8" cols="24" class="lockwidth" spellcheck="false"></textarea>
<div class="code-buttons">
<button onclick="song.toExacode()">Generate</button>
<button onclick="copyExacode()">Copy</button>
<label>Loop <input id="loopforever" type="checkbox" checked></label>
</div>
</div>
<div class="globaloptions">
<label>Octave <input id="octave" type="number" value="4" min="0" max="9" step="1"></label>
<label>Line Skip <input id="lineSkip" type="number" value="1" min="0" step="1"></label>
<label>Volume <input id="masterGain" type="range" value="0.5" min="0" max="1" step="0.01"></label>
<label>Focus Playhead <input id="focusPlayhead" type="checkbox" checked></label>
<button onclick="$('infopopup').classList.remove('hidden')">Show Info</button>
<label>Show Waveforms <input id="showWaveform" type="checkbox" onchange="redshiftScreen.animate = this.checked" checked></label>
</div>
</div>
</div>
</div>
<div id="rsarea">
<div id="redshift" style="filter:url(#outsetfilter);">
<div class="rstop">
<svg width="22px" height="22px" id="led">
<circle cx="8" cy="12" r="8"
fill="var(--led-red)" filter="url(#insetfilter)"
stroke-width="0.4"/>
<circle cx="8" cy="12" r="4.5"
fill="var(--led-pink)"/>
</svg>
<svg width="23px" height="22px" id="stripes">
<path d="M18 4 l-2 14 h4 l2 -14 Z" fill="var(--rs-teal)"/>
<path d="M13 4 l-2 14 h4 l2 -14 Z" fill="var(--rs-white)"/>
<path d="M2 4 l5.2 1.5 l-2 13 h4 l2 -15 Z" fill="var(--rs-red)"/>
</svg>
<div class="logo">REDSHIFT</div>
</div>
<div class="screenbox">
<canvas id="redshiftscreen" width="240" height="200"></canvas>
<div class="subline"><svg class="tinylogo" width="19" height="5">
<ellipse cx="0" cy="0" rx="1.25" ry="2.5" fill="var(--rs-red)" transform="translate(12,3)rotate(40)"/>
<ellipse cx="0" cy="0" rx="1.25" ry="2.5" fill="var(--rs-white)" transform="translate(14,3)rotate(40)"/>
<ellipse cx="0" cy="0" rx="1.25" ry="2.5" fill="var(--rs-teal)" transform="translate(15,3)rotate(40)"/>
</svg>3D CONVERGENCE DISPLAY TECHNOLOGY</div>
</div>
<svg id="redshiftbuttons" viewBox="0 0 250 200">
<defs>
<filter id="insetfilter">
<feGaussianBlur stdDeviation="0.3" in="SourceGraphic" result="BLUR"/>
<feFlood flood-color="#999" result="COLOUR"></feFlood>
<feComposite in="COLOUR" in2="BLUR" operator="in" />
<feOffset dx="0.5" dy="1" />
<feMerge>
<feMergeNode />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
<filter id="outsetfilter" height="140%" y="-10%" filterUnits="objectBoundingBox">
<feGaussianBlur stdDeviation="0.3" in="SourceGraphic" result="BLUR"/>
<feFlood flood-color="#999" result="LIGHT" />
<feGaussianBlur stdDeviation="01" in="SourceGraphic" result="DARKBLUR"/>
<feFlood flood-color="#000" result="DARK" />
<feComposite in="LIGHT" in2="BLUR" operator="in" />
<feOffset dx="-1" dy="-1.2" result="HIGHLIGHT"/>
<feComposite in="DARK" in2="DARKBLUR" operator="in" />
<feOffset dx="1.5" dy="4" result="SHADOW"/>
<feSpecularLighting in="SourceGraphic"
surfaceScale="1" specularConstant=".9"
specularExponent="17" lighting-color="var(--highlight)"
result="specOut">
<fePointLight x="-400" y="-500" z="100"/>
</feSpecularLighting>
<feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut"/>
<feComposite in="SourceGraphic" in2="specOut" operator="arithmetic"
k1="0" k2="1" k3="1" k4="0" result="litPaint"/>
<feMerge>
<feMergeNode in="HIGHLIGHT" />
<feMergeNode in="SHADOW" />
<feMergeNode in="litPaint" />
</feMerge>
</filter>
</defs>
<g id="redshiftspeaker" filter="url(#insetfilter)">
<g id="speakerdotrow">
<circle id="speakerdotdark" cx="0" cy="10" r="3.5"
fill="black" stroke="var(--highlight)"
stroke-opacity="0.18"/>
<circle id="speakerdotlight" cx="9" cy="10" r="3.5"
fill="var(--rs-body-light)" stroke="var(--highlight)"
stroke-opacity="0.15"/>
<use href="#speakerdotdark" x="18" />
<use href="#speakerdotlight" x="18" />
<use href="#speakerdotdark" x="36" />
<use href="#speakerdotlight" x="36" />
<use href="#speakerdotdark" x="54" />
</g>
<use href="#speakerdotrow" x="4" y="9" />
<use href="#speakerdotrow" x="8" y="18" />
<use href="#speakerdotrow" x="12" y="27" />
<use href="#speakerdotdark" x="16" y="35" />
<use href="#speakerdotdark" x="34" y="35" />
<use href="#speakerdotdark" x="52" y="35" />
<use href="#speakerdotdark" x="70" y="35" />
</g>
<g transform="translate(170, 130) rotate(-28)">
<circle id="button" cx="0" cy="0" r="13"
fill="var(--rs-red)" filter="url(#outsetfilter)"/>
<use href="#button" x="44" />
<use href="#button" x="88" />
<path id="buttonoutline" d="M45,-20 h-45 a15 15 0 0 0 0 40 h45"
stroke-width="1px" fill="none"/>
<use href="#buttonoutline" stroke="var(--rs-red)"/>
<use href="#buttonoutline" x="-88" transform="rotate(180)"
stroke="var(--rs-teal)" />
<text fill="var(--rs-red)" x="-8" y="40" font-size="22">X</text>
<text fill="var(--rs-red)" x="34" y="40" font-size="22">Y</text>
<text fill="var(--rs-red)" x="74" y="40" font-size="22">Z</text>
<rect x="-40" y="-88" fill="var(--rs-body-light)" width="130" height="18"/>
<circle cx="90" cy="-79" r="9" fill="var(--rs-body-light)"/>
<rect x="-9" y="-82.5" stroke="var(--dark-shadow)" width="32" height="6"
fill="var(--rs-body-light)" rx="4" filter="url(#insetfilter)"/>
<rect x="55" y="-82" stroke="var(--dark-shadow)" width="17" height="6"
fill="var(--rs-teal)" rx="4" filter="url(#insetfilter)"/>
<rect x="40" y="-82" stroke="var(--dark-shadow)" width="17" height="6"
fill="var(--rs-body-light)" rx="4" filter="url(#outsetfilter)"/>
<text fill="var(--rs-red)" x="-7" y="-90" font-size="9">START</text>
<text fill="var(--rs-red)" x="44" y="-90" font-size="9">2D 3D</text>
<path d="M38,-93 l3,-3 v6 z" fill="black" filter="url(#insetfilter)" />
<path d="M74,-93 l-3,-3 v6 z" fill="black" filter="url(#insetfilter)" />
</g>
<g id="dpad">
<path d="M-5,99 h18
q2.4,0 2.4,-2.4 v-18
q0,-2.4 2.4,-2.4 h18
q2.4,0 2.4,2.4 v18
q0,2.4 2.4,2.4 h18
q2.4,0 2.4,2.4 v18
q0,2.4 -2.4,2.4 h-18
q-2.4,0 -2.4,2.4 v18
q0,2.4 -2.4,2.4 h-18
q-2.4,0 -2.4,-2.4 v-18
q0,-2.4 -2.4,-2.4 h-18
q-2.4,0 -2.4,-2.4 v-18
q0,-2.4 2.4,-2.4 Z"
fill="var(--rs-red)" filter="url(#outsetfilter)" />
<path id="dpadcurve" d="M25,68 a22 23 0 0 0 0 84" stroke="var(--rs-red)"
fill="none" stroke-width="1" filter="url(#insetfilter)" />
<path d="M27,68.5 a22 23 0 0 1 0 84" stroke="var(--rs-teal)"
fill="none" stroke-width="1" filter="url(#insetfilter)" />
<circle cx="26.5" cy="110" r="9" fill="var(--rs-dark-red)" filter="url(#insetfilter)"/>
<rect id="horizontaldpadembed" x="18" y="97" width="18" height="2.4" fill="var(--rs-red)" filter="url(#insetfilter)"/>
<use href="#horizontaldpadembed" y="23" />
<rect id="verticaldpadembed" x="13.5" y="101" width="2.4" height="18" fill="var(--rs-red)" filter="url(#insetfilter)"/>
<use href="#verticaldpadembed" x="23.5" />
</g>
</svg>
<div id="tec">TEC</div>
</div>
</div>
<div id="playbackcontrols">
<button name="reset" onclick="song.reset()">
<svg width=38% height="50%" viewbox="0 0 102 100">
<path d="M20 99 V80 H75 Q80 80 80 75 V45 Q80 40 75 40 H40 V60 L0 30 L40 0 V20 H75 Q99 20 99 40 V80 Q99 99 80 99 Z"
style="fill:var(--dark-button);stroke:var(--mid-grey);stroke-width:4%;"/>
</svg>
</button>
<button name="stop" onclick="song.stop()">
<svg width="33%" height="30%">
<rect width="100%" height="95%" rx="10%" ry="8%" style="fill:var(--dark-button);stroke:var(--mid-grey);stroke-width:4%;" />
</svg>
</button>
<button name="step" onclick="song.pause();song.step()">
<svg width="60%" height="30%" viewbox="0 0 100 100">
<rect width="20" height="100%" rx="10%" ry="8%" style="fill:var(--dark-button);stroke:var(--mid-grey);stroke-width:3%;" />
<polygon points="40,0 100,50 40,100" style="fill:var(--dark-button);stroke:var(--mid-grey);stroke-width:3%;"/>
</svg>
</button>
<button name="play" onclick="song.play()">
<svg width=33% height="33%" viewbox="0 0 100 100">
<polygon points="0,0 100,50 0,100" style="fill:var(--dark-button);stroke:var(--mid-grey);stroke-width:3%;"/>
</svg>
</button>
</div>
<div id="urlpopup" class="hidden popup">
<button class="closepopup" onclick="this.parentElement.classList.add('hidden')">X</button>
<output><a id="linkoutput" href="#"></a></output>
<button id="copyURL" onclick="copyURL()">Copy URL</button>
</div>
<div id="infopopup" class="hidden popup">
<button class="closepopup" onclick="this.parentElement.classList.add('hidden')">X</button>
<p>Keyboard controls</p>
<ul>
<li>Notes are laid out like a piano starting from Z (C4) and Q (C5)</li>
<li>CapsLock to enter a note off command</li>
<li>Use the arrow keys to move the focus around the pattern</li>
<li>Ctrl+ArrowUp/ArrowDown or PageUp/PageDown to move between patterns</li>
<li>Space to play/pause</li>
<li>Enter to step</li>
<li>Ctrl+Space to go to the start of the song</li>
<li>Shift+Space to go to the start of the pattern</li>
</ul>
<p><a href="https://www.github.com/stellartux/rednoise" target="_blank">Source Code</a></p>
</div>
</main>
<script src="main.js" charset="utf-8"></script>
</body>
</html>