
README¶
the classical music manager you never knew you needed, until now...
clamm
is a python command line program for managing (and growing) a library of classical music.
- efficiently maps the tags of classical music audio files to sane structures.
- provides tools for working with raw audio streams of (you guessed it!) classical music
- generate playlists using iTunes-like combination logic.
INSTALLATION¶
Most (if not all) of the software listed below can be installed using common package managers like brew, apt, pacman, yum, ...
clamm
functionality is broken into two main categories, Managing and Adding.
The dependencies for organizing and building a library are
- ffmpeg for audio stream conversion and other low-level audio utilities
- flac for
metaflac
which enables tagging FLAC files
The dependencies for adding to a library require macOS first of all. Also,
- shairport-sync for capturing raw PCM data from iTunes
- osascript for controlling iTunes
FAQ¶
Aren’t there libraries that do this already?¶
There are already several good music library tools on the market. The best I am aware of is probably is beets. beets
has great support for interfacing with the open-source tag database musicbrainz as well a host of library management functionality and a rich plugin ecosphere. Indeed, clamm
aspires to be like beets
when it grows up.
I tried beets and still have a use for it, but it didn’t have the support for classical music tags I wanted. In fairness, beets relies heavily on musicbrainz, and musicbrainz reflects all other audio file tag schemas in skewing toward popular music.
tagging scheme¶
The basic strategy is create a tag library consisting of representative entries for each tag entity. The library (or database) serves as the definitive representation of a COMPOSER/ARTIST. When new files are synchronized to the library, a matching entry is sought within the existing entries. If a match is found the tags of each audio file are updated to match the representation in the database. If a match can’t be found, the entity is added to the database.
An audio file can be characterized by a number of tag fields
Composer¶
A COMPOSER composes a piece of music. Classical music generally differs from most genres of popular music in that the performer (ARTIST) is not the same person(s) as the COMPOSER. Example entry:
"Isaac Albéniz": {
"nationality": "Spanish",
"period": "Classical/Spanish Folk",
"full_name": "Isaac Albéniz",
"abbreviated": "Albéniz",
"sort": "Albéniz, Isaac",
"borndied": "1860-1909",
"permutations": [
"Albéniz, Isaac",
"Isaac Albéniz",
"Albeniz, arr. Christopher Parkening",
"Albéniz",
"Albéniz, Isaac (1860-1909)"
]
}
Field summary¶
A few of the notable fields, along with their tag file mappings, are
full_name
==> COMPOSER¶
The name to display
nationality
==> COMPOSER_NATIONALITY¶
Where the composer was born and/or lived during their active years.
period
==> COMPOSER_PERIOD¶
A description of the primary sub-genre associated with the composer.
borndied ==> COMPOSER_DATES¶
The vital dates of the composer’s life.
Artist¶
ARTIST performs the music of the audio file and generally presents more of a challenge than does the COMPOSERs.
Often a piece will list multiple performers. For example:
audiolib module¶
streams module¶
The streams module provides two programs for working with raw audio streams.
. The second processes a stream into an album.
listing2streams¶
The first use case automates generating raw pcm
files from iTunes using a listing of album/artist pairs in json
format. Example:
"A2": {
"artist": "Richard Egarr, Academy of Ancient Music & Andrew Manze",
"album": "Bach: Harpsichord Concertos - Triple Concerto"
}
See also batch_album_listing under the templates
directory.
notes¶
By classical, I mean any piece of music characterized by having an associated
- composer
- performer (artist)
- arrangement
Which, for my library, includes traditional classical composers, like J.S. Bach and Beethoven, as well as newer, harder to categorize composers, like Max Richter and Steve Reich.