4

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 : enter image description here

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). – TeXnician 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. – ebosi 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 ? – Romain B. 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. – Romain B. 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. – TeXnician Nov 22 '18 at 19:00
4

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}
  • 1
    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 – Romain B. Nov 24 '18 at 9:53
3

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}

enter image description here

\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.

  • 1
    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. – Romain B. Nov 24 '18 at 10:03

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.