Convert Figma logo to code with AI

clangen logomusikcube

a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++

4,147
294
4,147
138

Top Related Projects

DeaDBeeF Player

2,048

Featureful ncurses based MPD client inspired by ncmpc

5,486

Small, fast and powerful console music player for Unix-like operating systems.

2,149

Music Player Daemon

Tomahawk, the multi-source music player

Quick Overview

musikcube is a cross-platform, terminal-based music player, audio engine, metadata indexer, and server. It's designed to be fast, lightweight, and highly customizable, offering a unique command-line interface for music playback and management.

Pros

  • Cross-platform compatibility (Windows, macOS, Linux)
  • Lightweight and efficient, suitable for low-resource systems
  • Extensive plugin system for customization and extensibility
  • Supports remote playback and control via web interface

Cons

  • Terminal-based interface may not appeal to users accustomed to graphical music players
  • Limited visualization options compared to some graphical alternatives
  • Steeper learning curve for users unfamiliar with command-line interfaces
  • Requires manual compilation on some platforms

Getting Started

To get started with musikcube:

  1. Clone the repository:

    git clone https://github.com/clangen/musikcube.git
    
  2. Build the project (example for Linux):

    cd musikcube
    cmake -G "Unix Makefiles" .
    make
    
  3. Run musikcube:

    ./musikcube
    
  4. Use keyboard shortcuts to navigate and control playback:

    • Arrow keys: Navigate
    • Enter: Select/play
    • Space: Pause/resume
    • q: Quit

For more detailed instructions and platform-specific guides, refer to the project's README and documentation.

Competitor Comparisons

DeaDBeeF Player

Pros of DeaDBeeF

  • More extensive plugin system with a larger variety of available plugins
  • Better support for a wider range of audio formats, including exotic and legacy formats
  • More customizable user interface with themes and layouts

Cons of DeaDBeeF

  • Less modern and polished user interface compared to musikcube
  • Slower development cycle and less frequent updates
  • Limited cross-platform support (primarily focused on Linux)

Code Comparison

Both projects are written in C/C++, but they have different approaches to their architecture. Here's a brief comparison of how they handle plugin loading:

DeaDBeeF:

void pluginloader_load_all(void) {
    char plugin_path[PATH_MAX];
    snprintf(plugin_path, sizeof(plugin_path), "%s/plugins", dbconfdir);
    load_plugins_from_dir(plugin_path);
}

musikcube:

void PluginFactory::LoadPlugins() {
    fs::path pluginPath = GetPluginDirectory();
    for (const auto& entry : fs::directory_iterator(pluginPath)) {
        LoadPlugin(entry.path());
    }
}

Both projects use a similar approach to loading plugins from a directory, but musikcube uses more modern C++ features and the filesystem library.

2,048

Featureful ncurses based MPD client inspired by ncmpc

Pros of ncmpcpp

  • More mature and established project with a larger user base
  • Highly customizable with extensive configuration options
  • Supports various music formats and playlist management features

Cons of ncmpcpp

  • Steeper learning curve due to its text-based interface
  • Limited to MPD (Music Player Daemon) as the backend
  • May require additional setup and configuration for optimal use

Code Comparison

ncmpcpp

void Screen::update()
{
    if (m_window)
    {
        wresize(m_window, m_height, m_width);
        mvwin(m_window, m_start_y, m_start_x);
    }
}

musikcube

void Window::Resize(int width, int height) {
    this->width = width;
    this->height = height;
    this->OnResized(width, height);
}

Both projects use C++ for their core functionality. ncmpcpp focuses on a text-based interface using ncurses, while musikcube provides a more modern, cross-platform GUI experience. ncmpcpp is specifically designed for use with MPD, whereas musikcube is a standalone music player with its own audio engine.

ncmpcpp offers more advanced features for power users and music enthusiasts, while musikcube aims for a more user-friendly experience with a graphical interface. The choice between the two depends on personal preferences, desired features, and the user's comfort level with terminal-based applications.

5,486

Small, fast and powerful console music player for Unix-like operating systems.

Pros of cmus

  • Lightweight and efficient, consuming minimal system resources
  • Highly customizable with extensive keybindings and color schemes
  • Supports a wide range of audio formats out of the box

Cons of cmus

  • Text-based interface may be less intuitive for some users
  • Limited visualization options compared to graphical music players
  • Lacks built-in network streaming capabilities

Code Comparison

cmus (C):

static int cmus_play_file(const char *filename)
{
    struct track_info *ti;

    ti = cmus_get_track_info(filename);
    if (!ti)
        return -1;
    player_set_file(ti);
    track_info_unref(ti);
    return 0;
}

musikcube (C++):

void Player::Play(const std::string& uri) {
    this->Stop();
    this->SetPosition(0);
    this->playback->Play(uri);
    this->state = PlayerState::Playing;
}

Both projects implement play functionality, but musikcube's approach is more object-oriented and uses modern C++ features. cmus focuses on efficiency with its C implementation, while musikcube prioritizes readability and maintainability with its C++ code.

2,149

Music Player Daemon

Pros of MPD

  • More mature and widely adopted project with extensive documentation
  • Supports a broader range of audio formats and protocols
  • Highly flexible client-server architecture allowing for various front-ends

Cons of MPD

  • Requires separate client software for user interaction
  • Setup and configuration can be more complex for beginners
  • Less focus on modern UI/UX compared to musikcube

Code Comparison

MPD (C++):

bool
playlist::AddSongToPlaylist(const char *playlist_name, const Song &song)
{
    const auto uri = song.GetURI();
    return AddURIToPlaylist(playlist_name, uri.c_str());
}

musikcube (C++):

bool
PlaybackService::Next() {
    return this->transport->Next();
}

Both projects use C++, but MPD's codebase is generally more complex due to its client-server architecture. musikcube's code tends to be more straightforward, reflecting its all-in-one design.

MPD offers greater flexibility and extensibility, while musikcube provides a more integrated and user-friendly experience out of the box. The choice between them depends on specific needs and preferences for audio playback management.

Tomahawk, the multi-source music player

Pros of Tomahawk

  • More comprehensive music discovery features, including integration with multiple streaming services
  • Advanced social features allowing users to share and discover music with friends
  • Cross-platform support for desktop and mobile devices

Cons of Tomahawk

  • Less actively maintained, with fewer recent updates
  • More complex setup and configuration process
  • Heavier resource usage due to its extensive feature set

Code Comparison

Tomahawk (C++):

void AudioEngine::setVolume( float volume )
{
    m_volume = volume;
    if ( m_audioOutput )
        m_audioOutput->setVolume( volume );
}

Musikcube (C++):

void Player::SetVolume(double volume) {
    this->volume = volume;
    this->output->SetVolume(volume);
}

Both projects use C++ for their core functionality. Tomahawk's codebase is more extensive due to its broader feature set, while Musikcube's code is generally more focused and streamlined. Musikcube's development is more active, with regular updates and improvements. Tomahawk offers a wider range of music sources and social features, but Musikcube provides a more lightweight and efficient music player experience with a clean, modern interface.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

musikcube

a cross-platform, terminal-based audio engine, library, player and server written in c++.

musikcube compiles and runs easily on windows, macos and linux. it also runs well on a raspberry pi with raspbian, and can be setup as a streaming audio server.

check out the installation guide to get up and running.

be sure to also read through a the user guide, which describes app's navigation paradigm and lists all the default keyboard shortcuts.

if you want to build it from source, the instructions are here.

screenshots

it looks something like this on windows:

windows screenshot

and this on macos:

osx screenshot

and on linux:

linux screenshot

here's a demo (made with asciinema):

asciicast

while the main musikcube app runs in the console, you can also stream audio from (and even remote control) musikcube using the musikdroid android app, which can be downloaded in the releases section above. it looks like this:

android screenshot

installation

binaries are available in the releases page.

while macos binaries are provided, you can also install via homebrew as follows:

  • brew install musikcube

on freebsd musikcube can be installed as follows:

  • pkg install musikcube

on openbsd musikcube can be installed as follows:

  • pkg_add install musikcube

on windows, you can install via chocolatey:

  • choco install musikcube

then run using shell, Win+R dialog or by typing in Start Menu musikcube or mcube.

raspberry pi

musikcube runs well on a raspberry pi, connected to your home stereo. see here for detailed setup instructions.

compiling

if you'd like to compile the project yourself, you can check out the build instructions.

keyboard shortcuts

a list of all keyboard shortcuts can be found in the user guide

streaming server

musikcube ships with a streaming audio server enabled by default. it runs a websocket server on port 7905, used for metadata retrieval. an http server runs on port 7906, and is used to serve (optionally transcoded) audio data to clients.

it's important to understand that, out of the box, the server (and remote api) should NOT be considered safe for use outside of a local network. the websockets service only supports a simple password challenge, and the audio http server just handles Basic authorization. it does not provide ssl or tls. the server also stores the password in plain text in a settings file on the local machine.

you can fix some of this using a reverse proxy to provide ssl termination. details in the ssl-server-setup section. while this improves things, you should exercise caution exposing these services over the internet.

if you're interested in writing your own frontend, api documentation is available here.

sdk

the musikcube sdk is a set of small, pure-virtual c++ classes and a handful of enums and constants. they're still in the process of being slimmed down. you can see what they currently look like here: https://github.com/clangen/musikcube/tree/master/src/musikcore/sdk

dependencies

musikcube would not be possible without the following excellent free, open source, and (in the case of some macos and win32 APIs) non-free projects and libraries:

coredecodersoutputsmetadatanetworkingmiscellaneousui
sqliteffmpegalsataglibwebsocketpprxjavancurses
utfcpplibopenmptpulseaudioglidelibmicrohttpdrxandroidpdcurses (win32a variant)
nlohmann jsonlibgmecore audiolibcurlstethorecycler-fast-scroll
kissfftexoplayerwasapiopensslfabric
sigslotdirectsoundnv-websocket-clientAndroidVideoCache
wcwidth.cwaveoutokhttp
pipewire

license

Copyright (c) 2004-2023 musikcube team

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

 * Neither the name of the author nor the names of other contributors may
   be used to endorse or promote products derived from this software
   without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.