Files
musica-ia/scripts/register_project.py
renato97 85db177636 feat: Complete music project templates and generation system
🎵 Major Additions:

📁 2000s Pop Project Templates:
- Chords & melody patterns
- Drum patterns and rhythms
- Synth bass configurations
- Effects and mixing guides
- Complete project structure documentation

🧬 ALS Generation System:
- Fixed ALS generator with enhanced capabilities
- Setup scripts for easy deployment
- Comprehensive README and documentation
- Quick start guide for users
- Utility commands reference

🎼 Musical Projects:
- Salsa project (Hector Lavoe inspired) with full documentation
- 2000s Pop project with complete production guide

🔧 Utility Scripts:
- generate_salsa_project.py: Salsa-specific generator
- generate_versioned_als.py: Versioned project generation
- register_project.py: Project registration system

This significantly expands MusiaIA's capabilities with pre-built project templates and production-ready examples for multiple genres!

Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 01:14:03 +00:00

52 lines
1.8 KiB
Python
Executable File

#!/usr/bin/env python3
"""Utility to register a manually generated ALS file in the MusiaIA project metadata store."""
import argparse
import json
import os
import uuid
from pathlib import Path
PROJECTS_DIR = Path('/home/ren/musia/output/projects')
PROJECTS_DIR.mkdir(parents=True, exist_ok=True)
def main():
parser = argparse.ArgumentParser(description='Register an ALS project for the MusiaIA dashboard.')
parser.add_argument('--user', required=True, help='User ID (must match the one used in the UI)')
parser.add_argument('--name', required=True, help='Project name to display')
parser.add_argument('--file', required=True, help='Path to the ALS file')
parser.add_argument('--genre', default='Unknown', help='Genre label (optional)')
parser.add_argument('--bpm', type=int, default=120, help='BPM value (optional)')
parser.add_argument('--key', default='C', help='Key signature (optional)')
parser.add_argument('--project-id', help='Optional custom project ID (otherwise auto)')
args = parser.parse_args()
file_path = Path(args.file).expanduser().resolve()
if not file_path.exists():
raise SystemExit(f'ALS file not found: {file_path}')
project_id = args.project_id or str(uuid.uuid4())[:8]
metadata = {
'id': project_id,
'user_id': args.user,
'name': args.name,
'genre': args.genre,
'bpm': args.bpm,
'key': args.key,
'file_path': str(file_path),
'download_url': f'/api/download/{project_id}'
}
metadata_path = PROJECTS_DIR / f'{project_id}.json'
with open(metadata_path, 'w', encoding='utf-8') as fh:
json.dump(metadata, fh)
print(f'Registered {file_path} as project {project_id}')
print(f'Metadata: {metadata_path}')
if __name__ == '__main__':
main()