LXR Music - Most Advanced Music System for REDM

LXR Music — Product Overview

What it is

LXR Music is a RedM (RDR2) busker / performance system. Players use inventory items or world props to “perform” while streaming music from URLs through xSound as 3D spatial audio nearby players can hear. It is not a MIDI keyboard or baked RDR2 instrument audio system for URL instruments — xSound is the only audio source for streamed links; animations and props are visual only.

Platform: RedM · Dependency: xsound (required) · Config: almost everything in config.lua (client/server are escrow-protected) · Frameworks: LXR-Core, RSG-Core, VORP, or standalone (auto-detect).


What players can do

1. Hand-held instruments (inventory items)

Use from inventory: guitar, banjo, trumpet, harmonica, fiddle.

  • Play mode picker (if playMode = 'choose'): Sit, Stand, or Walk

    • Global toggles: Config.PlayModes (sit / stand / walk true/false)

    • Per-instrument override: e.g. playModes = { sit = false, stand = true, walk = true }

    • One enabled mode → skips picker and starts directly

  • Prop attaches to ped bone with mode-specific offsets (propAttach.sit|stand|walk)

  • Male/female animations (idle + active/strumming while URL plays) youtube/suno/discord/soundcloud

  • Stream URL (R) → NUI modal → paste link → music plays for everyone in range

  • Session HUD (NUI, UTF-8): mode cycle (G), play/stop (R), volume (↑↓), loop (L), leave (Backspace)

  • Sync: other players see your prop and hear 3D audio at your position (or phonograph anchor)

2. Phonograph (placed prop)

Inventory item → placement wizard (ground/surface snap, rotate, confirm) → persistent world prop saved to data/placed_props.json.

  • Survives restarts until destroyed (gun/melee configurable)

  • Interact at prop to start a session; audio anchors to the phonograph, not the player

  • Item consumed on place (configurable); owner pickup optional

  • Admin /create phonograph [1-5] for step-by-step placement

3. World instruments (no item)

Piano and harp — scan map props, prompt (Space), sit at seat offset, stream URL.

  • Custom world instruments can be added via admin Prop Creatordata/custom_world_instruments.json

Audio & streaming

Capability Behavior
Engine xSound only (PlayUrl / PlayUrlPos)
Local playback Performer usually hears 2D full volume; YouTube forced 2D
3D for others Volume falloff by distance (MaxDistance, rolloff)
Volume / loop Client + server sync; HUD shows state
Providers Per-service toggles: YouTube, SoundCloud, Discord CDN, Suno (+ share-link resolver), Google Drive, Dropbox, direct .mp3/etc.
Suno Direct CDN MP3 or share URL → server resolves to MP3 before xSound
YouTube URL normalization, long playback timeout, retries
Security Domain allowlists, max URL length, block data: URIs, admin URL blocklist

UI / NUI

Surface Purpose
Mode modal Sit / Stand / Walk (only enabled modes shown)
URL modal Paste stream link, confirm/cancel
Session HUD Balloon keybind panel (required for de/ka UTF-8)
Placement HUD Phonograph placement steps
World interact guide Piano/harp proximity prompt
Tip modal Preset tip amounts to nearby musician
Admin panel Live sessions, block URL, prop creator

Theme tokens in Config.NUI; all user-facing strings from locales (en, de, ka).


Framework & inventory

Framework Support
Auto LXR-Core → RSG-Core → VORP → standalone
VORP vorp_inventory v2 API, usable items, close inventory on use, fail-closed item checks
VORP SQL Auto-insert items rows on start (AutoEnsureItemsOnStart + oxmysql) or manual sql/vorp_items.sql
RSG / LXR CreateUseableItem, money for tips
Item aliases e.g. gramophonephonograph
Standalone Commands per item name for testing

Admin system

Command: /lxr-music (aliases: lxrmusic, musicadmin)

Access: ACE lxr-music.admin, optional license/Discord/citizenid lists, framework admin groups.

In-game NUI panel (/lxr-music menu)

Tab Functions
LIVE List active musicians; refresh; Stop all; stop individual session
BLOCK URL Block URL fragment permanently; list blocked URLs; unblock
PROP CREATOR Inspect targeted prop; register custom world instrument (ID, label, model, distance); list saved entries

Console / chat subcommands

list, stop [id|citizenid], stopall, blockurl, unblockurl, blockedurls, /create [alias] [step], destroy nearest placed prop (when enabled).

Admin bypasses (config): rate limits, concurrent cap, URL whitelist.


Config surface (what server owners tune)

Everything meaningful lives in config.lua:

Section Controls
Config.Brand Notify title, Discord username
Config.Framework / FrameworkSettings Framework choice, VORP inventory API, auto-SQL
Config.Lang Locale file
Config.Animations No scenario for URL streaming, active anim while playing, sit prop delay
Config.PlayModes Global sit/stand/walk enable
Config.Instruments Per instrument: enabled, prop model, play modes, bone/offset/rotation, anims, stream flag, consume rules
Config.ItemAliases Extra DB item names
Config.Controls / Keys Keybind hashes and HUD labels
Config.Performance Idle poll intervals, resmon tuning (~0.00ms idle goal)
Config.WorldInteraction Piano/harp scan, prompt, interact key
Config.PlacedProps Persistence file, placement, destroy rules, /create steps
Config.StreamProviders Enable/disable each URL source + Suno resolver
Config.Audio Volume, distance, YouTube behavior, legacy domain list
Config.HUD NUI position, brand, volume bar
Config.NUI Modal theme colors
Config.Session Cooldown, max duration, movement rules, damage behavior
Config.Tips Player tips, NPC ambient flavor, static tip jars
Config.Admin Permissions, feature flags, model aliases
Config.ForensicLog Discord/file/console audit, event categories
Config.Webhook Legacy start/stop Discord embeds
Config.Security Rate limits, URL validation, concurrent cap, blocked URLs
Config.Debug Verbose client/server logging

Prop attach tuning: bone, offset {x,y,z}, rotation {x,y,z} per mode under propAttach — tune with attach tools, paste into config.


Security & anti-abuse

  • Server validates URLs against enabled providers / extensions

  • Rate limiting on item use and music start

  • Session must exist before startMusic is accepted

  • propActivated validates placed prop IDs, concurrent musicians, rate limits

  • Permanent + runtime URL blocklist (data/blocked_urls.json)

  • Admin-only bypass flags (optional)

  • Resource name guard (lxr-music only — rename breaks license check)


Forensic audit logging

Bank-statement style trail: who, what, when, where, how, why.

  • Events: music start/stop, sessions, item use, prop place/destroy, URL resolve, security blocks, admin actions, tips, system boot

  • Outputs: daily JSONL in data/audit/, optional Discord webhooks per category, console (compact), external event lxr-music:forensicLog

  • Exports: ForensicLog, ForensicPlayerContext


Tips (optional, off by default)

  • Player tips: nearby listeners tip cash via NUI presets (framework money)

  • NPC ambient: random flavor messages (optional fake money)

  • Static tip jars: world locations with preset amounts

  • Custom money handler export supported


Data persistence

File Contents
data/placed_props.json Persistent phonographs
data/blocked_urls.json Admin-blocked URL fragments
data/custom_world_instruments.json Admin-created world instruments
data/audit/*.jsonl Forensic logs

Server exports & events (integration)

Other resources can listen for forensic events or use exports for logging. Tips support a custom handler export when enabled.


Technical summary

Item Detail
Version line fxmanifest.lua (currently 3.1.0; changelog has 3.2.0 notes)
Escrow config.lua, locales, shared bridge, SQL, data JSON, docs ignored
Languages English, German, Georgian (UTF-8 NUI)
Idle performance Adaptive polling; no heavy loops when nobody is performing
Remote sync Attached props on other musicians; audio at prop anchor for phonographs

**
One-line pitch**

LXR Music turns RedM into a live busking layer: inventory instruments, persistent phonographs, world pianos/harps, URL streaming with 3D audio, full admin moderation, VORP-ready items, and a single config file for server owners to shape the experience.

Links