# How define biblatex entry for phonogram/recording?

I would like in my bibliography to have a category for phonograms/recordings. The important fields would be: author (artist), date, title, publisher (label), [some field] (for label number), number (for number in a CD box, for example. The desired output is something like:

Gilels, Emil. (1985/1996). Beethoven: Sonatas 3--5. In: Complete Piano Works of Beethoven. CD/LP no 8. Deutsche Grammophon, 453 221-2 .

%\renewbibmacro*{series}{\printseries}
\DeclareBibliographyDriver{audio}{
\usebibmacro{bibindex}
\usebibmacro{author}
%\space\mkbibparens{\printfield{year}}
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}
\setunit{\labelnamepunct}\newblock
\printfield{series}
\mkbibparens{\thefield{type}~\printfield{number}}
\newunit
\printlist{publisher}
\printfield{userd}\space
\usebibmacro{finentry}
}
\DeclareFieldFormat[audio]{number}{~nr~#1}


@audio{emil1996,
entrysubtype = "book",
author = {Giels, Emil},
year = {1985-1996},
title = {Beethoven: 29 Sonaten Gilels},
series = {Allihopa sonaterna},
publisher = {Deutsche Grammophon},
userd = {453 221-2},
type = {CD/LP},
number = {8}
}


This almost makes it. It however has no ”In:” before the series unit, and no puncuation after it. I also would like no parentheses around the CD/LP nr) It now reads:

Gilels, Emil. (1985/1996). Beethoven: Sonatas 3--5. Complete Piano Works of Beethoven. (CD/LP nr 8). Deutsche Grammophon, 453 221-2.

Gilels, Emil. (1985/1996). Beethoven: Sonatas 3--5. In: Complete Piano Works of Beethoven. CD/LP nr 8. Deutsche Grammophon, 453 221-2.

EDIT: the code however fails miserably if there is no series field. Anyone has a waterproof solution?

-
I guess it has to with the line \DeclareBibliographyDriver, but I cannot figure the code out. Of course, I could use Misc, but then it would be neccesary to force som fields, and it would make a sorting of the bibliography more cumbersome. – johlie Sep 30 '12 at 18:20
Please provide a minimal example. I am sure you can handle it very simple if we know your style. I suppose that the following will work \DeclareBibliographyAlias{recordings}{article} and now you can specify the field format by \DeclareFieldFormat[recordings]{number}{\mkbibparens{CD/LP~Nr.~#1}} – Marco Daniel Oct 1 '12 at 3:05
Thank you for your answer. I have edited, and provided a small example in the question. – johlie Oct 1 '12 at 10:53

In biblatex, an entry type for musical recordings exists with the Historian style. So you can make some arrangements in the type @audio or create a new one with someting like it:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear, sorting=nty, babel=hyphen, mincrossrefs=1, usetranslator=true]{biblatex}

\DeclareBibliographyDriver{recording}{
\usebibmacro{bibindex}
\usebibmacro{author}
\labelnamepunct
%\newblock
%\printfield{year} %only with other style than authoryear
%\labelnamepunct
\newblock
\printfield{title}
\labelnamepunct
\newblock
\iffieldundef{series}{}{\printfield{series}}%if true (no entry): nothing, if false: print the field
\labelnamepunct
\newblock
\iffieldundef{number}{}{\printfield{type}~\printfield{number}}
\labelnamepunct
\newblock
\printlist{publisher}
\printfield{userd}
\usebibmacro{finentry}
}

\DeclareFieldFormat[recording]{year}{\mkbibparens{#1}}
\DeclareFieldFormat[recording]{number}{~nr.~#1}
\DeclareFieldFormat[recording]{series}{In:~#1}
\DeclareFieldFormat[recording]{title}{\emph{#1}}

\bibliography{test_music.bib}
\title{An example of a personalised entry type @recording}

\begin{document}
\maketitle
\noindent
A recording reference with series: \cite{emil1996}.\\
A recording reference without series and no cd number: \cite{mutter2002}.\\
A recording reference with series left empty: \cite{souchon2012}.
\printbibliography
\end{document}


the .bib file:

@recording{emil1996,
author = {Giels, Emil},
year = {1985-1996},
title = {Beethoven: 29 Sonaten Gilels},
series = {Allihopa sonaterna},
publisher = {Deutsche Grammophon},
userd = {453 221-2},
type = {CD/LP},
number = {8}
}

@recording{mutter2002,
author = {Mutter, Anne-Sophie},
year = {2002},
title = {Beethoven: Violin Concerto - Romances},
publisher = {Deutsche Grammophon},
userd = {471 379-2},
type = {CD},
}

@recording{souchon2012,
author = {Souchon, Alain},
year = {2012},
title = {A cause d'elles},
publisher = {EMI},
series = {},
userd = {50999 73066422}


}

-
Thank you papageno. I need to use the authoryear style, though. I updated the question above. – johlie Oct 1 '12 at 11:38
+1 The @audio, @music and @performance types are defined in the default data model. These are handled with the misc bibliography driver, which you can override by defining new drivers for each type. Use of the new type @recording here is actually made possible with biber, not the historian style. – Audrey Oct 1 '12 at 16:39
Fantastic, thank you! – johlie Oct 2 '12 at 10:34
It is really great to learn to code these things. You are really great! – johlie Oct 2 '12 at 11:04
@papageno I surely learnt much since when I joined the site. Great nickname, by the way; are you really a Vogelfänger? :-) – egreg Oct 2 '12 at 11:57