<commit_before># Pablo

(work in progress)

It doesn't seem like the new Avalanches album is coming out any time soon, but with _Pablo_ (so named for [_Pablo's Cruise_](https://www.youtube.com/watch?v=7Ry8M8M-ICg)) you can automatically generate [plunderphonic](https://en.wikipedia.org/wiki/Plunderphonics) song sketches (music collages/sample mixes) to fill that void.

Pablo will analyze a directory of audio files (mp3, wav, aif) and randomly select a song to build a mix around. It will then pick out other appropriate songs from that directory - tempo-stretching and pitch-shifting them as needed - to slice into samples, which Pablo then assembles into a multi-track mix.

The quality of the output depends a lot on your own taste in curating the library Pablo samples from. If you have a directory of songs that seem like they'll fit together, Pablo will do pretty well. If you have a bunch of random tracks, you might get something nice too.

These mix sketches are meant for high-scale automated ideation and _not_ a substitute for human editing ;)


## Setup

You can install via pip:

    $ pip install pablo

Or install the latest version:

    # Clone the git repo, then from inside the repo:
    $ pip install .

Pablo relies on some other libraries for the heavy lifting, so install those (`pip` does not install them for you):

    $ brew install sox ffmpeg

And you'll also need [Essentia](http://essentia.upf.edu/documentation/installing.html). [Installation instructions are here](http://essentia.upf.edu/documentation/installing.html).


## Usage

You can have Pablo analyze your library in one go, so that mix generation runs quicker. Pablo will persist song analyses based on file hashes so no redundant processing is necessary.
<commit_msg>added example track<commit_after># Pablo

(work in progress)

It doesn't seem like the new Avalanches album is coming out any time soon, but with _Pablo_ (so named for [_Pablo's Cruise_](https://www.youtube.com/watch?v=7Ry8M8M-ICg)) you can automatically generate [plunderphonic](https://en.wikipedia.org/wiki/Plunderphonics) song sketches (music collages/sample mixes) to fill that void.

Pablo will analyze a directory of audio files (mp3, wav, aif) and randomly select a song to build a mix around. It will then pick out other appropriate songs from that directory - tempo-stretching and pitch-shifting them as needed - to slice into samples, which Pablo then assembles into a multi-track mix.

The quality of the output depends a lot on your own taste in curating the library Pablo samples from. If you have a directory of songs that seem like they'll fit together, Pablo will do pretty well. If you have a bunch of random tracks, you might get something nice too.

These mix sketches are meant for high-scale automated ideation and _not_ a substitute for human editing ;)

[An example track can be listened to here](https://soundcloud.com/numpy/pablo-mix-iii)

## Setup

You can install via pip:

    $ pip install pablo

Or install the latest version:

    # Clone the git repo, then from inside the repo:
    $ pip install .

Pablo relies on some other libraries for the heavy lifting, so install those (`pip` does not install them for you):

    $ brew install sox ffmpeg

And you'll also need [Essentia](http://essentia.upf.edu/documentation/installing.html). [Installation instructions are here](http://essentia.upf.edu/documentation/installing.html).


## Usage

You can have Pablo analyze your library in one go, so that mix generation runs quicker. Pablo will persist song analyses based on file hashes so no redundant processing is necessary.

{'fraction_non_alphanumeric': 0.06351836509251588, 'fraction_numerical': 0.0022093344380005524, 'mean_word_length': 4.2645348837209305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2779848', 'n_tokens_mistral': 1021, 'n_tokens_neox': 947, 'n_words': 506}