I built Melodic Airways - a web app that converts real flight routes into unique musical compositions using AI and graph algorithms.
How it works
Pick any two airports (e.g., JFK to LAX), and it generates music based on:
- Direction - Pitch range (eastward = higher notes)
- Distance - Tempo (longer flights = slower)
- Route complexity - Harmony (multi-stop = complex chords)
- Path segments - Chord progression length
The system uses Dijkstra's algorithm to find optimal routes through 67,000+ flight paths, then converts the journey into music.
The cool features
AI Genre Composer
Trained PyTorch LSTM models to generate music in 8 genres (Classical, Jazz, Electronic, Lofi, etc.). The AI recommends genres based on your route characteristics.
VR Experiences
Watch your flight in 3D with Three.js and synchronized spatial audio. Export to Oculus, Unity, WebXR, or ARKit.
Smart Recommendations
Uses vector embeddings (7 types: 96D for routes, 128D for AI compositions) stored in DuckDB. Finds similar routes using cosine similarity - like Spotify's recommendation engine, but for flights.
Travel Logs
Turn your entire vacation into a musical story. Add multiple waypoints and generate a composition for your whole journey.
Tech Stack
Frontend:
- React 18 + TypeScript + Three.js
- Tailwind CSS + shadcn/ui
- Vite
Backend:
- Python FastAPI (async)
- PyTorch (LSTM neural networks)
- NetworkX (Dijkstra's pathfinding)
- Mido (MIDI generation)
Data and ML:
- MariaDB (primary database)
- Redis Cloud (caching - sub-100ms responses)
- DuckDB (analytics + vector embeddings)
- FAISS (similarity search)
- Python ETL pipeline (loads OpenFlights data)
Data:
- 3,000+ airports
- 67,000+ routes from OpenFlights
Key Technical Highlights
1. Graph Pathfinding
Uses NetworkX with Dijkstra's algorithm on a graph of 3,000 nodes (airports) and 67,000 edges (routes). Automatically finds multi-stop routes if no direct flight exists.
2. Music Generation
# Direction affects pitch
direction_factor = (bearing_angle / 360)
base_pitch = 60 + (direction_factor * 24)
# Distance affects tempo
distance_factor = min(distance_km / 10000, 1.0)
adjusted_tempo = tempo * (1 - distance_factor * 0.3)
# Complexity affects harmony
complexity = (segments * 0.1) + (distance / 10000 * 0.05)
3. Vector Embeddings
7 embedding types for different features:
- Home Routes (96D)
- AI Composer (128D)
- VR Experiences (80D)
- Travel Logs (32D)
- Wellness (48D)
- Education (64D)
Enables similarity search and recommendations across all compositions.
4. Performance Optimization
- Redis caching reduced response time from 800ms to sub-100ms
- Async FastAPI for concurrent requests
- WebSocket + Redis Pub/Sub for real-time collaboration
Why I Built This
I wanted to make geography education more engaging through data sonification - turning abstract data into sensory experiences. Maps show where places are, but music helps you feel the journey.
Also, musicians can use this as a creative tool for generating unique compositions.
Try It Yourself
GitHub: https://github.com/aviralSri23455/Melodic-Airways-Transforming-Flight
Setup (15-20 minutes):
- Install Python 3.9-3.11, Node 16-20, MariaDB
- Create free Redis Cloud account (30MB tier)
- Clone repo, copy .env.example to .env
- Add your credentials
- Run setup script
Works on Windows, Mac, and Linux.
What's Next
- Mobile apps with offline generation
- More AI genres (Hip-Hop, Country, Reggae)
- Live flight tracking integration
- High-res audio exports (WAV/FLAC)
- API access for developers
Open Source
Fully open source under Apache License. Great for:
- Portfolio projects
- Learning full-stack + AI/ML
- Data sonification experiments
Why I'm Sharing This
I built this project to explore data sonification - the idea that we can make abstract data more meaningful by turning it into sound. As a developer interested in AI/ML and creative applications, I wanted to show that machine learning isn't just for business problems - it can create beautiful, educational experiences too.
If you're learning full-stack development, this project covers a lot of ground: React, Python, PyTorch, graph algorithms, vector embeddings, and real-time features. It's also fully open source, so you can learn from the code or use it as a portfolio project.
Questions for You
I'd love to hear your thoughts:
- What flight route would you want to hear as music? (JFK to Tokyo? London to Sydney?)
- What other datasets could be sonified? (Weather patterns? Stock markets? Sports data?)
- Have you built any creative AI projects? Share your experiences!
- Any questions about the implementation? Happy to explain the tech in more detail.
Drop your questions and ideas in the comments - I'll respond to everyone!
GitHub: Melodic Airways
Every flight tells a story. We just help you hear it.



Top comments (0)