batnyan commited on
Commit
f0eb147
·
verified ·
1 Parent(s): 670de15

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +393 -81
index.html CHANGED
@@ -3,15 +3,16 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>MelodyAI - AI Music Generator</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
 
9
  <style>
10
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
11
 
12
  body {
13
  font-family: 'Poppins', sans-serif;
14
- background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
15
  min-height: 100vh;
16
  color: #fff;
17
  }
@@ -98,6 +99,40 @@
98
  from { opacity: 0; transform: translateY(10px); }
99
  to { opacity: 1; transform: translateY(0); }
100
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  </style>
102
  </head>
103
  <body class="min-h-screen flex flex-col">
@@ -111,27 +146,27 @@
111
  <div></div>
112
  <div></div>
113
  </div>
114
- <h1 class="text-2xl font-bold gradient-text">Melody<span class="text-white">AI</span></h1>
115
  </div>
116
  <nav>
117
  <ul class="flex space-x-6">
118
  <li><a href="#" class="hover:text-blue-400 transition">Home</a></li>
119
- <li><a href="#" class="hover:text-blue-400 transition">Features</a></li>
120
- <li><a href="#" class="hover:text-blue-400 transition">About</a></li>
121
  </ul>
122
  </nav>
123
  </div>
124
  </header>
125
 
126
  <main class="flex-grow container mx-auto px-4 sm:px-6 lg:px-8 py-12">
127
- <div class="max-w-4xl mx-auto">
128
  <div class="text-center mb-12">
129
- <h2 class="text-4xl font-bold mb-4">Create Your <span class="gradient-text">AI-Generated</span> Masterpiece</h2>
130
- <p class="text-gray-400 max-w-2xl mx-auto">Generate complete songs with lyrics, melody, and vocals in any style you desire. Powered by advanced AI technology.</p>
131
  </div>
132
 
133
- <div class="bg-gray-900 rounded-xl p-6 shadow-xl border border-gray-800 mb-8">
134
- <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
135
  <div>
136
  <h3 class="text-xl font-semibold mb-4">Song Parameters</h3>
137
 
@@ -184,7 +219,7 @@
184
  </div>
185
 
186
  <div>
187
- <h3 class="text-xl font-semibold mb-4">Vocal Options</h3>
188
 
189
  <div class="space-y-4">
190
  <div>
@@ -228,7 +263,18 @@
228
  </select>
229
  </div>
230
 
231
- <div class="pt-4">
 
 
 
 
 
 
 
 
 
 
 
232
  <button id="generate-btn" class="w-full bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white font-medium py-3 px-6 rounded-lg transition-all duration-300 transform hover:scale-105 flex items-center justify-center">
233
  <i class="fas fa-magic mr-2"></i> Generate Full Song
234
  </button>
@@ -249,28 +295,63 @@
249
  </div>
250
  </div>
251
  <h3 class="text-xl font-semibold mb-2">Composing your masterpiece...</h3>
252
- <p class="text-gray-400">Our AI is working hard to create your perfect song. This may take a few moments.</p>
253
  <div class="w-full bg-gray-800 rounded-full h-2.5 mt-6 max-w-md mx-auto">
254
  <div id="progress-bar" class="bg-gradient-to-r from-blue-500 to-purple-600 h-2.5 rounded-full" style="width: 0%"></div>
255
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  </div>
257
 
258
  <div id="result-container" class="hidden bg-gray-900 rounded-xl p-6 shadow-xl border border-gray-800 fade-in">
259
  <div class="flex justify-between items-center mb-6">
260
  <h3 class="text-2xl font-bold">Your AI-Generated Song</h3>
261
  <div class="flex space-x-3">
262
- <button id="download-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition">
263
  <i class="fas fa-download mr-2"></i> Download
264
  </button>
265
- <button id="regenerate-btn" class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded-lg transition">
266
  <i class="fas fa-redo mr-2"></i> Regenerate
267
  </button>
268
  </div>
269
  </div>
270
 
271
- <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
272
  <div class="lg:col-span-2">
273
- <div class="bg-gray-800 rounded-lg p-4 mb-6">
274
  <div class="flex items-center justify-between mb-4">
275
  <div>
276
  <h4 class="font-semibold text-lg" id="song-title">Summer Breeze</h4>
@@ -287,12 +368,16 @@
287
  </div>
288
 
289
  <div class="relative">
290
- <div id="waveform" class="h-20 bg-gray-700 rounded"></div>
291
  <div class="flex justify-between text-xs text-gray-400 mt-1">
292
  <span id="current-time">0:00</span>
293
  <span id="total-time">3:45</span>
294
  </div>
295
  </div>
 
 
 
 
296
  </div>
297
 
298
  <div class="bg-gray-800 rounded-lg p-6">
@@ -304,9 +389,9 @@
304
  </div>
305
 
306
  <div>
307
- <div class="bg-gray-800 rounded-lg p-6">
308
  <h4 class="font-semibold text-lg mb-4">Song Details</h4>
309
- <div class="space-y-3">
310
  <div>
311
  <p class="text-sm text-gray-400">Genre</p>
312
  <p id="detail-genre" class="font-medium">Pop</p>
@@ -327,11 +412,53 @@
327
  <p class="text-sm text-gray-400">Tempo</p>
328
  <p id="detail-tempo" class="font-medium">120 BPM</p>
329
  </div>
 
 
 
 
 
 
 
 
330
  </div>
331
 
332
  <div class="mt-6 pt-6 border-t border-gray-700">
333
  <h4 class="font-semibold text-lg mb-4">AI Insights</h4>
334
- <p class="text-gray-300 text-sm">This song was generated based on your preferences. The AI analyzed popular song structures in the selected genre and created original lyrics matching your theme.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  </div>
336
  </div>
337
  </div>
@@ -342,7 +469,7 @@
342
 
343
  <footer class="py-6 px-4 sm:px-6 lg:px-8 border-t border-gray-800">
344
  <div class="container mx-auto text-center text-gray-400">
345
- <p>© 2023 MelodyAI. All AI-generated songs are original compositions.</p>
346
  <div class="flex justify-center space-x-6 mt-4">
347
  <a href="#" class="hover:text-blue-400 transition"><i class="fab fa-twitter"></i></a>
348
  <a href="#" class="hover:text-blue-400 transition"><i class="fab fa-instagram"></i></a>
@@ -354,6 +481,7 @@
354
 
355
  <script>
356
  document.addEventListener('DOMContentLoaded', function() {
 
357
  const generateBtn = document.getElementById('generate-btn');
358
  const loadingSection = document.getElementById('loading');
359
  const resultContainer = document.getElementById('result-container');
@@ -362,57 +490,81 @@
362
  const regenerateBtn = document.getElementById('regenerate-btn');
363
  const downloadBtn = document.getElementById('download-btn');
364
  const progressBar = document.getElementById('progress-bar');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
366
  // Sample lyrics data
367
  const sampleLyrics = {
368
  pop: [
369
- {time: "0:15", text: "[Verse 1]"},
370
- {time: "0:15", text: "Summer breeze and golden rays"},
371
- {time: "0:20", text: "Dancing through the endless days"},
372
- {time: "0:25", text: "Your smile lights up my world so bright"},
373
- {time: "0:30", text: "Like the stars that fill the night"},
374
- {time: "0:40", text: ""},
375
- {time: "0:45", text: "[Pre-Chorus]"},
376
- {time: "0:45", text: "Whisper softly in my ear"},
377
- {time: "0:50", text: "Tell me that you'll always be here"},
378
- {time: "0:55", text: "Through the highs and through the lows"},
379
- {time: "1:00", text: "Our love just grows and grows"},
380
- {time: "1:10", text: ""},
381
- {time: "1:15", text: "[Chorus]"},
382
- {time: "1:15", text: "You're the rhythm to my melody"},
383
- {time: "1:20", text: "The perfect harmony"},
384
- {time: "1:25", text: "Together we can make it through"},
385
- {time: "1:30", text: "Every storm that comes our way"},
386
- {time: "1:35", text: "You're my sunshine, night and day"},
387
- {time: "1:45", text: ""},
388
- {time: "1:50", text: "[Verse 2]"},
389
- {time: "1:50", text: "City lights and neon dreams"},
390
- {time: "1:55", text: "Nothing's ever what it seems"},
391
- {time: "2:00", text: "But when I'm lost you bring me home"},
392
- {time: "2:05", text: "Never have to be alone"},
393
- {time: "2:15", text: ""},
394
- {time: "2:20", text: "[Pre-Chorus]"},
395
- {time: "2:20", text: "Whisper softly in my ear"},
396
- {time: "2:25", text: "Tell me that you'll always be here"},
397
- {time: "2:30", text: "Through the highs and through the lows"},
398
- {time: "2:35", text: "Our love just grows and grows"},
399
- {time: "2:45", text: ""},
400
- {time: "2:50", text: "[Chorus]"},
401
- {time: "2:50", text: "You're the rhythm to my melody"},
402
- {time: "2:55", text: "The perfect harmony"},
403
- {time: "3:00", text: "Together we can make it through"},
404
- {time: "3:05", text: "Every storm that comes our way"},
405
- {time: "3:10", text: "You're my sunshine, night and day"},
406
- {time: "3:20", text: ""},
407
- {time: "3:25", text: "[Bridge]"},
408
- {time: "3:25", text: "Oh-oh-oh, oh-oh-oh"},
409
- {time: "3:30", text: "Never let this feeling go"},
410
- {time: "3:35", text: "Oh-oh-oh, oh-oh-oh"},
411
- {time: "3:40", text: "This love is all I know"},
412
- {time: "3:45", text: ""},
413
- {time: "3:50", text: "[Outro]"},
414
- {time: "3:50", text: "Summer breeze and golden rays"},
415
- {time: "3:55", text: "Dancing through the endless days..."}
 
 
 
 
 
 
 
 
 
416
  ],
417
  rock: [
418
  // Sample rock lyrics would go here
@@ -422,6 +574,135 @@
422
  ]
423
  };
424
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  // Generate song function
426
  generateBtn.addEventListener('click', function() {
427
  // Show loading section
@@ -437,26 +718,38 @@
437
  const vocalGender = document.querySelector('input[name="vocal-gender"]:checked').value;
438
  const vocalStyle = document.getElementById('vocal-style').value;
439
  const language = document.getElementById('language').value;
 
440
 
441
- // Simulate progress
442
  let progress = 0;
443
  const progressInterval = setInterval(() => {
444
- progress += Math.random() * 10;
445
  if (progress > 100) progress = 100;
446
  progressBar.style.width = `${progress}%`;
447
 
 
 
 
 
 
 
 
 
 
 
 
448
  if (progress >= 100) {
449
  clearInterval(progressInterval);
450
  setTimeout(() => {
451
  loadingSection.classList.add('hidden');
452
- showGeneratedSong(genre, mood, length, theme, vocalGender, vocalStyle, language);
453
  }, 500);
454
  }
455
  }, 300);
456
  });
457
 
458
  // Show generated song
459
- function showGeneratedSong(genre, mood, length, theme, vocalGender, vocalStyle, language) {
460
  // Update song details
461
  document.getElementById('song-title').textContent = generateTitle(theme);
462
  document.getElementById('detail-genre').textContent = capitalizeFirstLetter(genre);
@@ -464,10 +757,17 @@
464
  document.getElementById('detail-length').textContent = getSongLength(length);
465
  document.getElementById('detail-key').textContent = getRandomKey();
466
  document.getElementById('detail-tempo').textContent = getRandomTempo(genre);
 
 
 
 
 
 
467
 
468
  // Display lyrics
469
  const lyricsContainer = document.getElementById('lyrics');
470
  lyricsContainer.innerHTML = '';
 
471
 
472
  const lyrics = sampleLyrics[genre] || sampleLyrics.pop;
473
  lyrics.forEach(line => {
@@ -477,9 +777,15 @@
477
  p.className += ' font-semibold text-blue-400 mt-4';
478
  }
479
  p.textContent = line.text;
 
480
  lyricsContainer.appendChild(p);
 
481
  });
482
 
 
 
 
 
483
  // Show result
484
  resultContainer.classList.remove('hidden');
485
  }
@@ -530,26 +836,32 @@
530
 
531
  // Player controls
532
  playBtn.addEventListener('click', function() {
533
- playBtn.classList.add('hidden');
534
- pauseBtn.classList.remove('hidden');
535
- // In a real app, this would play the audio
 
 
 
536
  });
537
 
538
  pauseBtn.addEventListener('click', function() {
539
- pauseBtn.classList.add('hidden');
540
- playBtn.classList.remove('hidden');
541
- // In a real app, this would pause the audio
 
 
 
542
  });
543
 
544
  // Regenerate button
545
  regenerateBtn.addEventListener('click', function() {
546
  resultContainer.classList.add('hidden');
547
- generateBtn.click();
548
  });
549
 
550
  // Download button
551
  downloadBtn.addEventListener('click', function() {
552
- alert("In a real application, this would download the song as an MP3 file.");
553
  });
554
 
555
  // Initialize form container reference
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>HarmonyAI - Complete AI Music Generator</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script src="https://cdn.jsdelivr.net/npm/wavesurfer.js@7"></script>
10
  <style>
11
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
12
 
13
  body {
14
  font-family: 'Poppins', sans-serif;
15
+ background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
16
  min-height: 100vh;
17
  color: #fff;
18
  }
 
99
  from { opacity: 0; transform: translateY(10px); }
100
  to { opacity: 1; transform: translateY(0); }
101
  }
102
+
103
+ .highlight-lyric {
104
+ background: rgba(59, 130, 246, 0.2);
105
+ border-left: 3px solid #3b82f6;
106
+ padding-left: 8px;
107
+ transition: all 0.3s ease;
108
+ }
109
+
110
+ #waveform {
111
+ cursor: pointer;
112
+ }
113
+
114
+ .vocal-visualizer {
115
+ height: 100px;
116
+ background: #1e293b;
117
+ border-radius: 8px;
118
+ margin-top: 20px;
119
+ position: relative;
120
+ overflow: hidden;
121
+ }
122
+
123
+ .vocal-bar {
124
+ position: absolute;
125
+ bottom: 0;
126
+ width: 4px;
127
+ background: linear-gradient(to top, #3b82f6, #8b5cf6);
128
+ border-radius: 2px;
129
+ animation: vocalAnimation 0.5s alternate infinite;
130
+ }
131
+
132
+ @keyframes vocalAnimation {
133
+ from { height: 10%; }
134
+ to { height: 100%; }
135
+ }
136
  </style>
137
  </head>
138
  <body class="min-h-screen flex flex-col">
 
146
  <div></div>
147
  <div></div>
148
  </div>
149
+ <h1 class="text-2xl font-bold gradient-text">Harmony<span class="text-white">AI</span></h1>
150
  </div>
151
  <nav>
152
  <ul class="flex space-x-6">
153
  <li><a href="#" class="hover:text-blue-400 transition">Home</a></li>
154
+ <li><a href="#" class="hover:text-blue-400 transition">Examples</a></li>
155
+ <li><a href="#" class="hover:text-blue-400 transition">Pricing</a></li>
156
  </ul>
157
  </nav>
158
  </div>
159
  </header>
160
 
161
  <main class="flex-grow container mx-auto px-4 sm:px-6 lg:px-8 py-12">
162
+ <div class="max-w-6xl mx-auto">
163
  <div class="text-center mb-12">
164
+ <h2 class="text-4xl font-bold mb-4">Create Complete <span class="gradient-text">AI-Generated</span> Songs</h2>
165
+ <p class="text-gray-400 max-w-2xl mx-auto">Generate professional-quality music with lyrics, melody, and vocals in any style. Powered by cutting-edge AI technology.</p>
166
  </div>
167
 
168
+ <div id="form-container" class="bg-gray-900 rounded-xl p-6 shadow-xl border border-gray-800 mb-8">
169
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
170
  <div>
171
  <h3 class="text-xl font-semibold mb-4">Song Parameters</h3>
172
 
 
219
  </div>
220
 
221
  <div>
222
+ <h3 class="text-xl font-semibold mb-4">Vocal & Instrumentation</h3>
223
 
224
  <div class="space-y-4">
225
  <div>
 
263
  </select>
264
  </div>
265
 
266
+ <div>
267
+ <label class="block text-sm font-medium text-gray-400 mb-1">Instrumentation</label>
268
+ <select id="instrumentation" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
269
+ <option value="full">Full Band</option>
270
+ <option value="acoustic">Acoustic</option>
271
+ <option value="electronic">Electronic</option>
272
+ <option value="orchestral">Orchestral</option>
273
+ <option value="minimal">Minimal</option>
274
+ </select>
275
+ </div>
276
+
277
+ <div class="pt-2">
278
  <button id="generate-btn" class="w-full bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white font-medium py-3 px-6 rounded-lg transition-all duration-300 transform hover:scale-105 flex items-center justify-center">
279
  <i class="fas fa-magic mr-2"></i> Generate Full Song
280
  </button>
 
295
  </div>
296
  </div>
297
  <h3 class="text-xl font-semibold mb-2">Composing your masterpiece...</h3>
298
+ <p class="text-gray-400">Our AI is analyzing your preferences and creating a unique song. This may take a few moments.</p>
299
  <div class="w-full bg-gray-800 rounded-full h-2.5 mt-6 max-w-md mx-auto">
300
  <div id="progress-bar" class="bg-gradient-to-r from-blue-500 to-purple-600 h-2.5 rounded-full" style="width: 0%"></div>
301
  </div>
302
+ <div class="mt-8 grid grid-cols-1 md:grid-cols-3 gap-4 max-w-2xl mx-auto">
303
+ <div class="bg-gray-800 p-4 rounded-lg">
304
+ <div class="flex items-center">
305
+ <div class="w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center mr-3">
306
+ <i class="fas fa-music text-white text-sm"></i>
307
+ </div>
308
+ <div>
309
+ <p class="text-sm text-gray-400">Generating</p>
310
+ <p class="font-medium">Melody</p>
311
+ </div>
312
+ </div>
313
+ </div>
314
+ <div class="bg-gray-800 p-4 rounded-lg opacity-50">
315
+ <div class="flex items-center">
316
+ <div class="w-8 h-8 bg-gray-600 rounded-full flex items-center justify-center mr-3">
317
+ <i class="fas fa-align-left text-white text-sm"></i>
318
+ </div>
319
+ <div>
320
+ <p class="text-sm text-gray-400">Pending</p>
321
+ <p class="font-medium">Lyrics</p>
322
+ </div>
323
+ </div>
324
+ </div>
325
+ <div class="bg-gray-800 p-4 rounded-lg opacity-50">
326
+ <div class="flex items-center">
327
+ <div class="w-8 h-8 bg-gray-600 rounded-full flex items-center justify-center mr-3">
328
+ <i class="fas fa-microphone text-white text-sm"></i>
329
+ </div>
330
+ <div>
331
+ <p class="text-sm text-gray-400">Pending</p>
332
+ <p class="font-medium">Vocals</p>
333
+ </div>
334
+ </div>
335
+ </div>
336
+ </div>
337
  </div>
338
 
339
  <div id="result-container" class="hidden bg-gray-900 rounded-xl p-6 shadow-xl border border-gray-800 fade-in">
340
  <div class="flex justify-between items-center mb-6">
341
  <h3 class="text-2xl font-bold">Your AI-Generated Song</h3>
342
  <div class="flex space-x-3">
343
+ <button id="download-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition flex items-center">
344
  <i class="fas fa-download mr-2"></i> Download
345
  </button>
346
+ <button id="regenerate-btn" class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded-lg transition flex items-center">
347
  <i class="fas fa-redo mr-2"></i> Regenerate
348
  </button>
349
  </div>
350
  </div>
351
 
352
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
353
  <div class="lg:col-span-2">
354
+ <div class="bg-gray-800 rounded-lg p-6 mb-6">
355
  <div class="flex items-center justify-between mb-4">
356
  <div>
357
  <h4 class="font-semibold text-lg" id="song-title">Summer Breeze</h4>
 
368
  </div>
369
 
370
  <div class="relative">
371
+ <div id="waveform" class="h-24 bg-gray-700 rounded"></div>
372
  <div class="flex justify-between text-xs text-gray-400 mt-1">
373
  <span id="current-time">0:00</span>
374
  <span id="total-time">3:45</span>
375
  </div>
376
  </div>
377
+
378
+ <div class="vocal-visualizer mt-6" id="vocal-visualizer">
379
+ <!-- Vocal bars will be added dynamically -->
380
+ </div>
381
  </div>
382
 
383
  <div class="bg-gray-800 rounded-lg p-6">
 
389
  </div>
390
 
391
  <div>
392
+ <div class="bg-gray-800 rounded-lg p-6 sticky top-6">
393
  <h4 class="font-semibold text-lg mb-4">Song Details</h4>
394
+ <div class="space-y-4">
395
  <div>
396
  <p class="text-sm text-gray-400">Genre</p>
397
  <p id="detail-genre" class="font-medium">Pop</p>
 
412
  <p class="text-sm text-gray-400">Tempo</p>
413
  <p id="detail-tempo" class="font-medium">120 BPM</p>
414
  </div>
415
+ <div>
416
+ <p class="text-sm text-gray-400">Vocal Style</p>
417
+ <p id="detail-vocal-style" class="font-medium">Smooth</p>
418
+ </div>
419
+ <div>
420
+ <p class="text-sm text-gray-400">Instrumentation</p>
421
+ <p id="detail-instrumentation" class="font-medium">Full Band</p>
422
+ </div>
423
  </div>
424
 
425
  <div class="mt-6 pt-6 border-t border-gray-700">
426
  <h4 class="font-semibold text-lg mb-4">AI Insights</h4>
427
+ <p class="text-gray-300 text-sm" id="ai-insights">This song combines elements of modern pop with a nostalgic summer vibe. The melody features a catchy hook and the lyrics tell a story of young love.</p>
428
+ </div>
429
+
430
+ <div class="mt-6 pt-6 border-t border-gray-700">
431
+ <h4 class="font-semibold text-lg mb-4">Song Structure</h4>
432
+ <div class="space-y-2">
433
+ <div class="flex justify-between">
434
+ <span class="text-sm">Intro</span>
435
+ <span class="text-sm text-gray-400">0:00 - 0:15</span>
436
+ </div>
437
+ <div class="flex justify-between">
438
+ <span class="text-sm">Verse 1</span>
439
+ <span class="text-sm text-gray-400">0:15 - 0:45</span>
440
+ </div>
441
+ <div class="flex justify-between">
442
+ <span class="text-sm">Chorus</span>
443
+ <span class="text-sm text-gray-400">0:45 - 1:15</span>
444
+ </div>
445
+ <div class="flex justify-between">
446
+ <span class="text-sm">Verse 2</span>
447
+ <span class="text-sm text-gray-400">1:15 - 1:45</span>
448
+ </div>
449
+ <div class="flex justify-between">
450
+ <span class="text-sm">Bridge</span>
451
+ <span class="text-sm text-gray-400">1:45 - 2:15</span>
452
+ </div>
453
+ <div class="flex justify-between">
454
+ <span class="text-sm">Final Chorus</span>
455
+ <span class="text-sm text-gray-400">2:15 - 3:00</span>
456
+ </div>
457
+ <div class="flex justify-between">
458
+ <span class="text-sm">Outro</span>
459
+ <span class="text-sm text-gray-400">3:00 - 3:45</span>
460
+ </div>
461
+ </div>
462
  </div>
463
  </div>
464
  </div>
 
469
 
470
  <footer class="py-6 px-4 sm:px-6 lg:px-8 border-t border-gray-800">
471
  <div class="container mx-auto text-center text-gray-400">
472
+ <p>© 2023 HarmonyAI. All AI-generated songs are original compositions.</p>
473
  <div class="flex justify-center space-x-6 mt-4">
474
  <a href="#" class="hover:text-blue-400 transition"><i class="fab fa-twitter"></i></a>
475
  <a href="#" class="hover:text-blue-400 transition"><i class="fab fa-instagram"></i></a>
 
481
 
482
  <script>
483
  document.addEventListener('DOMContentLoaded', function() {
484
+ // DOM Elements
485
  const generateBtn = document.getElementById('generate-btn');
486
  const loadingSection = document.getElementById('loading');
487
  const resultContainer = document.getElementById('result-container');
 
490
  const regenerateBtn = document.getElementById('regenerate-btn');
491
  const downloadBtn = document.getElementById('download-btn');
492
  const progressBar = document.getElementById('progress-bar');
493
+ const vocalVisualizer = document.getElementById('vocal-visualizer');
494
+
495
+ // Initialize WaveSurfer
496
+ let wavesurfer;
497
+ let isPlaying = false;
498
+ let currentLyricIndex = 0;
499
+ let lyricElements = [];
500
+
501
+ // Sample audio data (in a real app, this would be generated or fetched)
502
+ const sampleAudioData = {
503
+ pop: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",
504
+ rock: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3",
505
+ hiphop: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3",
506
+ electronic: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3"
507
+ };
508
 
509
  // Sample lyrics data
510
  const sampleLyrics = {
511
  pop: [
512
+ {time: 0, text: "[Instrumental Intro]"},
513
+ {time: 15, text: "[Verse 1]"},
514
+ {time: 15, text: "Summer breeze and golden rays"},
515
+ {time: 20, text: "Dancing through the endless days"},
516
+ {time: 25, text: "Your smile lights up my world so bright"},
517
+ {time: 30, text: "Like the stars that fill the night"},
518
+ {time: 40, text: ""},
519
+ {time: 45, text: "[Pre-Chorus]"},
520
+ {time: 45, text: "Whisper softly in my ear"},
521
+ {time: 50, text: "Tell me that you'll always be here"},
522
+ {time: 55, text: "Through the highs and through the lows"},
523
+ {time: 60, text: "Our love just grows and grows"},
524
+ {time: 70, text: ""},
525
+ {time: 75, text: "[Chorus]"},
526
+ {time: 75, text: "You're the rhythm to my melody"},
527
+ {time: 80, text: "The perfect harmony"},
528
+ {time: 85, text: "Together we can make it through"},
529
+ {time: 90, text: "Every storm that comes our way"},
530
+ {time: 95, text: "You're my sunshine, night and day"},
531
+ {time: 105, text: ""},
532
+ {time: 110, text: "[Instrumental Break]"},
533
+ {time: 125, text: "[Verse 2]"},
534
+ {time: 125, text: "City lights and neon dreams"},
535
+ {time: 130, text: "Nothing's ever what it seems"},
536
+ {time: 135, text: "But when I'm lost you bring me home"},
537
+ {time: 140, text: "Never have to be alone"},
538
+ {time: 150, text: ""},
539
+ {time: 155, text: "[Pre-Chorus]"},
540
+ {time: 155, text: "Whisper softly in my ear"},
541
+ {time: 160, text: "Tell me that you'll always be here"},
542
+ {time: 165, text: "Through the highs and through the lows"},
543
+ {time: 170, text: "Our love just grows and grows"},
544
+ {time: 180, text: ""},
545
+ {time: 185, text: "[Chorus]"},
546
+ {time: 185, text: "You're the rhythm to my melody"},
547
+ {time: 190, text: "The perfect harmony"},
548
+ {time: 195, text: "Together we can make it through"},
549
+ {time: 200, text: "Every storm that comes our way"},
550
+ {time: 205, text: "You're my sunshine, night and day"},
551
+ {time: 215, text: ""},
552
+ {time: 220, text: "[Bridge]"},
553
+ {time: 220, text: "Oh-oh-oh, oh-oh-oh"},
554
+ {time: 225, text: "Never let this feeling go"},
555
+ {time: 230, text: "Oh-oh-oh, oh-oh-oh"},
556
+ {time: 235, text: "This love is all I know"},
557
+ {time: 245, text: ""},
558
+ {time: 250, text: "[Final Chorus]"},
559
+ {time: 250, text: "You're the rhythm to my melody"},
560
+ {time: 255, text: "The perfect harmony"},
561
+ {time: 260, text: "Together we can make it through"},
562
+ {time: 265, text: "Every storm that comes our way"},
563
+ {time: 270, text: "You're my sunshine, night and day"},
564
+ {time: 280, text: ""},
565
+ {time: 285, text: "[Outro]"},
566
+ {time: 285, text: "Summer breeze and golden rays"},
567
+ {time: 290, text: "Dancing through the endless days..."}
568
  ],
569
  rock: [
570
  // Sample rock lyrics would go here
 
574
  ]
575
  };
576
 
577
+ // AI Insights based on genre and mood
578
+ const aiInsights = {
579
+ pop: {
580
+ happy: "This song combines elements of modern pop with an uplifting summer vibe. The melody features a catchy hook and the lyrics tell a story of young love and carefree days.",
581
+ sad: "A melancholic pop ballad with emotional vocals and introspective lyrics about heartbreak and lost love. The melody features a memorable piano line and builds to an emotional climax.",
582
+ romantic: "A smooth pop love song with tender vocals and heartfelt lyrics. The arrangement features warm synths and a gentle rhythm that creates an intimate atmosphere."
583
+ },
584
+ rock: {
585
+ happy: "An energetic rock anthem with driving guitars and powerful vocals. The lyrics celebrate freedom and living life to the fullest.",
586
+ angry: "A hard-hitting rock track with distorted guitars and aggressive vocals. The lyrics express frustration and rebellion against the system."
587
+ },
588
+ hiphop: {
589
+ happy: "An upbeat hip hop track with a bouncy beat and confident flow. The lyrics celebrate success and good times with friends.",
590
+ chill: "A laid-back hip hop groove with smooth vocals and jazzy instrumentation. The lyrics reflect on life and personal growth."
591
+ }
592
+ };
593
+
594
+ // Initialize WaveSurfer
595
+ function initWaveSurfer(audioUrl) {
596
+ if (wavesurfer) {
597
+ wavesurfer.destroy();
598
+ }
599
+
600
+ wavesurfer = WaveSurfer.create({
601
+ container: '#waveform',
602
+ waveColor: '#3b82f6',
603
+ progressColor: '#8b5cf6',
604
+ cursorColor: '#ffffff',
605
+ cursorWidth: 1,
606
+ barWidth: 2,
607
+ barRadius: 2,
608
+ barGap: 1,
609
+ height: 80,
610
+ responsive: true,
611
+ normalize: true,
612
+ partialRender: true
613
+ });
614
+
615
+ wavesurfer.load(audioUrl);
616
+
617
+ wavesurfer.on('ready', function() {
618
+ // Update total time display
619
+ const duration = wavesurfer.getDuration();
620
+ document.getElementById('total-time').textContent = formatTime(duration);
621
+
622
+ // Create vocal visualizer bars
623
+ createVocalVisualizer();
624
+ });
625
+
626
+ wavesurfer.on('audioprocess', function() {
627
+ updateCurrentTime();
628
+ highlightCurrentLyric();
629
+ });
630
+
631
+ wavesurfer.on('seek', function() {
632
+ updateCurrentTime();
633
+ highlightCurrentLyric();
634
+ });
635
+
636
+ wavesurfer.on('finish', function() {
637
+ playBtn.classList.remove('hidden');
638
+ pauseBtn.classList.add('hidden');
639
+ isPlaying = false;
640
+ });
641
+ }
642
+
643
+ // Create vocal visualizer effect
644
+ function createVocalVisualizer() {
645
+ vocalVisualizer.innerHTML = '';
646
+ const barCount = 50;
647
+
648
+ for (let i = 0; i < barCount; i++) {
649
+ const bar = document.createElement('div');
650
+ bar.className = 'vocal-bar';
651
+ bar.style.left = `${(i / barCount) * 100}%`;
652
+ bar.style.animationDelay = `${i * 0.05}s`;
653
+ vocalVisualizer.appendChild(bar);
654
+ }
655
+ }
656
+
657
+ // Format time (seconds to MM:SS)
658
+ function formatTime(seconds) {
659
+ const minutes = Math.floor(seconds / 60);
660
+ const remainingSeconds = Math.floor(seconds % 60);
661
+ return `${minutes}:${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;
662
+ }
663
+
664
+ // Update current time display
665
+ function updateCurrentTime() {
666
+ if (wavesurfer) {
667
+ const currentTime = wavesurfer.getCurrentTime();
668
+ document.getElementById('current-time').textContent = formatTime(currentTime);
669
+ }
670
+ }
671
+
672
+ // Highlight current lyric
673
+ function highlightCurrentLyric() {
674
+ if (!wavesurfer || lyricElements.length === 0) return;
675
+
676
+ const currentTime = wavesurfer.getCurrentTime() * 1000; // convert to milliseconds
677
+
678
+ // Find the current lyric
679
+ let newIndex = 0;
680
+ for (let i = 0; i < lyricElements.length; i++) {
681
+ const time = parseInt(lyricElements[i].dataset.time);
682
+ if (time <= currentTime) {
683
+ newIndex = i;
684
+ } else {
685
+ break;
686
+ }
687
+ }
688
+
689
+ // Update highlight if changed
690
+ if (newIndex !== currentLyricIndex) {
691
+ if (currentLyricIndex >= 0 && currentLyricIndex < lyricElements.length) {
692
+ lyricElements[currentLyricIndex].classList.remove('highlight-lyric');
693
+ }
694
+
695
+ currentLyricIndex = newIndex;
696
+ lyricElements[currentLyricIndex].classList.add('highlight-lyric');
697
+
698
+ // Scroll to the lyric
699
+ lyricElements[currentLyricIndex].scrollIntoView({
700
+ behavior: 'smooth',
701
+ block: 'center'
702
+ });
703
+ }
704
+ }
705
+
706
  // Generate song function
707
  generateBtn.addEventListener('click', function() {
708
  // Show loading section
 
718
  const vocalGender = document.querySelector('input[name="vocal-gender"]:checked').value;
719
  const vocalStyle = document.getElementById('vocal-style').value;
720
  const language = document.getElementById('language').value;
721
+ const instrumentation = document.getElementById('instrumentation').value;
722
 
723
+ // Simulate progress with different stages
724
  let progress = 0;
725
  const progressInterval = setInterval(() => {
726
+ progress += Math.random() * 5;
727
  if (progress > 100) progress = 100;
728
  progressBar.style.width = `${progress}%`;
729
 
730
+ // Update loading status
731
+ if (progress >= 30 && progress < 70) {
732
+ document.querySelectorAll('.bg-gray-800')[1].classList.remove('opacity-50');
733
+ document.querySelectorAll('.bg-gray-800')[1].classList.add('bg-blue-500');
734
+ document.querySelectorAll('.flex.items-center')[3].querySelector('i').className = 'fas fa-align-left text-white text-sm';
735
+ } else if (progress >= 70) {
736
+ document.querySelectorAll('.bg-gray-800')[2].classList.remove('opacity-50');
737
+ document.querySelectorAll('.bg-gray-800')[2].classList.add('bg-blue-500');
738
+ document.querySelectorAll('.flex.items-center')[5].querySelector('i').className = 'fas fa-microphone text-white text-sm';
739
+ }
740
+
741
  if (progress >= 100) {
742
  clearInterval(progressInterval);
743
  setTimeout(() => {
744
  loadingSection.classList.add('hidden');
745
+ showGeneratedSong(genre, mood, length, theme, vocalGender, vocalStyle, language, instrumentation);
746
  }, 500);
747
  }
748
  }, 300);
749
  });
750
 
751
  // Show generated song
752
+ function showGeneratedSong(genre, mood, length, theme, vocalGender, vocalStyle, language, instrumentation) {
753
  // Update song details
754
  document.getElementById('song-title').textContent = generateTitle(theme);
755
  document.getElementById('detail-genre').textContent = capitalizeFirstLetter(genre);
 
757
  document.getElementById('detail-length').textContent = getSongLength(length);
758
  document.getElementById('detail-key').textContent = getRandomKey();
759
  document.getElementById('detail-tempo').textContent = getRandomTempo(genre);
760
+ document.getElementById('detail-vocal-style').textContent = capitalizeFirstLetter(vocalStyle);
761
+ document.getElementById('detail-instrumentation').textContent = capitalizeFirstLetter(instrumentation);
762
+
763
+ // Set AI insights
764
+ const insights = aiInsights[genre]?.[mood] || "This song combines elements of your selected genre with the mood you specified. The AI analyzed popular song structures to create this original composition.";
765
+ document.getElementById('ai-insights').textContent = insights;
766
 
767
  // Display lyrics
768
  const lyricsContainer = document.getElementById('lyrics');
769
  lyricsContainer.innerHTML = '';
770
+ lyricElements = [];
771
 
772
  const lyrics = sampleLyrics[genre] || sampleLyrics.pop;
773
  lyrics.forEach(line => {
 
777
  p.className += ' font-semibold text-blue-400 mt-4';
778
  }
779
  p.textContent = line.text;
780
+ p.dataset.time = line.time * 1000; // convert to milliseconds
781
  lyricsContainer.appendChild(p);
782
+ lyricElements.push(p);
783
  });
784
 
785
+ // Initialize WaveSurfer with sample audio
786
+ const audioUrl = sampleAudioData[genre] || sampleAudioData.pop;
787
+ initWaveSurfer(audioUrl);
788
+
789
  // Show result
790
  resultContainer.classList.remove('hidden');
791
  }
 
836
 
837
  // Player controls
838
  playBtn.addEventListener('click', function() {
839
+ if (wavesurfer) {
840
+ wavesurfer.play();
841
+ playBtn.classList.add('hidden');
842
+ pauseBtn.classList.remove('hidden');
843
+ isPlaying = true;
844
+ }
845
  });
846
 
847
  pauseBtn.addEventListener('click', function() {
848
+ if (wavesurfer) {
849
+ wavesurfer.pause();
850
+ pauseBtn.classList.add('hidden');
851
+ playBtn.classList.remove('hidden');
852
+ isPlaying = false;
853
+ }
854
  });
855
 
856
  // Regenerate button
857
  regenerateBtn.addEventListener('click', function() {
858
  resultContainer.classList.add('hidden');
859
+ document.getElementById('form-container').classList.remove('hidden');
860
  });
861
 
862
  // Download button
863
  downloadBtn.addEventListener('click', function() {
864
+ alert("In a real application, this would download the song as an MP3 file with metadata.");
865
  });
866
 
867
  // Initialize form container reference