Transform traditional sheet music into digital formats with advanced AI-powered optical music recognition. Convert handwritten or printed sheet music to MusicXML and MIDI files instantly using our cutting-edge OEMER technology.
- AI-Powered OMR: Advanced optical music recognition using OEMER (End-to-End OMR)
- Multiple Formats: Convert to MusicXML and MIDI formats
- Web Interface: Modern, responsive Next.js web application
- Authentication: Secure user authentication with Clerk
- Production Ready: Optimized for Render deployment
- Enhanced Processing: Improved image preprocessing and error handling
- Real-time Logging: Comprehensive logging throughout the conversion process
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Clerk - Authentication and user management
- Radix UI - Accessible component library
- Node.js 18+ - Runtime environment
- Express.js - Web framework
- Sharp - High-performance image processing
- OEMER - State-of-the-art optical music recognition
- Multer - File upload handling
- Winston - Structured logging
- xml2js - XML parsing and generation
- Node.js 18 or higher
- npm or yarn
- Git
- Render account (for deployment)
- Python 3.8+ (for OEMER)
-
Clone the repository
git clone https://github.com/Ensemble-v1/ensemble-v2.git cd ensemble-v2 -
Install dependencies
# Install frontend dependencies npm install # Install backend dependencies cd backend && npm install && cd ..
-
Set up environment variables
# Copy environment files cp .env.local.example .env.local cp backend/.env.example backend/.env # Edit with your configuration # Get Clerk keys from https://clerk.com
-
Start development servers
# Start frontend (in one terminal) npm run dev # Start backend (in another terminal) cd backend && npm start
-
Open your browser
- Frontend: http://localhost:3000
- Backend: http://localhost:3001
The application requires OEMER to be installed for sheet music processing:
# Install OEMER globally (recommended)
pip install oemer
# Or install in a virtual environment
python -m venv oemer-env
source oemer-env/bin/activate # On Windows: oemer-env\Scripts\activate
pip install oemer-
Push to GitHub
git add . git commit -m "Ready for deployment" git push origin main
-
Connect to Render
- Go to Render Dashboard
- Click "New" β "Blueprint" or create services manually
-
Create Backend Service
- Service Type: Web Service
- Runtime: Node
- Build Command:
cd backend && npm install - Start Command:
cd backend && npm start - Environment Variables:
NODE_ENV=production PORT=10000 FRONTEND_URL=https://your-frontend.onrender.com CLERK_SECRET_KEY=your_clerk_secret_key CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key PYTHON_PATH=python3 # Path to Python installation
-
Create Frontend Service
- Service Type: Web Service
- Runtime: Node
- Build Command:
npm install && npm run build - Start Command:
npm start - Environment Variables:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key NEXT_PUBLIC_BACKEND_URL=https://your-backend.onrender.com
-
Update URLs
- Update
FRONTEND_URLin backend service - Update
NEXT_PUBLIC_BACKEND_URLin frontend service - Update CORS origins in backend if needed
- Update
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_BACKEND_URL=http://localhost:3001PORT=3001
NODE_ENV=development
FRONTEND_URL=http://localhost:3000
CLERK_SECRET_KEY=sk_test_...
CLERK_PUBLISHABLE_KEY=pk_test_...
PYTHON_PATH=python3ensemble-v2/
βββ app/ # Next.js frontend
β βββ components/ # Reusable components
β βββ services/ # Service pages
β βββ ...
βββ backend/ # Express.js backend
β βββ routes/ # API routes
β βββ services/ # Business logic
β β βββ oemer-service.js # OEMER integration
β β βββ midi-converter.js # MIDI conversion
β βββ middleware/ # Express middleware
β βββ utils/ # Utility functions
β βββ logs/ # Log files
β βββ temp/ # Temporary files
βββ components/ # Shared components
βββ lib/ # Shared utilities
βββ public/ # Static assets
βββ render.yaml # Render deployment config
GET /health- Health checkPOST /api/sheet-to-digital/convert- Convert sheet musicGET /api/sheet-to-digital/status/:jobId- Check conversion statusGET /api/sheet-to-digital/formats- Get supported formats
- Direct Command Execution: Uses OEMER CLI instead of complex Python scripts
- Enhanced Image Processing: Sharp-based preprocessing for better OCR results
- Comprehensive Logging: Detailed logging at every processing step
- Error Handling: Robust error handling with timeout management
- Model Verification: Automatic model file verification and download
- Mock OMR processing (no external dependencies)
- Hot reload for both frontend and backend
- Detailed error logging
- Development authentication bypass
- Enhanced debugging output
- Real OMR processing with OEMER
- Optimized builds
- Error handling for production
- Secure authentication required
- Performance monitoring
-
Build Failures
- Ensure Node.js version is 18+
- Check environment variables are set
- Verify dependencies are installed
-
Authentication Issues
- Verify Clerk keys are correct
- Check token expiration
- Ensure frontend/backend URLs match
-
File Upload Problems
- Check file size limits (50MB)
- Verify supported formats
- Ensure proper CORS configuration
-
OEMER Processing Issues
- Verify OEMER is installed:
oemer --help - Check Python path in environment variables
- Ensure model files are available
- Check for CUDA compatibility warnings (CPU fallback works)
- Verify OEMER is installed:
-
OEMER Installation
# Check if OEMER is installed oemer --help # If not installed pip install oemer # Verify installation python -c "import oemer; print('OEMER installed successfully')"
# Backend logs (when running locally)
cd backend && tail -f logs/combined.log
# Frontend logs
npm run dev # Check terminal output
# OEMER-specific logs
cd backend && tail -f logs/error.logIf OEMER models are missing:
# OEMER will automatically download models on first use
# If issues persist, try:
python -c "import oemer; print('Models path:', oemer.MODULE_PATH)"- Next.js App Router: Modern routing system
- Component-Based UI: Reusable UI components with Radix UI
- State Management: React hooks for local state
- Authentication: Clerk integration for user management
- Express.js REST API: Clean API design
- OEMER Service: Direct command-line integration
- File Processing: Sharp-based image preprocessing
- Logging: Winston structured logging
- Error Handling: Comprehensive error management
- User uploads sheet music image
- Image is preprocessed using Sharp
- OEMER processes the image to generate MusicXML
- MIDI conversion is performed if requested
- Results are packaged and returned to user
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Ensure all linting passes (
npm run lint) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use meaningful commit messages
- Add JSDoc comments for complex functions
- Ensure error handling is comprehensive
- Test your changes thoroughly
This project is licensed under the MIT License - see the LICENSE file for details.
- OEMER - State-of-the-art Optical Music Recognition
- Clerk - Authentication and user management
- Render - Hosting platform
- Sharp - High-performance image processing
For support and questions:
- Create an issue on GitHub
- Check the troubleshooting section
- Review the API documentation
- Consult the OEMER documentation
- Check the logs for detailed error information
- Verify environment variables are correctly set
- Test OEMER installation separately
- Review the API documentation for proper usage
Ready to digitize your sheet music collection? π΅β¨
Built with β€οΈ by the Ensemble Team