flowchart LR
subgraph Frontend["Frontend (Next.js)"]
A[MagicDropzone] --> B[API Call]
C[Results Page] --> D[ScoreRing]
C --> E[DiagnosticCard]
end
subgraph API["API Server (Flask)"]
F["/api/analyze"] --> G[AnalysisPipeline]
end
subgraph Models["AI Models (PyTorch)"]
H[StereoModel]
I[LUFSModel]
J[SpectralModel]
end
subgraph Analyzers["Audio Analyzers"]
K[LUFSAnalyzer]
L[StereoAnalyzer]
M[SpectrogramProcessor]
end
B --> F
G --> K --> I
G --> L --> H
G --> M --> J
G --> C
| Property | Value |
|---|---|
| File | src/crnn/stereo_model.pth (4KB) |
| Architecture | MLP: 4 → 16 → 8 → 1 |
| Activation | ReLU + Sigmoid |
| Training Samples | 165 |
| Validation Loss | 0.0079 |
Inputs (4 features):
user_width- Stereo width of user track (0.0-1.0)user_correlation- Phase correlation (-1.0 to 1.0)ref_width- Reference/target widthref_correlation- Reference/target correlation
Output: Quality score (0.0-1.0) → multiplied by 100 for display
| Property | Value |
|---|---|
| File | src/crnn/lufs_model.pth (4KB) |
| Architecture | MLP: 4 → 16 → 8 → 1 |
| Activation | ReLU + Dropout(0.1) + Sigmoid |
| Training Samples | 130 |
| Validation Loss | 0.0204 |
Inputs (4 features, normalized):
- (user_lufs + 30) / 30 - Normalized user LUFS
- (ref_lufs + 30) / 30 - Normalized reference LUFS
lufs_diff / 20- LUFS difference normalizedspec_std / 50- Spectral standard deviation
Output: Quality score (0.0-1.0)
| Property | Value |
|---|---|
| File | src/crnn/spectral_model.pth (7KB) |
| Architecture | MLP: 4 → 32 → 16 → 8 → 1 |
| Activation | ReLU + Dropout(0.1) + Sigmoid |
| Training Samples | 190 |
| Validation Loss | 0.0073 |
Inputs (4 features, normalized):
user_spec_mean / 50user_spec_std / 50ref_spec_mean / 50ref_spec_std / 50
Output: Quality score (0.0-1.0)
- Source: 97 rock tracks from
data/input/rock/ - Output:
data/output/reference_features/rock_references.csv
Reference Statistics:
| Metric | Mean | Std Dev |
|---|---|---|
| LUFS | -15.36 dB | 3.03 |
| Stereo Width | 0.336 (33.6%) | 0.166 |
| Phase Correlation | 0.331 | 0.349 |
File: src/data/synthetic_degradation.py
| Category | Degradations |
|---|---|
| Stereo | mono_collapse, phase_inversion, over_widening, stereo_imbalance |
| Dynamics | over_compression, clipping, volume_reduction |
| Spectral | lowpass_filter, highpass_filter, mud_boost, harsh_boost |
Process:
- Load reference track
- Apply random degradation (intensity 0.3-1.0)
- Extract features from original and degraded
- Calculate quality score based on intensity
- Save as training pair
Generated: 485 samples (97 tracks × 5 degradations)
Upload and analyze audio file.
Request: multipart/form-data
file(required): Audio filereference(optional): Reference track
Response:
{
"file": "track.mp3",
"overall_score": 62.9,
"lufs": {
"value": -13.7,
"target": -15.36,
"difference": 1.7,
"ai_score": 57
},
"stereo": {
"width": 0.24,
"correlation": 0.52,
"ai_score": 63
},
"spectral": {
"mean": 4.7,
"std": 17.0,
"ai_score": 69
},
"diagnostics": []
}Returns loaded models and status.
Returns rock reference database statistics.
| Component | Purpose |
|---|---|
MagicDropzone.tsx |
Drag & drop + file input, API submission |
ScoreRing.tsx |
Animated circular score visualization |
DiagnosticCard.tsx |
Issue/suggestion display cards |
results/page.tsx |
Full results page with all scores |
src/
├── pipeline.py # Main orchestrator
├── api_server.py # Flask REST API
├── crnn/
│ ├── models.py # Model class definitions
│ ├── stereo_model.pth # Trained weights
│ ├── lufs_model.pth
│ ├── spectral_model.pth
│ ├── train_stereo.py
│ ├── train_lufs.py
│ └── train_spectral.py
├── data/
│ ├── synthetic_degradation.py
│ ├── generate_training_data.py
│ └── extract_reference_features.py
├── pre_mastering/
│ └── lufs_comparison.py # LUFS analysis
├── stereo_field/
│ └── stereo_analyzer.py # Stereo analysis
└── process_spectrograms/
└── spectrogram_processor.py
frontend/
├── app/
│ ├── page.tsx # Home page
│ └── results/page.tsx # Results page
└── components/
├── MagicDropzone.tsx
├── ScoreRing.tsx
└── DiagnosticCard.tsx
./start.sh
# API: http://localhost:5001
# Frontend: http://localhost:3000| Current Limitation | Future Solution |
|---|---|
| Small training set (485 samples) | Collect more reference tracks |
| Synthetic degradations only | Add real user track ratings |
| Rock genre bias | Multi-genre reference databases |
| No audio file output | Add auto-mastering feature |