# Can I add music/rythm notations in text?

I'm trying to write a text describing a short musical excerpt and I'd like to mention that a particular theme follows a given rhythm. But instead of just saying something along the lines of "we have a 2 quarter-note, double note rythm that blablablas", I'd much rather just put the rythmic symbol in text :

I've looked at musixtex, but haven't been able to really wrap my head around it. It doesn't seem possible to include elements in text (and I'm not sure the learning curve is worth it for such a trivial thing).

Any ideas ?

• Have a look at en.wikipedia.org/wiki/Musical_Symbols_(Unicode_block) and search for a font that does support this (including the beam start/end markers). Nov 22 '18 at 17:59
• You might want to have a look at lilypond, and how to use it with LaTeX. It could be an overkill, though. Nov 22 '18 at 18:00
• I'm actually using lilypond separately to make some score parts, but since I'm writing this in overleaf (no lilypond interpreter), I have to import the pdfs and crop them to size. For now, the hack I'm using for the problem in my question is exactly that, but there ought to be something better I guess ?
– RoB
Nov 22 '18 at 18:26
• @TeXnician I'm afraid even my browser has trouble showing some of the symbols in that page (including note heads and beams, which I find strange). so I'm not sure this is a viable option.
– RoB
Nov 22 '18 at 18:31
• I just tested with the Bravura font and it is very unfortunate that the beams do not work (the font makes "interesting" use of the PUA). Simple notes are no problem. Nov 22 '18 at 19:00

Writing sheets is hard without external software such as lilypond or MusixTex. But If it's only the symbol you're after you should take a look at the harmony package:

\documentclass{article}
\usepackage{harmony}
\usepackage{graphicx}

\begin{document}
Check this rythm out:~\scalebox{1.5}{ \SechBr {} \AchtBL} ! tafa tefe yo !
\end{document}

• This appears to be the easiest bet, thanks. I looked a bit and found this blog post with a couple examples. And in case anyone wondered, the rythm I was going for turns out as \SechBR\SechBL\AchtBL
– RoB
Nov 24 '18 at 9:53

Here is an answer using MusixTeX, from which you can easily define a macro:

\documentclass{standalone}

\usepackage{musixtex}

\begin{document}

We have a 2 quarter-note, double note rythm \mbox{
\smallmusicsize
\setclefsymbol1\empty
\generalmeter{\empty}
\nostartrule
\setlines1{0}
\staffbotmarg0pt
\stafftopmarg0pt
\startpiece
\Notes\ibbu0e0\qb0e\tbbu0\qb0e\tbu0\qb0e\en
\zstoppiece
} that blablabla

\end{document}


\smallmusicsize sets the music size to small: \setclefsymbol1\empty and \generalmeter{\empty} remove clef and meter from the extract; \nostartrule removes the beginning vertical line; \setlines1{0} sets the number of lines to draw to zero; \staffbotmarg0pt and \stafftopmarg0pt remove useless vertical space; then you type your notes between \startpiece and \zstoppiece; for the code, see MusixTeX documentation.

• Thank you for the trouble, but I think the complexity needed for this simple example is exactly why I avoided MusixTex in the first place. @Elad Den's proposition seems to better suit my needs and appears easily adaptable should I need it for other rythms.
– RoB
Nov 24 '18 at 10:03