3

In text I want to insert colored music notes. I tried with Lilyglyphs package (see below), but it seems not possible. In Lilyglyphs, notes are precompiled pdf which are simply inserted. Is there any other package who can insert music notes inside the text?

\documentclass{report}

\usepackage{lilyglyphs}
\usepackage{color}

\begin{document}

  \textcolor{red}{Test of \quaver}.

\end{document}

Test of lilyglyphs

4 Answers 4

5

The notes are quite common in unicode text fonts, although for some reason the default latin modern has quaver but not crotchet, I picked a Garamond clone here Use with lualatex or xelatex

enter image description here

\documentclass{article}
\usepackage{xcolor}
\usepackage{fontspec}
\setmainfont{Garamond Libre}

\begin{document}

\textcolor{red}{a red quaver ♪ and a crotchet ♩}

\end{document}
1
  • Thanks for your answer, but not convenient at all to change the font just for a character! Also, this particular font is not present on my system, so it does not work for me! I'll try to find an other solution
    – Phantom
    Jan 2, 2022 at 21:19
3

You can use wasysym:

\documentclass{report}
\usepackage{wasysym}
\usepackage{color}

\begin{document}

\textcolor{red}{Test of \eighthnote\ \halfnote\ \quarternote}.

\end{document}

enter image description here

1
  • Thanks, but there is only from the whole to the eight notes, and there is no dotted notes.
    – Phantom
    Jan 10, 2022 at 14:24
1

With this very short document I get the attached result:

    \documentclass{report}

\usepackage{musixtex}
\usepackage{color}

\begin{document}
  {\textcolor{red}{eight \tinynotesize\cl h~~}}.
  {\textcolor{green}{half \smallnotesize\hu f~~}}.
  {\textcolor{blue}{whole \wh f~~}}.
  {\textcolor{yellow}{no head \smallnotesize\nq f~~}}.
  {\textcolor{cyan}{rest \tinynotesize\raise-3mm\qp~}}.
  
\end{document}

For this you do not need to start music, nor do you need to define notes. It looks like you can use any character of the musixtex package.

coloured notes

0

I achieved to do it with MusixTex, it's a little bit hacky but it does the job. If anyone need it here is my solution. I think it's possible to do it also for beamed notes.

%%%
% BEGIN: Single notes
%%%

% Whole note
\newcommand\myWh{%
  \hspace{-107pt}
  \raisebox{-09pt}[6pt][4pt]{%
  \scalebox{0.6}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\wh{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-103pt}
}

% Dotted whole note
\newcommand\myWhd{%
  \hspace{-107pt}
  \raisebox{-09pt}[6pt][4pt]{%
  \scalebox{0.6}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\whp{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-101pt}
}


% Half note, with upper stroke
\newcommand\myHu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\hu{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Half note, with lower stroke
\newcommand\myHu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\hl{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Dotted half note, with upper stroke
\newcommand\myHud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\hup{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Dotted half note, with lower stroke
\newcommand\myHud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\hlp{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}


% Quarter note, with upper stroke
\newcommand\myQu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\qu{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-070pt}
}

% Quarter note, with lower stroke
\newcommand\myQu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\ql{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-070pt}
}

% Dotted quarter note, with upper stroke
\newcommand\myQud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\qup{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Dotted quarter note, with lower stroke
\newcommand\myQud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\qlp{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}


% Quarver note, with upper stroke
\newcommand\myCu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cu{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Quarver note, with lower stroke
\newcommand\myCu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cl{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Dotted quarver note, with upper stroke
\newcommand\myCud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cup{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Dotted quarver note, with lower stroke
\newcommand\myCud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\clp{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}


% 2 quarver note, with upper stroke
\newcommand\myCCu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\ccu{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% 2 quarver note, with lower stroke
\newcommand\myCCu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\ccl{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Dotted 2 quarver note, with upper stroke
\newcommand\myCcud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\ccup{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% Dotted 2 quarver note, with lower stroke
\newcommand\myCcud{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cclp{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}


% 3 quarver note, with upper stroke
\newcommand\myCccu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cccu{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% 3 quarver note, with lower stroke
\newcommand\myCccu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cccl{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}


% 4 quarver note, with upper stroke
\newcommand\myCcccu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\ccccu{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% 4 quarver note, with lower stroke
\newcommand\myCcccu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\ccccl{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}


% 5 quarver note, with upper stroke
\newcommand\myCccccu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cccccu{f}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

% 5 quarver note, with lower stroke
\newcommand\myCccccu{%
  \hspace{-071pt}
  \raisebox{-06pt}[6pt][4pt]{%
  \scalebox{0.4}{%
    \begin{music}%
      \instrumentnumber{1}%
      \nobarnumbers%
      \setclefsymbol{1}\empty%
      \setlines{1}{0}%
      \nostartrule%
      \smallmusicsize%
      \def\afterruleskip{0\elemskip}
      \startextract%
        \znotes\cccccl{l}\en%
        \setemptybar%
      \endextract%
    \end{music}%
  }%
  }%
  \hspace{-069pt}
}

%%%
% END: Single notes
%%%

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .