I am a software engineer, and I am downloading Public Domain Classical Music. The original filenames are an inconsistent mess, and I would like to correct that. I have some metadata at my disposal, and want to name my files with the bare minimum identifying information. This is particularly important in case I am asked to produce licensing information.

Here is the info I am working with:

1   Composer: Johann Sebastian Bach
2   Form    : Concerto
3   Key     : D Major
4   License : ccpd
5   Mood    : Relaxing
6   No.     : No.5
7   Period  : Baroque
8   Rating  : 2
9   Work    : BWV.1050
10  path    : /music/3502-brandenburg-concerto-no-5-in-d-major-bwv-1050/
11  title   : Brandenburg Concerto No.5 in D major, BWV 1050 - II. Affectuoso

11 title is the original file name. title & path is highly variable, and so I avoid scraping it unless absolutely necessary.

I need you to tell me what is absolutely necessary.

Some examples:

Old: Brandenburg Concerto No.5 in D major, BWV 1050 - II. Affectuoso
New: Johann Sebastian Bach - Concerto No.5 [BWV.1050] in D Major
  • Q: Is II. Affectuoso neccessary? This can be a lot of trouble to scrape because there are no clear delimiters.
  • Q: What relevance is Brandenburg? Is this just where the audio was recorded, or does it have something to do with Bach?

Old: Etude Op. 25 no. 3 in F major - 'The Horseman'
New: Frédéric Chopin - Etude No.3 [Op.25] in F Major
  • Q: The Horseman I am assuming is necessary?

Old: Violin Concerto no. 1 in E flat major, Op. 6 -  I. Allegro maestoso
New: Niccolò Paganini - Concerto No.1 [Op.6] in E-Flat Major
  • Q: Is Violin Concerto no. 1 synonymous with simply, Concerto No.1? I am afraid that the No. qualification would change depending on the instrument. For example, maybe there is a Violin Concerto no. 1 and a String Concerto no. 1, meaning that there are multiple Concerto No.1s

Old: The Well Tempered Clavier, Book I, BWV 846-869 - Prelude in Fugue No.17 in C major a
New: Johann Sebastian Bach - Prelude & Fugue No.17 [BWV.846] in C Major
  • Q. Do I need to include Book I and is it fine that I exclude the range 846-869?

All in all, are the new names I am using sufficient?

  • The best, and I think really necessary, advice I can give here is that I think you need to work with an experienced musician. It is clear from your questions that you do not have much of a contextual understanding of the meaning of each part of the names, and as is mentioned in the answer, even canonical answers to the questions you have posted here will not resolve all possible future uncertainties
    – Judy N.
    Jun 12, 2020 at 16:36
  • You say "in case I am asked to produce licensing information": What is the problem here? If you are asked to produce it, is showing the metadata not enough, regardless of what name you give to the file?
    – Rosie F
    Jun 13, 2020 at 15:59
  • Please could you clarify "Here is the info I am working with"? What parts of that info were already in the file when you acquired it? which parts must you leave alone, and which parts may you change? Are you free to add new keys to the metadata or permute the existing keys?
    – Rosie F
    Jun 13, 2020 at 17:12
  • @RosieF Its not a clear cut process. I have to deal with this mostly on youtube, and there are companies who set themselves up to claim public domain works as their own, and make a profit off of videos featuring them. Sometimes, I would get upwards of 70 claims in a day. Here is the info I am working with There is a page, and a file. The file has been found on the internet, and will comes with a title that has information. That file is listed on a page that also has information. Sometimes the page info contradicts the file info.
    – Anon
    Jun 14, 2020 at 15:27

4 Answers 4


Practically speaking, I'm not sure there's a single catch-all solution, and I think part of the solution depends on who is using it: musicians or non-musicians?

  • By and large, I recommend including the movement number and title (like II. Affectuoso). In cases where these cannot be spliced, I would suggest something like II. Affectuoso — III. Allegro.
  • As for "Brandenburg," keep this in this example; these are the names of these concerti, named after the individual to whom Bach dedicated them. But there are other examples, too random and varied to name, where such a name could be omitted.
  • "The Horseman" is not necessary; in fact, I'd never heard this name for that etude before. There are many pieces where I would personally prefer the nickname, but if you're looking for barest possible information, you don't need to include them.
  • I recommend specifying the instruments used in the concerto; musicians invariably know these as Instrument Concerto No. x; no one views a composer's first piano concerto as "Concerto No. 7" since there were six violin concerti that preceded it.
  • Trained musicians would (by and large) much rather see "Book I: C major" in your final example than "BWV 846." With a gun to my head, I could not tell you what BWV 846 was (although I might guess this piece, since it's so famous); but everyone worth their salt knows what "Book I: C major" means, even without the composer! (By the way, this is not No. 17, but rather No. 1.)

So I'll say again: I don't think there's a single solution to this. But if you're looking for absolute bare minimums, I would say:

  • Composer
  • Title (including non-descriptive titles like "Symphony No. X")
  • Opus or catalogue number (if available)
  • Movement

Musicians would probably prefer a key area; I don't know all of Mozart's 23 piano concertos by number, but I have a much better shot at "Piano Concerto No. 9 in E-flat major." But again, this isn't always necessary, especially when a composer only wrote one concerto for that instrument.

  • Yes, of course:the instrument if you want to sort them by this feature. Yes there are many solutions depending of the taste. If one is experienced with the movements of sonatas, symphonies, concertos, this category may be superfluous. Composer and opus nr. may do it. Additional information can be researched ad libitum. Jun 11, 2020 at 13:24
  • 3
    It's worth pointing out that if OP wants the piece to be uniquely specified by the information saved (which is surely a minimum sensible requirement for a task of this sort) then the movement number and the instrument for the concerto are NECESSARY rather than merely recommended
    – Judy N.
    Jun 12, 2020 at 16:39
  • @JudyN. - Movement number is necessary, but as long as opus/catalogue/WoO number is there, instrument (and key) are not.
    – Dekkadeci
    Jun 14, 2020 at 13:52

The theoretical true minimum is only two things:

  1. The composer
  2. The catalogue or opus number

And perhaps

  1. The movement number

However, there are some problems.

The composer

Generally this should be fine, however you have to be prepared to deal with all the usual problems with identifying humans by name. Some composers are from musician families so you have to store at least all the first names as well.

For example, the large Bach family, the father and son Leopold and Wolfgang Mozart - I don’t believe Franz Xaver Mozart really comes up ever –, there are at least two Haydns and (Ludwig) van Beethoven had a composing brother Anton. In the case of Beethoven you have the additional problem of the prefix “van” (Dutch/Flemish “of”) which is regularly Germanised (“von”) and often even just omitted. Of course these are just the tip of the iceberg. In each of these cases one family member is tremendously more famous than the others, but that’s not always the case (e.g. Dussek, Franz Xaver and Jan Ladislav, who are equally obscure).

I’m sure as a programmer you know the problems surrounding identifying humans by name much better than I do. The only thing that might surprise you is that classical music deals with very old names, so they are even less regulated than modern ones. For instance, some names are fully translatable (Orlando di Lasso).

The catalogue or opus number

This is a much hairier category. I will first discuss opus and catalogue numbers separately, but theoretically storing just one (either one) is enough since they are both meant to be identifying numbers. However, the problems below complicate things and many pieces have only one of the two kinds of numbers.

Catalogue numbers
Many composers have a very well-documented list of all pieces (the more famous the composer, the more likely they’ll have one) in which each piece has an identifying number. However even in the catalogue for Mozart (called KV – Köchels Verzeichnis) there are some works which tantalisingly have 2 catalogue numbers and some have a letter suffix (e.g. “KV 448/375a”). I’m sorry, but I never took the time to find out where the double numbers come from. In case of Mozart the letter suffix is often used to indicate obscure works that are closely related to another.

Opus numbers
Opus numbers were assigned by the publishing company at the time the work was first published (generally speaking). They sometimes have a secondary number in case multiple pieces are published together, e.g. Chopin’s op. 25 nr. 3 means the third piece in the bundle of pieces that were published together as op. 25 (as it happens, that’s his second and last set of 12 studies/etudes). (“Nr.” and “no.” are used interchangeably.) Although these bundles are common, many pieces (especially longer works) are just published by themselves, e.g. the Paganini concerto you mentioned, which is op. 6 all by itself.

The first complication is that not all works have an opus number, for various reasons. Firstly, there is no composer who managed to have every single piece they wrote published. For example, there are many pieces that were written by famous composers when they were very young which we study now because they later became famous, but obviously at the time there was no reason to publish a child’s piece. Another reason is the fact that the practice of giving opus numbers only really starts in the second half of the eighteenth century.

A second complication is that occasionally these opus numbers are unreliable. As you may imagine this applies especially to early opus numbers. If a composer sold pieces to more than one publisher, these publishers might not synchronise their lists. I believe this happened to Haydn, but I don’t know which piece off the top of my head. I don’t know of examples in the nineteenth century and later, but I wouldn’t want to bet that there aren’t any (although by then it was standard practice and the later in time the better communication technologies become of course.)

Occasionally you will run into “Opus Posthumus”. You can disregard it, it just means the piece was published after the composer’s death, but it doesn’t impact the numbering.

Human error
Because works by a composer are sometimes counted per form as well (“concerto no. 3” for example), occasionally this gets mixed up with the opus numbering; for example, Beethoven’s opus 7 is a single piece: his fourth piano sonata. If you want to include both numberings you should write “Beethoven’s Sonata no. 4, op. 7” to distinguish from “Beethoven’s Sonata op. 7 no. 4” (doesn’t exist) which would mean the fourth piece (apparently a sonata) from the bundle numbered opus 7. The difference is only in the order and occasionally people get this wrong. It’s not inherent in the numbering scheme but you’ll likely run into this confusion. If I really have to mention both numbers I personally prefer to make the sonata number an adjective to avoid using the confusion stemming from seeing the abbreviation “no.” twice : “Beethoven’s fourth [/4th] sonata, op. 7”.

Movement number

Depending on your use case you might or might not need it. If each movement is going to be in a separate file you would of course need to differentiate between them (and what better way to do it than the inherent order of the movements), but – to be slightly pedantic – they do not matter to the identification of the work (since the various movements are by definition part of the same work).

However, in certain cases it’s unclear whether something is a single multi-movement piece or a collection of single-movement pieces. This applies especially in the nineteenth century (and later) because then it becomes more and more common to give free titles to works instead of just indicating the form. For example, if you have a number of seemingly separate pieces that are together called “sonata” it’s clear that it’s a single multi-movement work (because a sonata typically has multiple movements) but if you get a bundle called “Dichterliebe” or “Années de Pèlerinage” the title doesn’t give any information about that (and the distinction perhaps becomes less important). In some cases this means it’s hard to distinguish whether the contents of an opus have to be classified as “opus X no. 1 through N” or “opus X, movements 1 through “).

The title

I strongly recommend against using the title for work identification. Many classical pieces don’t have titles, but instead are named after their form, possibly with a number (e.g. “Concerto no. 2”). This means that they can be translated and reformulated (e.g. “Deuxième concert”, “second concerto” or “piano concerto no. 2” could all reference the same work and could all be considered its title). Additionally, some works were later given nicknames (“the moonlight sonata” or “revolutionary etude” for example) which were not intended by the composer and therefore aren’t titles. It’s not possible to tell whether a title is original or was given later without looking it up (unless you happen to know it of course). Not so easy for computers.

Okay, so what if there is no catalogue or opus number? Then you have a problem. It should be a rather rare situation, but problematic nonetheless.

There is a big library of public domain scores at imslp.org. I believe they assign all pieces that they have stored an “I-catalogue” number, which you could conceivably use, possibly scraping some of the metadata from the IMSLP page. But I find it hard to say anything about it without knowing your use case better.

Probably for pieces without identifying numbers there will be some manual work involved. Possibly this is not the only case in which that will be necessary. In the end, music, as all art, is hard to describe in a format suitable for a computer. Maybe one could compare it to natural language processing.

  • "I strongly recommend against using the title for work identification." The title can be part of the identification, can't it? In any case, in many cases there will be only a composer and a title (e.g. Composer:Claude Debussy. Title: La Mer), or a composer, a title for the whole work and a title for the part of that work (e.g. Composer:Claude Debussy. Title: La Mer - II. Jeux de vagues).
    – Rosie F
    Jun 13, 2020 at 15:55
  • 1
    @RosieF For humans, yes. For computers, it’s very difficult. But mainly, only a minority of classical pieces have real titles, so for a computer program implementing a different identification mechanism is necessary anyway, and when you have that, there is no reason to take on the considerable effort to parse titles (as I wrote above, they can be spelled or formulated differently, even in the case of proper titles, or translated).
    – 11684
    Jun 13, 2020 at 15:59
  • I don't see the problem. Perhaps @Akiva might say if there really is a problem here. In any case they seem to have taken the precautionary trouble to make hierarchical titles easy to parse, with a ' - ' delimiter between title of work and title of section. As for "a minority", I'd doubt that, what with tone poems, operas/musicals, songs, song cycles...
    – Rosie F
    Jun 13, 2020 at 16:09
  • Okay, minority is debatable (though I suppose neither of us has evidence), but I stated the problem twice: the same title can appear in various forms. That is difficult for computers to recognise. You have not addressed this. Secondly, what would be the advantage of using the title? I don’t understand what problem you are trying to solve. I’m not saying it would be impossible to involve the title at some point in the process in some way, I’m only stating it’s more trouble than it’s worth, especially considering the OP explicitly asked for the strict minimum of information required.
    – 11684
    Jun 13, 2020 at 16:16
  • And in the case of La Mer, I suppose it has an L number (the catalogue for Debussy). @RosieF
    – 11684
    Jun 13, 2020 at 16:16

This is something very individual.

I want to guess the composer, the form, the instruments, and the key tonic.

For this I’d like to have this features.

For someone other it may be sufficient to have the title of the work and the composer. All the rest he can research and google when ever he is interested.

For you it may be sufficient to know the composer and the BWV which is not a car label but this means: Bach Werk Verzeichnis. (The latter term means list nr. Most other composers also have their work lists (e.g. Mozart KV. ###).

If your interested in more information just google. I’m interested in music history and the life of composers.

So if you can say “Brandenburg Concerto” this is actually no additional information unless you know the meaning of it. Look it up, it is interesting and will build an anchor in your Network of knowledge, while the list nr. is helpful for researching but it contains no information at all. But when you read in wikipedia or in the booklet of a CD or if you can read the notes and have an idea how it sounds! this might be much more interesting to know, compare, study and understand the music you’re collecting and listing at.


Somehow I get the feeling that I'm not seeing the real question whose answer would give you the info you need. I know that when I was designing my music collection the question of what to name the files was easier and less critical than what to put in the tags, and your files already have metadata.

Who are these music files for? Is this just your personal music collection, or are you building a music server or database for other people?

Naming files for a public database

If the latter, then that is beyond my ken, but at least I know the value of information that was ever correct staying correct. If, say, you wanted to make some music files available from a server with a search engine, then there's going to be a database behind the scene, and that database will contain records which refer to music files by IDs of some sort. The ID of any particular music file will have to remain the same for as long as that music file is available.

What form should that ID take? I'd recommend going with some code (a number, perhaps). Info such as names of pieces of music should not be used in IDs which are meant to identify database records. If you look at the scores in IMSLP, you'll see that each has a unique numeric ID. I see 3502- at the start of that file name. Did you supply that or did the file come with that metadata already on it? That's the sort of thing to use.

It's important that the ID for a particular file remain constant because if it were to change, then any record which referred to that file would then become wrong.

In this situation, there isn't really any need for the names of an audio file to contain anything other than its ID. The stuff that is important to the user -- the composer, the title, and the movement's title if any -- that'll be in the file's metadata.

Naming files for a private music collection

The path you show in your first example goes straight from music to 3502-brandenburg-concerto-no-5-in-d-major-bwv-1050. Can you not introduce some hierarchy into the directory (folder) structure that you use to store these files in? Or are you using some app which can only operate on files collectively if they are all in the same directory? (It would be a pretty poor app if that were the case. I use MediaMonkey, which can handle a collection of files in a directory tree headed by a specified top directory.)

Just in case you might be able to use some of the same ideas, I'll describe how I name the files in which I store my music collection on disk. Below \music\ I have a subdirectory for each composer, so we have e.g. \music\Adams, John\. Thus the file name for the music file need not contain the composer name as part of it (because the composer's name is the name of the directory). Moreover, for any work where the audio is in two or more files, one for each section of the work, I have a directory for that work, which is a subdirectory of the directory for the composer. So then the name of the file for each section need only identify the section from among the sections of that work. (My music collection has 160 files called 1 Allegro.mp3 in various directories. This is fine; their grandparent and parent directories identify the composer and work.)

Considering that the nature of the licence is important, I guess you might actually need more info than just enough to identify the piece. For example, if it were a commercial recording, then the recording company, catalogue number of the CD, and track number?

In my music collection there are many cases of recordings of different performances of the same work. In those cases when giving the name of the work I add something else in brackets to disambiguate -- such as the conductor's or performer's surname.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.