Bläddra i källkod

Update README: add Chad Music setup, API key instructions, current features

aldiss 3 månader sedan
förälder
incheckning
86e3a0a2f2
1 ändrade filer med 95 tillägg och 95 borttagningar
  1. 95 95
      README.md

+ 95 - 95
README.md

@@ -1,52 +1,51 @@
 # MixBoard
 
-A native macOS music player and mix preparation tool built with Swift and SwiftUI. Import your music library, analyze tracks for BPM and musical key, build playlists with crossfades, and export directly to your DAW.
+A native macOS music player built with Swift 5.9 and SwiftUI, targeting macOS 14+ (Sonoma). Play local files, stream from a [Chad Music](https://gogs.chad-partners.com/chad-partners/chad-music) cloud server, analyze BPM and key, build playlists, and export to your DAW.
 
 ## Features
 
-### 🎵 Music Library
-- Import audio files (MP3, WAV, FLAC, AAC, AIFF, M4A, OGG, and more)
-- Scan entire directories recursively
+### Music Library
+- Import audio files (MP3, WAV, FLAC, AAC, AIFF, M4A, OGG Vorbis, and more)
+- Scan directories recursively
 - Search and filter by title, artist, album, genre, BPM, or key
 - Sort by any column
-- Rate and tag tracks
+- Playlist folders for organization
 
-### 📊 Audio Analysis
-- **BPM Detection** — Energy-based onset detection with autocorrelation (powered by Accelerate framework)
+### Cloud Streaming (Chad Music)
+- Browse your cloud library by artist, album, genre, year, publisher, country
+- Stream tracks directly — no download required
+- Album artwork from the server
+- Drag albums or tracks into local playlists
+- Lyrics fetching via [LRCLIB](https://lrclib.net)
+
+### Audio Analysis
+- **BPM Detection** — Energy-based onset detection with autocorrelation (Accelerate framework)
 - **Musical Key Detection** — Chromagram analysis with Krumhansl-Kessler key profiles, Camelot wheel codes
-- **Waveform Generation** — High-resolution waveform display with efficient downsampling
+- **Waveform Visualization** — High-resolution waveform display with efficient downsampling
 
-### 🎚️ Playback
-- High-quality playback via AVAudioEngine
+### Playback
+- AVAudioEngine for local files, AVPlayer for cloud streaming
 - Interactive waveform with seek
 - 3-band EQ (Low / Mid / High)
-- Volume control
+- Volume control, media key support
+- 14 retro skins
 
-### 📋 Playlist & Mix Building
-- Create playlists for your mixes
+### Playlist & Mix Building
+- Create playlists and organize in folders
 - Drag and reorder tracks
-- Set crossfade durations between tracks
-- Per-track gain adjustment
-- Start/end offset trimming
-- Add cue points and markers (Intro, Outro, Drop, Breakdown, Verse, Chorus, etc.)
+- Crossfade durations between tracks
+- Per-track gain adjustment, start/end trimming
+- Cue points and markers (Intro, Outro, Drop, Breakdown, Verse, Chorus, etc.)
 
-### 🔄 DAW Export
-Export your prepared mix to any DAW with multiple format options:
+### DAW Export
 
 | Format | Extension | Compatible With |
 |--------|-----------|----------------|
-| **Adobe Audition Session** | `.sesx` | Adobe Audition |
-| **DAWproject** | `.dawproject` | Bitwig Studio, Studio One, REAPER |
-| **Edit Decision List** | `.edl` | Pro Tools, Audition, DaVinci Resolve |
-| **Cue Sheet** | `.cue` | Audacity, foobar2000, CD burners |
-| **M3U Playlist** | `.m3u` | Any media player |
-
-All export formats include:
-- Track ordering and timing
-- Crossfade/transition information
-- Cue points as markers
-- BPM and key metadata
-- Option to copy audio files alongside the session
+| Adobe Audition Session | `.sesx` | Adobe Audition |
+| DAWproject | `.dawproject` | Bitwig Studio, Studio One, REAPER |
+| Edit Decision List | `.edl` | Pro Tools, Audition, DaVinci Resolve |
+| Cue Sheet | `.cue` | Audacity, foobar2000, CD burners |
+| M3U Playlist | `.m3u` | Any media player |
 
 ## Requirements
 
@@ -56,85 +55,86 @@ All export formats include:
 
 ## Building
 
-### Option 1: Open in Xcode (Recommended)
-```bash
-cd MixBoard
-open Package.swift
-```
-This opens the project in Xcode where you can build and run directly.
+### Option 1: Xcode (Recommended)
 
-### Option 2: Command Line
 ```bash
-cd MixBoard
-swift build
+open MixBoard.xcodeproj
 ```
 
-> **Note:** For a proper macOS app bundle with sandbox capabilities, building through Xcode is recommended.
+Select the **MixBoard** scheme and press ⌘R.
 
-## Project Structure
+### Option 2: xcodegen + Xcode
 
+If you prefer to regenerate the Xcode project from `project.yml`:
+
+```bash
+brew install xcodegen   # if not installed
+xcodegen generate
+open MixBoard.xcodeproj
 ```
-MixBoard/
-├── Package.swift
-├── Sources/
-│   ├── MixBoardApp.swift          # App entry point
-│   ├── Models/
-│   │   ├── Track.swift            # Track model (SwiftData)
-│   │   ├── CuePoint.swift         # Cue points and markers
-│   │   └── Playlist.swift         # Playlist and entries
-│   ├── Services/
-│   │   ├── AudioEngine.swift      # AVAudioEngine playback
-│   │   ├── BPMDetector.swift      # BPM analysis (Accelerate)
-│   │   ├── KeyDetector.swift      # Musical key detection
-│   │   ├── WaveformGenerator.swift # Waveform data generation
-│   │   ├── MetadataService.swift  # Audio metadata reading
-│   │   └── LibraryManager.swift   # Library import & management
-│   ├── Export/
-│   │   ├── DAWExporter.swift      # Export protocol & dispatcher
-│   │   ├── AuditionExporter.swift # Adobe Audition .sesx
-│   │   ├── DAWProjectExporter.swift # Open DAWproject format
-│   │   ├── EDLExporter.swift      # CMX 3600 EDL
-│   │   ├── CueSheetExporter.swift # Standard .cue sheets
-│   │   └── M3UExporter.swift      # M3U playlists
-│   ├── ViewModels/
-│   │   ├── LibraryViewModel.swift
-│   │   ├── PlayerViewModel.swift
-│   │   └── PlaylistViewModel.swift
-│   └── Views/
-│       ├── ContentView.swift      # Main 3-panel layout
-│       ├── SidebarView.swift      # Navigation sidebar
-│       ├── LibraryView.swift      # Track library browser
-│       ├── PlayerView.swift       # Playback controls
-│       ├── WaveformView.swift     # Interactive waveform
-│       ├── PlaylistView.swift     # Mix/playlist editor
-│       ├── TrackRow.swift         # Track list row
-│       └── ExportSheet.swift      # DAW export dialog
+
+### Option 3: Command Line
+
+```bash
+xcodebuild -scheme MixBoard -destination 'platform=macOS' build
 ```
 
-## Workflow
+## Chad Music Setup
+
+MixBoard can connect to a [Chad Music](https://gogs.chad-partners.com/chad-partners/chad-music) server to stream your cloud music library.
+
+### 1. Get your API key
 
-1. **Import** music files or folders into the library
-2. **Analyze** tracks to detect BPM and musical key
-3. **Browse** the library — search, sort, and filter tracks
-4. **Create** a playlist for your mix
-5. **Build** the mix — arrange tracks, set crossfades, adjust gain, add cue points
-6. **Export** to your DAW format of choice
-7. **Open** the exported session in Adobe Audition, Bitwig, REAPER, or any supported DAW
-8. **Refine** the mix in the DAW with full multitrack control
+Chad Music uses Telegram-based authentication. To obtain an API key:
 
-## DAW Integration Details
+1. Open the Chad Music web UI (e.g., `https://music.your-server.com`)
+2. Log in via the Telegram login widget
+3. Once logged in, your session token is your API key — copy it from the browser's developer tools (Application → Cookies or Network tab → `Authorization` header)
 
-### Adobe Audition
-Export as `.sesx` (Audition Session XML). Open directly in Audition — tracks appear on the multitrack timeline with crossfades and markers in place.
+> **Note:** Ask the server admin if they have a simpler way to issue API keys, as the method may vary by deployment.
 
-### DAWproject (Bitwig, Studio One, REAPER)
-The open standard for DAW interchange. Export generates the `project.xml` containing track layout, clip timing, fades, and markers. Audio files are placed in a companion folder.
+### 2. Configure in MixBoard
 
-### Edit Decision List
-Standard CMX 3600 format with SMPTE timecode. Widely supported by professional DAWs including Pro Tools and DaVinci Resolve.
+1. Open MixBoard → **Settings** (⌘,)
+2. Go to the **Chad Music** tab
+3. Enter your **Server URL** (e.g., `https://music.tailnet.ts.net`)
+4. Enter your **API key**
+5. Click **Test Connection** to verify
 
-### Cue Sheet
-Classic `.cue` format with track indices, performer info, and timing. Great for reference and compatible with many audio tools.
+The API key is stored locally via `UserDefaults`. The connection uses Bearer token authentication over HTTPS.
+
+### API Endpoints Used
+
+| Endpoint | Purpose |
+|----------|---------|
+| `GET /api/stats` | Library statistics, connection test |
+| `GET /api/cat/:category` | Browse by artist, album, genre, year, etc. |
+| `GET /api/cat/album` | Full album listing with metadata |
+| `GET /api/album/:id/tracks` | Track list with stream URLs |
+
+## Project Structure
+
+```
+MixBoard/
+├── Package.swift              # SPM package definition
+├── project.yml                # xcodegen project config
+├── Sources/
+│   ├── MixBoardApp.swift      # App entry point
+│   ├── Models/                # SwiftData models
+│   ├── Services/              # Audio engine, BPM/key detection,
+│   │                          # Chad Music API, streaming, lyrics
+│   ├── ViewModels/            # Player and playlist view models
+│   ├── Views/                 # SwiftUI views
+│   ├── Export/                # DAW export formats
+│   └── OGG/                   # OGG Vorbis decoder (C bridge)
+└── Tests/                     # Unit, integration, E2E tests
+```
+
+## Running Tests
+
+```bash
+xcodebuild test -scheme MixBoard -destination 'platform=macOS'
+```
 
 ## License