Moodbar Provider

Overview

A moodbar is a color representation of an audio file, where the red represents the low frequencies, green the mids and blue the high ones.

Per audio file 1000 RGB Triples are sampled.

Sometimes individual instruments can be recognized by their color, the combination of E-Guitar and Drums are often found to be turquoise.

Since the moodbar does not really represent the mood information it should be rather called freqbar. But it was decided to stay with the authors naming choice.

You can find more information here:

For this provider to work properly you need the moodbar utility installed:

There are 3 different providers in this module:

Usage Example:

>>> from munin.provider import MoodbarAudioFileProvider
>>> p = MoodbarAudioFileProvider()
>>> p.do_process('/tmp/some_file.mp3')
MoodbarDescription<{
    'red': {
        'histogram': [302, 12, 58, 177, 441, 10]
        'diffsum':   44
    },
    'green': {
        'histogram': [220, 72, 32, 203, 462, 11]
        'diffsum':   33
    },
    'blue': {
        'histogram': [303, 24, 130, 290, 239, 14]
        'diffsum':   32
    },
    'average_minimum': 126,
    'average_maximum': 161,
    'dominant_colors': [
        (187, 238, 238),
        (  0,  34,   0),
        (204, 204, 170),
        (204, 238, 221),
        (  0,  51,   0),
        (204, 221, 187),
        (  0,  34,  17),
        (204, 238, 238),
        (221, 204, 170),
        (  0,  51,  17)
    ]
}>

Reference

class munin.provider.moodbar.MoodbarProvider(compress=False)[source]

Basic Moodbar Provider.

Takes a vector of RGB Tuples.

Create a new Provider with the following attributes:

Parameters:compress – Deduplicate data?
do_process(vector)[source]

Subclassed from Provider, will be called for you on the input.

class munin.provider.moodbar.MoodbarMoodFileProvider(compress=False)[source]

Moodbar Provider for pre computed mood files.

Takes a path to a mood file.

Create a new Provider with the following attributes:

Parameters:compress – Deduplicate data?
class munin.provider.moodbar.MoodbarAudioFileProvider(compress=False)[source]

Moodbar Provider for audio files.

Takes a path to an arbitary audio file. Will look for audio_file_path + ‘.mood’ before computing it. Resulting mood file will be stored in the same path.

Create a new Provider with the following attributes:

Parameters:compress – Deduplicate data?

Table Of Contents

Related Topics

This Page

Useful links:

Package:

Github: