Jampal mp3 Library |
|
Summary of Features Detailed Features What's New? Download Installation & Getting Started License & acknowledgements Project Info
User's Guide
Utilities
Author
My Other Projects
|
Jampal includes a management system that will organize and automate many tasks related to a large mp3 library. These programs are written as bash shell scripts and make heavy use of awk. Familiarity with shell scripts is essential for use of these scripts The following is a summary of what these scripts do and how to run them. I have been using them for years. I have made many changes over the years and I continue to make modifications and enhancements. System Requirements This requires either windows with Cygwin or a Linux or Unix operating system or similar. If you are running Linux you are all set. If you have Windows, download and install Cygwin. If you have a dual boot system with Linux and Windows you can run this on both. Linux / Cygwin components Certain optional components are required. Many installations will already have these, if you do not you should obtain and install them.
Setup Scripts are installed in a "scripts" directory under the jampal directory. For ease of operation you can add this to your path. Your Jampal library or libraries must be set up with the option "use Unix style paths" if you are running windows / cygwin. See the jampal documentation for details and restrictions. If using CYGWIN, all paths must be set up so that the path is compatible with Windows. This means creating links for example ln -s C:/Music /Music makes the /Music directory compatible. Use this for "Program Files" ln -s "C:/Program Files" "/Program Files". Create a profile file. Copy the file mp3_base.profile to mp3.profile. Edit this file and insert your own values for each parameter. This contains directory names and options that will be used by the scripts. The profile caters for a dual boot Windows and Linux system if you have one, by checking the operating system and supplying different parameters as required. If you do not have a dual boot system you can ignore the parts that do not apply to you. The scripts work best if you organize your library as follows. Your library of mp3 files should be backed up on to CDs or DVDs. Name each CD or DVD with a serial number of the form YYMMDD_HHMM_X, using the date and time you created it and any character you please instead of X (e.g. you may want to identify the CDs with one character representing music type). If you are starting out and they are not yet on CDs or DVDs, create a directory named as described, and put your files in subdirectories under that directory. Put up to 700 MB per CD directory or 4.2 GB per DVD directory. You can name the subdirectories anything you want, or just put them in one subdirectory. Load the music files into jampal and make sure that they all have titles, artists, track numbers and album names. Without these filled in none of the scripts will work. You can use the mp3lib.sh script to rename your files with the track number, title and artist and move them around into directories named according to the album title. After this you can burn them to CD or DVD. mp3lib.sh This script renames files and organizes them in directories. It has a safety feature built in which allows you to review all of the changes before anything is renamed. A directory is created for each album. See below for how to handle tracks without an album name. It is named with a 3 digit number and the album name. Each track in the directory is named with a three digit number. They are ordered within directory by album name and track number. If your mp3.profile has an entry for OLDISKFORMATBEFORE with a date YYMMDD, any CD or DVD with a date before that will be formatted differently. Albums will have a prefix A to Z and tracks will have a prefix of the album prefix and 2 digit track number (e.g. A01 for the first track of album A). This was an old scheme I used before DVDs and it restricts you to 26 albums per disk. This is fine for CDs but insufficient for DVDs. Make sure all of your files are loaded into a jampal library that is located in the LIBDIR specified in mp3.profile. Make sure they all have titles, artists, track numbers and (where applicable) album names. A directory will be created for each album. If you have some tracks without an album or you only have one or two tracks from some albums, You may want to group them in a directory together rather than creating a separate directory for each one. To do this, customize your library and add a field called Directory. This must be a "user defined text information frame" with description Directory. Also add this field to the tag editor, and select it in the Display Columns. Now you can enter values in the Directory field and those tracks will be placed in a directory named after that field instead of named after the album. I generally type Misc into that column and all of the tracks without an album are put in the Misc directory. Save the library in jampal (File, Save Library). Run mp3lib.sh followed by your library name. There may be some error messages displayed, and then it will give you the option to view the list of renames, run it or ignore it. The first time you will probably want to look at it very carefully. If you press enter it will not run the renames, and you can try again at any time. If you type yes as prompted it will run the renames. After renaming and moving the files it updates your jampal library. If jampal is still open you must use the File, Reload library menu at this time. Note - If you forget to reload no harm will result, the only effect is that jampal will report an error if you try to play or update a track that was renamed. The next time you start up jampal the library would be reloaded anyway. Even if you update in jampal some tracks that were not renamed, all will be sorted out next time you start jampal. In the mp3.profile is an entry DELETEFRAME. This is set up as a text frame ID3V2TAGTXXXPeter. You can change this to another frame if you prefer. Which ever frame is specified here is used for removing unwanted songs. If you use this feature, this frame must be selected as part of your library and should be displayed in the library window. You can customize this within Jampal. If this frame is set to R or D, that song will be removed. It is not physically deleted, it is moved to another directory and the entry is removed from the library. Periodically you can clean up that other directory. The directory where the reject files go is identified in mp3.profile by the entry export REJECTPATH="$basedir/reject", by default it is directory "reject" under your music base directory. You can change it to any other directory if you prefer. Sometimes it is necessary to run mp3lib.sh and the renames twice. If songs are being moved from one directory to another (i.e. you renamed their album or Directory, or you added new songs that are being moved to an existing directory), you will need to run mp3lib.sh and the renames twice. If a second rename is not necessary, when viewing the results you will see no songs being moved. Usage mp3lib.sh [-reorder] library-name [moved-file-dir] The -reorder option can be used to reorder album directories within a CD directory. Each time you run p3lib.sh it creates a file called ZZAlbums.txt in each CD directory. If you edit one of these files you will se a list of album names. You can change the order by moving some entries with an editor and saving the file. After doing that run mp3lib.sh with the -reorder option. There is an important requirement: Before editing any ZZFiles.txt file run mp3lib.sh against the library and make sure that the renames have been done. If there are any renames outstanding the reorder will not run. If you run mp3lib.sh and it performs renames, run it a second time to make sure there is no second set of renames. The optional parameter moved-file-dir is a directory name to which album directories have been moved. In order for the library to be correct, you should not move or rename song files on the hard drive (except for the automatic moving and renaming done by mp3lib.sh). There is an exception to this rule. If you need to move one or more directories (albums) from one place to another, you can use this feature. You can move directories to a single new directory, then use mp3lib.sh with the destination directory specified as the moved-file-dir parameter. mp3lib.sh will adjust the library and rename all the other directories accordingly. This is most useful when you are trying to split albums up into groups of 700 MB for burning to CD. mp3cover.sh This script makes an envelope for an mp3 cd and a track listing to be inserted in the envelope with the cd.
mp3cover.sh [-artist] library-name diskser "desc" The first pages of the document are an insert listing of tracks. The last page is an envelope. If you are making a DVD cover you probably have so many albums that the last page does not hold all the names and actually produces several pages. In that case, use openoffice to insert columns in the last page, sufficient so that it all fits, as follows.
Making the envelope Cut the index pages along the lines as shown below.
Turn the envelope page (last page) over and make marks as shown below in red. The printing on the example below will not be visible, it will be on the underside of the paper.
Place a ruler on the page along the red lines marked fold 1, fold 2, fold 3. In each case pull the paper up against the ruler to make a crease. Finally fold the right edge over to meet fold 1. This makes fold 4 (marked in blue).
Cut corners off as shown below.
Fold down the right hand flap.
Fold in the middle.
Fold over the tabs and tape them down.
Fold the index pages in half with the writing on the outside. Slide them into the envelope. Slide in the CD or DVD. The view from the front is shown below.
Fold down the top tab to close the envelope. mp3dup.sh This script helps you identify and remove duplicate songs. In order to save space on your hard drive, if a song exists on multiple albums you can remove some of the duplicates. The script is used in conjunction with the mp3lib.sh script. Any songs you identify as duplicates are removed when you run mp3lib.sh. A customized text field (ID3V2TAGTXXXDup) is used, as well as the frame that you designate in mp3.profile as DELETEFRAME. The DELETEFRAME is the name if the frame (usually a user text frame) that is used by mp3lib.sh to identify songs to remove. See the description under "mp3lib.sh" above. These frames must be selected as library fields in your main library. To run it use mp3dup.sh. It does not take any parameters. The script creates a library called "duplicate" with possible duplicate songs identified, and opens it in Jampal. It uses transformations of the title and artist to identify possible duplicates even if they are not typed exactly the same. The duplicate library is created in your library directory the first time you run mp3dup.sh. You can customize the duplicate library and from then on it will use the customized version. The first column of the library contains a DUMMY column with two numbers. First is a numeric sequence of the song number identified as a possible duplicate. Second is a number identifying which duplicate it is. This makes up the sort sequence, so if you change the order of songs in the duplicate library you can click on this column header and get it back to the initial sequence. Look at the library and decide if the songs are real duplicates or not. If they are duplicates and you do not want to keep both copies, mark one as rejected. If you want to keep two or more copies mark each with a number in the Dup column. Then in future these will not be shown as duplicates. Mark a song as rejected by putting R or D in the column identified by DELETEFRAME in your mp3.profile. Then running mp3lib.sh will move those files to your rejected directory and remove them from the library. Tip - you can first mark them with another value (e.g. X) in the delete frame. Once you are sure and have double checked you can easily use jampal to change all songs with X in that column to R or D. (sort on the column, select all songs with X, edit tags, check off the delete frame, enter R or D for the value, click the Update button). Only songs with R or D in that column are removed. mp3lame.sh Usage: mp3lame.sh [-recode|-recode-even] Converts files in a directory to mp3 using lame. If you use no input option, it encodes all wave files in the current directory that have extension wav. It encodes to 128K mp3. If you use option -recode, it re-encodes mp3 files in the current directory, but only if they have higher than 128K bit settings. It puts the re-encoded files in a subdirectory called recode. If you use option -recode-even, it re-encodes all mp3 files in the current directory, regardless of their bit settings. It puts the re-encoded files in a subdirectory called recode. When either of the recode options is used, the ID3V2 tag is copied to the new file after the recoding is done. playlist.sh and playlistcd.sh Creates a playlist with songs chosen and ordered by parameters you supply. You can choose using any values of combinations on values in the library, and order randomly or according to any values in the library. There are many iptions, which are shown if you enter the command with no parameters. The conditions are entered as expressions in the awk programming language. playlistcd.sh takes the playlist that was generated and stores them in directories of the appropriate size for burning to CD. Alternatively stores them in directories of appropriate size for loading to an mp3 player. Also can load the songs directly to an mp3 player. There are some examples in the examples subdirectory under scripts.
playlist.sh
tagbkup.sh and related scripts Back up your mp3 tags so that if you lose your hard drive you can restore your songs from CD and then replace the latest version of your tags from the backup. Also keep track of which songs are saved to CD / DVD and report on any songs that were not saved. Full instructions coming ... |