245 lines
7.2 KiB
HTML
245 lines
7.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Motif - Procedural Music Synthesis</title>
|
|
<style>
|
|
body {
|
|
font-family: 'Monaco', 'Consolas', monospace;
|
|
background: #0a0a0a;
|
|
color: #e0e0e0;
|
|
margin: 0;
|
|
padding: 20px;
|
|
line-height: 1.5;
|
|
}
|
|
.container {
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
}
|
|
h1 {
|
|
color: #00ff88;
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
}
|
|
.controls {
|
|
margin: 20px 0;
|
|
text-align: center;
|
|
}
|
|
button {
|
|
background: #333;
|
|
color: #e0e0e0;
|
|
border: 1px solid #555;
|
|
padding: 10px 20px;
|
|
margin: 0 10px;
|
|
cursor: pointer;
|
|
font-family: inherit;
|
|
}
|
|
button:hover {
|
|
background: #444;
|
|
}
|
|
button:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
button.primary {
|
|
background: #00ff88;
|
|
color: #000;
|
|
}
|
|
button.primary:hover {
|
|
background: #00cc6a;
|
|
}
|
|
#status {
|
|
margin: 20px 0;
|
|
padding: 10px;
|
|
background: #1a1a1a;
|
|
border-left: 3px solid #00ff88;
|
|
min-height: 20px;
|
|
}
|
|
input {
|
|
background: #333;
|
|
color: #e0e0e0;
|
|
border: 1px solid #555;
|
|
padding: 8px 12px;
|
|
margin: 0 10px;
|
|
font-family: inherit;
|
|
}
|
|
|
|
.results-section {
|
|
margin: 30px 0;
|
|
display: none;
|
|
}
|
|
.results-section.visible {
|
|
display: block;
|
|
}
|
|
|
|
.results-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin: 20px 0;
|
|
}
|
|
.results-table th,
|
|
.results-table td {
|
|
padding: 8px 12px;
|
|
text-align: left;
|
|
border-bottom: 1px solid #333;
|
|
}
|
|
.results-table th {
|
|
background: #222;
|
|
color: #00ff88;
|
|
}
|
|
.results-table tr:hover {
|
|
background: #1a1a1a;
|
|
}
|
|
.results-table tr.selected {
|
|
background: #2a2a2a;
|
|
}
|
|
|
|
.confidence-bar {
|
|
width: 60px;
|
|
height: 4px;
|
|
background: #333;
|
|
border-radius: 2px;
|
|
overflow: hidden;
|
|
}
|
|
.confidence-fill {
|
|
height: 100%;
|
|
background: linear-gradient(90deg, #ff4444, #ffaa44, #00ff88);
|
|
transition: width 0.2s;
|
|
}
|
|
|
|
.player-section {
|
|
margin: 30px 0;
|
|
display: none;
|
|
}
|
|
.player-section.visible {
|
|
display: block;
|
|
}
|
|
|
|
.player-controls {
|
|
display: flex;
|
|
gap: 20px;
|
|
margin: 20px 0;
|
|
}
|
|
.player-info {
|
|
background: #1a1a1a;
|
|
padding: 15px;
|
|
margin: 15px 0;
|
|
border-left: 3px solid #555;
|
|
}
|
|
|
|
.issues {
|
|
color: #ffaa44;
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
.volume-control {
|
|
margin-top: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
.volume-control label {
|
|
font-size: 0.9em;
|
|
color: #aaa;
|
|
}
|
|
.volume-control input[type="range"] {
|
|
flex: 1;
|
|
margin: 0;
|
|
}
|
|
|
|
.engine-selector {
|
|
margin-top: 10px;
|
|
font-size: 0.9em;
|
|
}
|
|
.engine-selector label {
|
|
color: #aaa;
|
|
display: block;
|
|
margin-bottom: 5px;
|
|
}
|
|
.engine-selector select {
|
|
background: #333;
|
|
color: #e0e0e0;
|
|
border: 1px solid #555;
|
|
padding: 5px 10px;
|
|
font-family: inherit;
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>MOTIF</h1>
|
|
<p>Procedural Music Synthesis from MIDI Structure</p>
|
|
|
|
<div class="controls">
|
|
<input type="text" id="songInput" placeholder="Enter song name..." />
|
|
<button id="searchBtn">Search</button>
|
|
</div>
|
|
|
|
<div id="status">Ready. Enter a song name to search for MIDI files.</div>
|
|
|
|
<div id="resultsSection" class="results-section">
|
|
<h3>Search Results</h3>
|
|
<table id="resultsTable" class="results-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Source</th>
|
|
<th>Confidence</th>
|
|
<th>Duration</th>
|
|
<th>Tracks</th>
|
|
<th>Issues</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="resultsBody">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="playerSection" class="player-section">
|
|
<div id="selectedInfo" class="player-info">
|
|
<h4 id="selectedTitle">No MIDI selected</h4>
|
|
<p id="selectedMeta">Select a MIDI file from search results to enable playback</p>
|
|
</div>
|
|
|
|
<div class="player-controls">
|
|
<div>
|
|
<h4>MIDI Preview</h4>
|
|
<p>Plays original MIDI as-is</p>
|
|
<div class="engine-selector">
|
|
<label for="engineSelect">Playback Engine:</label>
|
|
<select id="engineSelect">
|
|
<option value="tonejs">Tone.js (Sampled Piano)</option>
|
|
<option value="soundfont">Soundfont (Piano CDN)</option>
|
|
<option value="custom">Custom Synthesis</option>
|
|
</select>
|
|
</div>
|
|
<button id="previewBtn" disabled onclick="handlePreview()">Play Original</button>
|
|
<button id="previewStopBtn" disabled>Stop</button>
|
|
<div class="volume-control">
|
|
<label for="previewVolume">Volume:</label>
|
|
<input type="range" id="previewVolume" min="0" max="1" step="0.01" value="0.6" />
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<h4>Motif Generation</h4>
|
|
<p>Procedural synthesis from structure</p>
|
|
<button id="motifBtn" disabled onclick="handleMotif()">Generate & Play</button>
|
|
<button id="motifStopBtn" disabled>Stop</button>
|
|
<div class="volume-control">
|
|
<label for="motifVolume">Volume:</label>
|
|
<input type="range" id="motifVolume" min="0" max="1" step="0.01" value="0.3" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<button id="nextResultBtn" disabled>Try Next Result</button>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
</html> |