Skip to content

lovelessmarrige/melodic-lavalink-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

🎡 Melodius Core - Advanced Audio Distribution Engine

Download

"A sonic architecture for the modern web β€” where every byte of audio flows with precision."

Melodius Core is a distributed music playback orchestration system built for Discord communities that demand reliability, speed, and intelligence. Inspired by the foundation of Lavalink and discord.js v14, this repository reimagines audio delivery as a fault-tolerant, multi-source engine with real-time analytics, multilingual voice interfaces, and adaptive streaming quality.

This is not just a music bot base β€” it's a resilient audio grid designed for enterprise-grade community servers, live events, and automated radio stations.


πŸ“¦ Table of Contents


🧠 Why Melodius Core?

Most audio bots break under load, struggle with regional latency, or require manual intervention when a node fails. Melodius Core is designed as a self-healing meshed network of audio processors. Think of it as a swarm of tiny orchestrators β€” each one capable of taking over the other's workload without missing a beat.

Whether you're running a 10,000-member gaming server or a live podcast channel, this system scales horizontally and vertically, adapting to your infrastructure with zero downtime.


πŸš€ Key Features

  • Distributed Audio Architecture β€” Multiple Lavalink nodes managed automatically with failover routing. If one node goes silent, traffic shifts within milliseconds.
  • Adaptive Streaming Quality β€” Dynamically adjusts bitrate based on network conditions, region, and server load. No more audio stutter during raid events.
  • Real-Time Playlist Intelligence β€” Integrates with OpenAI and Claude APIs for natural language song requests. Say "play something upbeat from the 80s" and get instant results.
  • Responsive Command UI β€” Slash commands, modals, and buttons designed for mobile Discord. Works flawlessly on tablets and phones.
  • Multilingual Voice Engine β€” Supports 12 languages natively for both text commands and TTS responses. Perfect for international communities.
  • Zero-Downtime Update System β€” Hot-reload your command modules without restarting the bot. Updates go live instantly.
  • 24/7 Customer Support β€” Embedded health check endpoints and automated recovery scripts. The system phones home if something breaks.
  • Audit Logging & Analytics β€” Every track, every command, every error logged with timestamp and correlation ID. Debugging becomes archaeology.

🧩 System Architecture (Mermaid Diagram)

graph TD
    A[Discord Gateway] --> B[Melodius Core - Dispatcher]
    B --> C{Node Health Check}
    C -->|Healthy| D[Lavalink Node 1 - US East]
    C -->|Healthy| E[Lavalink Node 2 - EU West]
    C -->|Healthy| F[Lavalink Node 3 - Asia Pacific]
    C -->|Degraded| G[Failover Router]
    G --> H[Backup Node Pool]
    D --> I[Audio Stream]
    E --> I
    F --> I
    I --> J[Voice Connection]
    J --> K[Guild Member]
    B --> L[Analytics Engine]
    L --> M[Prometheus + Grafana]
    B --> N[OpenAI / Claude Plugin]
    N --> O[Natural Language Parser]
    O --> P[Playlist Generation]
    P --> D
Loading

This architecture ensures that no single node is a single point of failure. The dispatcher continuously pings each Lavalink instance, rerouting traffic within 200ms of a detected anomaly.


πŸ“‹ Prerequisites & Compatibility

  • Node.js v18+ (recommended v20 LTS)
  • Java 17+ (for Lavalink server instances)
  • Discord.js v14.x
  • Redis 7.x (for session caching and queue persistence)
  • FFmpeg (for audio transcoding fallback)

βš™οΈ Example Profile Configuration

Below is a sample config.js file structure. Customize it to match your deployment environment.

module.exports = {
  token: process.env.DISCORD_TOKEN,
  clientId: '123456789012345678',
  guildId: '987654321098765432',
  
  lavalink: {
    nodes: [
      { host: 'us-east.lavalink.internal', port: 2333, password: 'youshallnotpass', secure: false },
      { host: 'eu-west.lavalink.internal', port: 2333, password: 'youshallnotpass', secure: false },
      { host: 'apac.lavalink.internal', port: 2333, password: 'youshallnotpass', secure: true }
    ],
    autoResume: true,
    reconnectTries: 5,
    reconnectInterval: 3000
  },

  plugins: {
    openai: {
      apiKey: process.env.OPENAI_API_KEY,
      model: 'gpt-4o',
      temperature: 0.7
    },
    claude: {
      apiKey: process.env.CLAUDE_API_KEY,
      model: 'claude-3-opus-20240229',
      maxTokens: 1024
    }
  },

  localization: {
    defaultLang: 'en',
    fallbackLang: 'en',
    supportedLangs: ['en', 'es', 'fr', 'de', 'ja', 'ko', 'pt', 'ru', 'zh', 'it', 'nl', 'pl']
  },

  analytics: {
    enabled: true,
    endpoint: 'http://metrics.internal:9090',
    interval: 10000
  }
};

πŸ–₯️ Example Console Invocation

Once configured, launch Melodius Core with:

node index.js --profile production --log-level verbose --metrics

Example output:

[2026-04-08 14:32:11] 🟒 Melodius Core v3.2.1 initialized
[2026-04-08 14:32:11] πŸ”— Connecting to Discord Gateway...
[2026-04-08 14:32:12] βœ… Gateway ready | Shard 0/3 active
[2026-04-08 14:32:13] 🎡 Lavalink Node us-east: ONLINE (latency 34ms)
[2026-04-08 14:32:13] 🎡 Lavalink Node eu-west: ONLINE (latency 28ms)
[2026-04-08 14:32:14] 🌐 Redis cache: CONNECTED | Keyspace 1247
[2026-04-08 14:32:15] πŸ€– OpenAI plugin: ACTIVE | Model gpt-4o
[2026-04-08 14:32:15] 🧠 Claude plugin: STANDBY | Awaiting fallback trigger
[2026-04-08 14:32:16] πŸ“Š Analytics endpoint: http://metrics.internal:9090

πŸ–₯️ Emoji OS Compatibility Table

Operating System Status Emoji
Windows 11 (x64) βœ… Fully supported πŸͺŸ
macOS Sonoma+ βœ… Fully supported 🍏
Ubuntu 22.04+ LTS βœ… Fully supported 🐧
Debian 12 βœ… Fully supported 🐧
CentOS 9 Stream ⚠️ Requires manual Java install 🐧
Alpine Linux (Docker) βœ… Fully supported (minimal image) 🐳
FreeBSD 14 🟑 Community tested, no official support 🐑
Raspberry Pi OS (ARM64) βœ… Supported (use lightweight nodes) πŸ“
Arch Linux βœ… Supported (rolling release) πŸ‰

πŸ€– OpenAI & Claude API Integration

Melodius Core features a dual-LLM plugin architecture. By default, the system uses OpenAI's GPT-4o for natural language song requests, but falls back to Claude 3 Opus if the primary API is rate-limited or offline.

How It Works

  1. A user types !play create a chill lofi playlist for studying
  2. The input is sent to the OpenAI API for intent parsing
  3. OpenAI returns a structured JSON with tracks, genres, and mood
  4. Melodius Core queues the tracks and begins playback
  5. If OpenAI returns a 429 error, the request is forwarded to Claude API
  6. Claude processes the same input and returns an equivalent playlist

This dual-redundancy ensures that your community never experiences a silent moment due to API outages.

Example API Call (Pseudocode)

User Input: "Play something by artists similar to Daft Punk but with more vocals"
OpenAI Response: {
  "tracks": ["Something About Us - Daft Punk", "Instant Crush - Julian Casablancas"],
  "similarArtists": ["Justice", "Phoenix", "Breakbot"],
  "mood":"upbeat electronic with vocal hooks"
}
Queue Result: βœ… 12 tracks added | Estimated playtime: 48 minutes

🌐 Multilingual Support & Responsive UI

Melodius Core speaks 12 languages natively β€” both in text and in voice. When a user types in German, the bot responds in German. When they request a playlist in Japanese, the TTS engine reads back the queue in Japanese.

Language Detection Flow

  • Command parsing uses detect-language npm package
  • Responses fetch locale strings from Redis cache
  • TTS uses per-language voice models via Lavalink's external audio source support

Responsive UI

All slash commands and button interfaces are built with mobile-first responsive design. Buttons auto-resize for small screens, modals use constrained widths, and dropdowns collapse gracefully. No overflow, no truncation β€” just clean interaction.


πŸ”„ 24/7 Customer Support & Disclaimer

Support Infrastructure

  • Health Endpoints: /health, /ping, /metrics β€” exposed on an internal port
  • Auto-Recovery: If the main process crashes, a systemd watchdog restarts it within 5 seconds
  • Alerting: Webhook notifications to your support channel when node throughput drops below 80%
  • Fallback Mode: If all Lavalink nodes fail, the bot enters standby mode and alerts administrators

Disclaimer

Melodius Core is provided "as is" without warranty of any kind, express or implied. The developers are not responsible for any data loss, service interruption, or community dissatisfaction resulting from the use of this software. Always maintain backups of your configuration and queue state. By deploying this system, you agree to monitor your own infrastructure and assume all operational risks. The use of third-party APIs (OpenAI, Claude) is subject to their respective terms of service and rate limits. This software is intended for educational and community purposes. Do not use in violation of Discord's Terms of Service or applicable law.


πŸ” SEO-Friendly Keyword Integration

This repository is optimized for discoverability around the following search terms:

  • Discord audio distribution system
  • Lavalink music bot alternative
  • Multi-node audio failover engine
  • Real-time playlist generation with AI
  • Multilingual Discord voice bot
  • Enterprise-grade music bot framework
  • 2026 Discord bot without downtime
  • OpenAI playlist creator Discord
  • Claude API integration for bots
  • Scalable music bot architecture
  • Zero-downtime audio streaming bot

These keywords appear naturally throughout the documentation, ensuring that developers searching for robust audio solutions can find Melodius Core quickly.


πŸ“œ License

This project is licensed under the MIT License. You are free to use, modify, and distribute this software, provided that the original copyright notice and permission notice are included in all copies or substantial portions of the software.

License: MIT


⬇️ Download & Get Started

Download

Ready to build your own resilient audio grid? Download Melodius Core today and transform your Discord server into a professional-grade music platform. No more dead air, no more manual restarts β€” just pure, uninterrupted sound.


Melodius Core β€” where silence becomes the exception, not the rule. 🎧