Skip to content

music collection

This tasks describes what to do with the music gathering in the tagged directories.

gather

First we need to gather all music together that scores higher than 7.0. We need to group these into a recognizable menu structure.

  • Transform to .mp3
  • Get an icon (Folder.jpg) per album inside the album directory.
  • Naming : Artist/Artist - Year - Album/Artist - Year - Album - Nr - Title

transform

We need to be able to transform this tree structure into more usable data.

  • Add Tinnit filter.
  • Normalize the volume of all songs.
  • Add id3 tags and image.
  • Filter on rating, for instance : "give all songs scoring higher than 9.1"

A java tool for generating a completely new directory based on the source tagged directory called idcheck was made.

idcheck

A tool for scanning the directory and some transformation was built.

https://bitbucket.org/keesklopt/tools/src/develop/

Note that the master branch is indeed empty. A number of versions were found besides the bitbucket repo :

  • /work/projects/tools/id3/
  • /work/home/kees/projects/tools/id3
  • /oldhome/home/kees/projects/tools/id3

The first seems to be the newest, and it only has changes in the build.gradle file. Things like compile are now called implementation etc. The second and third are identical.

So we go with /work/projects/tools/id3

In fact this directory also differs with the repository, so it was probably an adaption to get a new gradle version (Gradle 8.0.2.) working. Indeed it does compile.

The working of this tool: After running the command ~/bin/idcheck.sh which basically is :

# idcheck.sh . 
java -jar /work/projects/tools/id3/build/libs/id3-all-1.0.jar .
  • a file called config.json is read in the current directory
  • some settings modify the programs behavior
  • a scan is done for all directories below the current directory.
  • whenever a problem is found, the programs stops as you just need to fix it.

problems needing a fix :

Not rated !. comment was :null

./Johnny Cash/Johnny Cash - 1981 - The Adventures Of Johnny Cash/9680/Johnny Cash - 1981 - The Adventures Of Johnny Cash - 06 - Only Love.mp3
Not rated !. comment was :null

basically, the comment should contain a rating between 0.0 and 10.0 run the script ~/bin/rate to fix this :

The rate script contains this code

#!/bin/bash
if [ "$#" -ne 2 ]; then
    echo "Usage example : $0 8.3 song.mp3";
    exit 1;
fi

id3 -c $1 "$2"

So we need id3 installed :

apt-get install id3

You probably did not rate the complete directory so :

cd Johnny\ Cash/Johnny\ Cash\ -\ 1981\ -\ The\ Adventures\ Of\ Johnny\ Cash/
ml Johnny Cash - 1981 - The Adventures Of Johnny Cash - 06 - Only Love.mp3
rate 7.7 Johnny\ Cash\ -\ 1982\ -\ The\ Baron\ -\ 01\ -\ The\ Baron.mp3 
Title  :                                 Artist:                               
Album  :                                 Year:     , Genre: Unknown (255)
Comment: 7.7                             Track: 0

This works, but now you will get a warning about the images being missing.

No image detected

image

You should always add a Folder.jpg file to the directory. If there already is an image in the mp3 you can extract it with

extract Johnny\ Cash\ -\ 1982\ -\ The\ Baron\ -\ 01\ -\ The\ Baron.mp3
/home/kees/bin/extract: line 7: eyeD3: command not found

So.. we need eyeD3 as well :

pip3 install eyeD3

But still this mp3 contains no image. So download one with cover.

cover.sh Johnny\ Cash\ -\ 1982\ -\ The\ Baron\ -\ 01\ -\ The\ Baron.mp3 
/home/kees/bin/cover.sh: line 16: glyrc: command not found
sudo apt-get install glyrc
convert *.png Folder.jpg
feh # to test the image
rm *.png

Note that image missing is not a fatal problem, but try to supply an image always. In later stages it might be added or removed to save some more space.

new content

Depending on this document, how do we deliver new content ?

At least it should be mp3 format, what an image as Folder.jpg.

Upto now, i tried to listen to the songs with my tinnitus frequency cut out. This means that every directory has an extra subdirectory called 9680 that also would be checked for tags etc. Just remove that directory after finishing. Tinnitus filter should become an option for idcheck later !!

The content should be 'clean' so we can convert it into other formats.

  • The file should be in mp3 format
  • No filters should be applied yet ! (no tinnitus)
  • No image should be inside the mp3 file.
  • Tags should be filled with names + rating comment

In the convert step we create a complete new tree with various operations.

  • Add image, or not
  • Skip songs based on rating limit
  • Apply tinnitus filter
  • Maybe we should also add genre to be to sort that way.