How fabricelacharme/karaboss works
Project type and purpose
• Karaboss is a Windows desktop application written in C#/.NET (WinForms).
• It serves as a MIDI karaoke player and a lightweight MIDI file editor/sequencer.
• It integrates several components: UI for playback and editing, an audio/MIDI engine, lyrics retrieval, playlist management, and an auto-updater.
File structure
• Top-level solution (Karaboss.sln) contains multiple .csproj projects.
• The Karaboss folder is the main executable. Inside Karaboss/ you find:
• Audio (AudioManager)
• Buttons, Dialogs, Display, Pages, Controls (UI)
• Chords, GuitarTraining, PianoRoll (musical features)
• Lrc, MP3, MP3GPlayer, Midi, KaraokeEffect (format support & effects)
• Utilities, Configuration (core services)
• Other folders are reusable class libraries or APIs (e.g., AzLyrics.Api, CDGNet, Hqub.MusicBrainz.API, Sanford.Multimedia.Midi, various custom UI controls).
• AutoUpdater is a separate executable/project for self-updating.
• Configuration files (app.config), resources (.resx), and third-party binaries (lame.exe) are also present.
README for additional insights
• Karaboss relies on the Sanford Multimedia MIDI toolkit for MIDI I/O and on Midi Sheet Music for score rendering.
• It supports lyrics display and editing, playlist management, background customization, and basic sequencing (score editing).
Main components and interactions
a. Presentation Layer (UI – WinForms)
• Player windows (frmExplorer, frmMp3Player, frmCDGPlayer, frmPianoRoll, etc.)
• Editor windows (frmChords, frmLrcGenerator, frmNoteEdit)
• Configuration dialogs, custom controls (buttons, sliders, sidebars)
b. Core Services (Business Logic)
• AudioManager: playback control, mixing
• Sequencer/Editor: score parsing, note insertion/deletion
• LyricsManager: LrcManager, web-API clients (AzLyrics, LyricsWikia, SongLyrics)
• PlaylistManager: load/save playlists, MRU
• File I/O: MIDI, MP3, CDG decoding (CDGNet), TagLibSharp for metadata
• Utilities: file helpers, serialization, settings
c. External Libraries
• Sanford.Multimedia.Midi: MIDI read/write, event dispatch
• Midi Sheet Music (embedded or interop)
• Hqub.MusicBrainz.API: metadata lookup
• Third-party binaries: lame.exe, mencoder.exe
d. Infrastructure
• Local filesystem: song files, settings, playlists
• App configuration (app.config, settings.settings)
• AutoUpdater service: checks remote version, downloads patches
Architectural patterns and design principles
• Layered architecture: Presentation → Core → External Services → Infrastructure
• Separation of concerns: UI code in forms and controls, business logic in manager classes, web access in API clients
• Plugin-style extensibility: many small class libraries for different concerns (controls, APIs)
• Event-driven playback and editing via the Sanford MIDI event system
Elements
• Presentation (blue)
• Core Services (green)
• External Libraries (orange)
• Infrastructure (gray)
• Clear labels: project names (.exe or .dll), major classes (AudioManager, LrcManager, Sequencer).
Detail without over-splitting
• Major modules and their interactions, but group similar controls or APIs into cohesive blocks.
• Special flows where web APIs fetch lyrics or where CDGNet decodes graphic data.