Skip to content

OnekO/moodbarr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moodbarr

A Rust implementation of moodbar
(Yes. I’m a genius at naming things, I know. Moodbar r. Moodbar rust. Genius)

From exaile's moodbar repo:

Moodbar is a music visualization method that assigns colors to different parts of a track and presents them as a timeline. Applied to a music player, the main goal is to help the user navigate within a particular track. For example, if the user wants to skip to the first chorus of a song, a good moodbar implementation should be able to provide a hint of where this might occur in the timeline.

The particular moodbar implementation in this repository is based on the Bandwise Spectral Magnitude method presented in On Techniques for Content-Based Visual Annotation to Aid Intra-Track Music Navigation (Gavin Wood & Simon O'Keefe, 2005). It divides the track into small chunks and assigns a color to each chunk: the red channel represents audio levels in the low frequencies, green for mid frequencies, and blue for high frequencies.

The code is mostly taken from Clementine, with the addition of a command-line interface that is a drop-in alternative to the original Moodbar program. Clementine's moodbar implementation used to be based on the original project's, but they have since diverged greatly. Both implement the same idea and the outputs should be roughly similar.

History

I'll be brief, since nobody is probably going to read this: many years ago, I fell in love with Amarok, the most wonderful music player in history. Visualizers, artist info fetched from the internet (well, that’s not so impressive nowadays, but back then it was amazing), ratings, lyrics... 30 years ahead from other players.

One of my favorite features was the moodbar: a graphical representation of a song, really handy when you want to skip to your favorite part of a track. After a couple of decades, I still love Amarok, even though I now use other systems to enjoy music (smartphones, smart speakers, car audio...)

Deluan, the genius behind Navidrome, has added support for plugins, so I figured I have no excuse not to add my custom moodbar implementation.

This is the main purpose of this repo, but of course, you’re free to use it however you like. OSS is lovely, isn't it?

Installation

Download a version for your OS from Releases. After that, run it from your favorite console. It should work… at least it does on my computer.
I’ve never tested it on macOS, since I don’t have one, so if you can help me with that, you’d be very welcome.

Usage

moodbar save -o OUTPUT INPUT
moodbar -o OUTPUT INPUT       # save is the default action, because compatibility

Use show to inspect the colors in-place:

moodbar show INPUT  # INPUT can be a mood file, or an audio file

Building

cargo build --release
cargo run --release --bin moodbar -- save -o OUTPUT INPUT
cargo run --release --bin moodbar -- show INPUT

No external dependencies, I have developed this to avoid dependencies with GStreamer as other versions. Cargo should be enough.

Testing

You can run cargo test to run some tests.

Contributing

When you contribute to a file in this project, you agree to release your contribution under the same license specified in the file’s license header. If there is no license header in the file, or if it’s a new file, you agree to release your contribution under the GNU General Public License version 3 or later (GPL-3.0+), or you may choose another license that is compatible with GPL-3.0+.

Please use cargo fmt whenever possible. And be polite. If you’ve built a successful OS and the industry-standard version control system, you can say whatever you want. Otherwise, try to keep it civil. Netiquette, you know?

AI is welcome, if you know what are you doing.

About

A rust implementation of moodbar

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors