-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
367 lines (354 loc) · 25 KB
/
index.html
File metadata and controls
367 lines (354 loc) · 25 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
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chiptuned</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="style.css">
</head>
<body class="bg-black flex items-center justify-center min-h-screen">
<!-- Splash Screen -->
<!-- <div id="splash-overlay">
<img src="assets/chiptuned_splah.webp" alt="Loading..." id="splash-image" />
</div> -->
<!-- Mobile Message -->
<div class="mobile-message">
<p class="text-2xl font-bold">This is a desktop application.</p>
<p>Please open on a desktop to continue.</p>
</div>
<!-- Application Container -->
<div id="app-container">
<div id="aspect-lock">
<!-- Main Container -->
<div id="main-container" class="flex flex-row justify-center h-full w-full">
<!-- Sounds Panel -->
<div id="sounds-container" class="retro-container flex flex-col flex-shrink-0 w-64 p-4">
<h2 class="text-2xl font-bold mb-4 text-white flex justify-center">Sounds</h2>
<div id="sounds-panel" class="flex flex-col items-center">
<!-- Sound selection buttons will be rendered here -->
</div>
</div>
<!-- Left side: Top, Main, Bottom windows (as a column) -->
<div class="flex flex-col min-w-0 flex-grow flex-shrink">
<!-- Top Window -->
<div id="top-window" class="p-4 shadow-lg retro-container flex flex-col justify-center items-center w-full flex-shrink-0">
<div class="flex items-center w-full mb-2">
<input type="range" id="global-progress-bar" min="0" value="0" step="0.01" class="flex-grow h-2 appearance-none cursor-pointer bpm-slider">
<span id="global-timestamp" class="text-lg font-bold text-white ml-4">0:00/0:00</span>
</div>
<div id="global-seeker-controls">
<button id="global-seeker-start" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mx-auto"> << </button>
<button id="global-play-pause" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mx-auto">Play</button>
<button id="global-seeker-end" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mx-auto"> >> </button>
</div>
</div>
<!-- Main App Window -->
<div id="main-app-window" class="p-8 shadow-lg retro-container flex-grow flex flex-col">
<div class="controls mb-8 flex flex-row items-start justify-center">
<!--- Tool Selection -->
<div id="sequencer-tools" class="flex flex-row flex-nowrap gap-2">
<button id="tool-undo" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Undo</button>
<button id="tool-redo" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mr-10">Redo</button>
<button class="px-4 py-2 text-white font-bold transition duration-300 retro-button" data-tool-id="draw" data-keybind="D">Draw</button>
<button class="px-4 py-2 text-white font-bold transition duration-300 retro-button" data-tool-id="splice" data-keybind="X">Splice</button>
<button class="px-4 py-2 text-white font-bold transition duration-300 retro-button" data-tool-id="erase" data-keybind="E">Erase</button>
<button class="px-4 py-2 text-white font-bold transition duration-300 retro-button" data-tool-id="select" data-keybind="S">Select</button>
<button class="px-4 py-2 text-white font-bold transition duration-300 retro-button" data-tool-id="move" data-keybind="G">Grab</button>
<button id="tool-cut" class="px-4 py-2 text-white font-bold transition duration-300 retro-button ml-10">Cut</button>
<button id="tool-copy" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Copy</button>
<button id="tool-paste" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Paste</button>
</div>
</div>
<!-- Sequencer Controls -->
<div class="sequencer p-6 shadow-md retro-container noselect">
<div class="sequencer-controls mb-8 pb-8 border-b-2 border-gray-700 flex flex-wrap justify-center items-center gap-2">
<button id="sequencer-prev" class="h-12 px-2 py-2 text-white transition duration-300 retro-button mr-4 sequencer-arrow-button"><p>←</p></button>
<label for="bpm" class="text-lg mr-2">BPM:</label>
<input type="range" id="bpm" min="60" max="240" value="120" class="w-24 h-2 appearance-none cursor-pointer bpm-slider">
<span id="bpm-value" class="text-lg font-bold text-white cursor-pointer w-16 text-center">120</span>
<input type="number" id="bpm-text-input" class="hidden w-16 text-center bg-gray-700 text-white text-lg font-bold rounded">
<label for="bar" class="text-lg mr-2">Bar:</label>
<input type="number" id="bar" value="4" min="4" step="4" class="w-16 text-center bg-gray-700 text-white text-lg font-bold rounded text-center">
<label for="loop" class="text-lg mr-2">Loop:</label>
<input type="checkbox" id="loop" class="form-checkbox h-5 w-5 text-blue-600 focus:ring-blue-500 retro-checkbox">
<button id="clear-grid" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Clear</button>
<button id="random-grid" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Random</button>
<button id="octave-down" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Octave Down</button>
<button id="octave-up" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Octave Up</button>
<button id="sequencer-next" class="h-12 px-2 py-2 font-bold transition duration-300 retro-button ml-4 sequencer-arrow-button"><p>→</p></button>
</div>
<!-- Sequencer Grid -->
<div class="grid-wrapper relative flex mb-6 overflow-x-hidden" style="overflow-y: hidden;">
<div id="note-labels" class="grid grid-rows-8 gap-0.5"></div>
<div id="grid-container" class="grid grid-rows-8 grid-cols-32 gap-0.5" style="display: grid; grid-gap: 2px;"></div>
<div id="splice-line" class="absolute top-0 bottom-0 hidden" style="background-color: #800000; width: 1px; pointer-events: none;"></div>
<div id="selection-rectangle" class="absolute hidden"></div>
<div id="column-highlight" class="absolute top-0 bottom-0 bg-red-500 opacity-50 pointer-events-none hidden"></div>
</div>
<div class="sequencer-controls mt-8 pt-8 border-t-2 border-gray-700 flex flex-wrap justify-center items-center gap-2">
<button id="new-project" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">New Project</button>
<button id="save-project" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Save Project</button>
<button id="load-project" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Load Project</button>
<button id="save-mp3" disabled class="px-4 py-2 text-white font-bold transition duration-300 disabled:opacity-50 disabled:cursor-not-allowed retro-button">Export Project</button>
</div>
</div>
</div>
<!-- Bottom Window for Audio Bus Mixer -->
<div id="bottom-window" class="p-4 shadow-lg retro-container">
<div id="bus-mixer-container" class="flex flex-row justify-start items-center">
<!-- Buses will be dynamically added here -->
</div>
</div>
</div>
<!-- Tracks Panel -->
<div id="layer-container" class="retro-container w-64 p-4 flex flex-col flex-shrink-0">
<h2 class="text-2xl font-bold mb-4 text-white flex justify-center">Tracks</h2>
<button id="global-settings" class="absolute right-3 top-3 px-2 py-1 text-white font-bold transition duration-300 retro-button"><p>⚙</p></button>
<div class="pb-4 mb-4 border-b-2 border-gray-700">
<button id="add-layer" class="w-full px-4 py-2 text-white font-bold transition duration-300 retro-button">Add Track</button>
</div>
<div id="layer-list"></div>
</div>
</div>
</div>
</div>
<!-- Confirmation Dialog -->
<div id="confirmation-dialog-overlay" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="retro-container p-8">
<p id="confirmation-message" class="text-white text-lg mb-6 text-center">You have unsaved changes.<br>Are you sure you want to start a new project?</p>
<div class="flex justify-center gap-4">
<button id="confirm-button" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Confirm</button>
<button id="cancel-button" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Cancel</button>
</div>
</div>
</div>
<!-- Export Dialog -->
<div id="export-dialog-overlay" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="retro-container p-8">
<p class="text-white text-lg mb-6 text-center">Choose export format:</p>
<div class="flex justify-center gap-4">
<button id="export-mp3-button" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Save as MP3</button>
<button id="export-wav-button" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">Save as WAV</button>
</div>
</div>
</div>
<!-- Effects Window -->
<div id="effects-window-overlay" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="retro-container p-8 w-3/4 h-3/4 flex flex-col">
<div class="flex justify-between items-center mb-4">
<h2 id="effects-window-title" class="text-2xl font-bold text-white"></h2>
<div>
<button id="effects-window-copy" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mr-2">Copy Effects</button>
<button id="effects-window-paste" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mr-2">Paste Effects</button>
<button id="effects-window-save" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mr-2">Save Sound</button>
<button id="effects-window-reset" class="px-4 py-2 text-white font-bold transition duration-300 retro-button mr-2">Reset</button>
<button id="effects-window-close" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">X</button>
</div>
</div>
<div class="flex-grow overflow-y-auto">
<!-- ADSR -->
<div class="effect-section-container">
<div class="effect-section mb-6">
<div class="flex items-center mb-2">
<h3 class="text-xl font-bold text-white">ADSR Envelope</h3>
</div>
<div class="grid grid-cols-4 gap-4">
<div>
<div class="flex items-center">
<label for="attack-slider" class="block text-white">Attack</label>
<span class="info-icon" data-tooltip="The time it takes for the sound to reach maximum level.">i</span>
</div>
<input type="range" id="attack-slider" min="0" max="1" step="0.01" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="decay-slider" class="block text-white">Decay</label>
<span class="info-icon" data-tooltip="The time it takes for the sound to drop to the sustain level.">i</span>
</div>
<input type="range" id="decay-slider" min="0" max="1" step="0.01" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="sustain-slider" class="block text-white">Sustain</label>
<span class="info-icon" data-tooltip="The volume level the sound maintains while the note is held.">i</span>
</div>
<input type="range" id="sustain-slider" min="0" max="1" step="0.01" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="release-slider" class="block text-white">Release</label>
<span class="info-icon" data-tooltip="The time it takes for the sound to fade to silence after the note is released.">i</span>
</div>
<input type="range" id="release-slider" min="0" max="2" step="0.01" class="w-full">
</div>
</div>
</div>
</div>
<!-- LFO -->
<div class="effect-section-container">
<div class="effect-section mb-6">
<div class="flex items-center mb-2">
<h3 class="text-xl font-bold text-white">LFO (Vibrato)</h3>
</div>
<div class="grid grid-cols-3 gap-4">
<div>
<div class="flex items-center">
<label for="lfo-rate-slider" class="block text-white">Rate (Hz)</label>
<span class="info-icon" data-tooltip="The speed of the vibrato effect.">i</span>
</div>
<input type="range" id="lfo-rate-slider" min="0" max="20" step="0.1" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="lfo-depth-slider" class="block text-white">Depth</label>
<span class="info-icon" data-tooltip="The intensity of the vibrato effect.">i</span>
</div>
<input type="range" id="lfo-depth-slider" min="0" max="100" step="1" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="lfo-waveform-select" class="block text-white">Waveform</label>
<span class="info-icon" data-tooltip="The shape of the LFO wave, affecting the character of the vibrato.">i</span>
</div>
<select id="lfo-waveform-select" class="w-full retro-input">
<option value="sine">Sine</option>
<option value="square">Square</option>
<option value="sawtooth">Sawtooth</option>
<option value="triangle">Triangle</option>
</select>
</div>
</div>
</div>
</div>
<!-- Reverb -->
<div class="effect-section-container">
<div class="effect-section mb-6">
<div class="flex items-center mb-2">
<h3 class="text-xl font-bold text-white">Reverb</h3>
</div>
<div class="grid grid-cols-3 gap-4">
<div>
<div class="flex items-center">
<label for="reverb-mix-slider" class="block text-white">Mix</label>
<span class="info-icon" data-tooltip="The balance between the original (dry) sound and the reverb (wet) sound.">i</span>
</div>
<input type="range" id="reverb-mix-slider" min="0" max="1" step="0.01" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="reverb-decay-slider" class="block text-white">Decay (s)</label>
<span class="info-icon" data-tooltip="The time it takes for the reverb reflections to fade away.">i</span>
</div>
<input type="range" id="reverb-decay-slider" min="0.1" max="5" step="0.1" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="reverb-predelay-slider" class="block text-white">Pre-delay (s)</label>
<span class="info-icon" data-tooltip="The short delay before the reverb effect begins.">i</span>
</div>
<input type="range" id="reverb-predelay-slider" min="0" max="0.5" step="0.01" class="w-full">
</div>
</div>
</div>
</div>
<!-- Delay -->
<div class="effect-section-container">
<div class="effect-section mb-6">
<div class="flex items-center mb-2">
<h3 class="text-xl font-bold text-white">Delay</h3>
</div>
<div class="grid grid-cols-3 gap-4">
<div>
<div class="flex items-center">
<label for="delay-time-slider" class="block text-white">Time (s)</label>
<span class="info-icon" data-tooltip="The time between the original sound and its echo.">i</span>
</div>
<input type="range" id="delay-time-slider" min="0" max="1" step="0.01" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="delay-feedback-slider" class="block text-white">Feedback</label>
<span class="info-icon" data-tooltip="The number of times the echo repeats.">i</span>
</div>
<input type="range" id="delay-feedback-slider" min="0" max="0.9" step="0.01" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="delay-mix-slider" class="block text-white">Mix</label>
<span class="info-icon" data-tooltip="The volume of the echoes relative to the original sound.">i</span>
</div>
<input type="range" id="delay-mix-slider" min="0" max="1" step="0.01" class="w-full">
</div>
</div>
</div>
</div>
<!-- Bitcrusher -->
<div class="effect-section-container">
<div class="effect-section">
<div class="flex items-center mb-2">
<h3 class="text-xl font-bold text-white">Bitcrusher</h3>
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<div class="flex items-center">
<label for="bitcrusher-bits-slider" class="block text-white">Bits</label>
<span class="info-icon" data-tooltip="Reduces the audio's dynamic range, creating a crunchy, lo-fi sound. Lower values are more extreme.">i</span>
</div>
<input type="range" id="bitcrusher-bits-slider" min="1" max="16" step="1" class="w-full">
</div>
<div>
<div class="flex items-center">
<label for="bitcrusher-frequency-slider" class="block text-white">Frequency Reduction</label>
<span class="info-icon" data-tooltip="Lowers the sample rate, making the sound more distorted and 'aliased'.">i</span>
</div>
<input type="range" id="bitcrusher-frequency-slider" min="0" max="1" step="0.01" class="w-full">
</div>
</div>
</div>
</div>
<!-- Pan -->
<div class="effect-section-container">
<div class="effect-section">
<div class="flex items-center mb-2">
<h3 class="text-xl font-bold text-white">Pan</h3>
</div>
<div class="grid grid-cols-1 gap-4">
<div>
<div class="flex items-center">
<label for="pan-slider" class="block text-white">Left / Right</label>
<span class="info-icon" data-tooltip="Controls the stereo position of the sound, from full left to full right.">i</span>
</div>
<input type="range" id="pan-slider" min="-1" max="1" step="0.01" value="0" class="w-full">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Settings Window -->
<div id="settings-window-overlay" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="retro-container p-8 w-1/2 flex flex-col">
<div class="flex justify-between items-center mb-4 pb-4 border-b border-gray-600">
<h2 id="settings-window-title" class="text-2xl font-bold text-white" style="text-shadow: 2px 2px 0px #000000;">Settings</h2>
<button id="settings-window-close" class="px-4 py-2 text-white font-bold transition duration-300 retro-button">X</button>
</div>
<div class="flex-grow overflow-y-auto">
<div id="keybind-settings-container"></div>
<div class="flex items-center justify-between mt-4 pt-4 border-t border-gray-600">
<label class="text-white" style="text-shadow: 2px 2px 0px #000000;">Themes</label>
<div class="flex items-center gap-2">
<select class="w-96 text-center bg-gray-700 text-white font-bold rounded px-2" disabled>
<option>Coming Soon</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div id="global-tooltip"></div>
<script src="https://cdn.jsdelivr.net/npm/lamejs@1.2.0/lame.min.js"></script>
<script src="script.js"></script>
</body>
</html>