LaTeX forum ⇒ LaTeX Beginner's GuideAnnotate a Score in Musixtex-LaTeX

Questions and answers about the LaTeX Beginner's Guide
abravov
Posts: 2
Joined: Fri Nov 18, 2022 6:44 pm

Annotate a Score in Musixtex-LaTeX

Postby abravov » Fri Nov 18, 2022 7:16 pm

We need to anotate an score using arrows and texts, the code is as follow:

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usepackage{musixtex}
\input{musixlyr}
\input {musixcho}
\input {musixdat}%fecha
\input {musixfll}
\input {musixgre}%gregoriano
\input {musixper}%percusión
\input {musixppff}
\input {musixstr}
\input {musixvbm} % experimental vectorized beams
\input {musixdbr} % lineas de barras punteadas, discontinuas y arbitrariamente discontinuas
%Rutinas para Musixtex
\newcommand{\BBBl}[5][0]%
{\ibbbl{#1}{#2}{#3}\qb{#1}{#4}\tqb{#1}{#5}}
\newcommand{\BBBBl}[5][0]%
{\ibbbbl{#1}{#2}{#3}\qb{#1}{#4}\tqb{#1}{#5}}

\begin{document}
%\begin{tikzpicture}
%\draw [red,-{Stealth}] (0,0)--(0.5,-1);
%\draw (0,0) circle (1cm);
%\draw (0,0) node {
%\node (image) at (0,0) {
%\begin{figure}[H]
\begin{center}
%\tikz{\node[scale=1]{
\begin{music}
\normalmusicsize
\setclefsymbol1\empty
\nobarnumbers
\nostartrule % Inicia sin barra vertical
\startextract
%\startpiece
\notes \wh j \sk \en
%\Endpiece
\zendextract %Cierra de partitura sin barra vertical
\startextract
%\startpiece %\alaligne\alapage
\notes \hl{j} \sk \hl{j} \sk \en%\alaligne
%\Endpiece
\zendextract %Cierra de partitura sin barra vertical
\startextract
%\startpiece
\notes \ql{j} \ql{j} \ql{j} \ql{j} \sk \en %\alaligne
%\Endpiece
\zendextract %Cierra de partitura sin barra vertical
\startextract
%\startpiece
\notes \Dqbl jj \Dqbl jj \Dqbl jj \Dqbl jj \en
%\Endpiece
\zendextract %Cierra de partitura sin barra vertical
\startextract
%\startpiece
\notes \Qqbbl jjjj \Qqbbl jjjj \Qqbbl jjjj \Qqbbl jjjj \en
%\Endpiece
\zendextract %Cierra de partitura sin barra vertical
\startextract
%\startpiece
\notes \BBBl{l}{0}{jjjjjjj}{j} \BBBl{l}{0}{jjjjjjj}{j} \BBBl{l}{0}{jjjjjjj}{j} \BBBl{l}{0}{jjjjjjj}{j} \en
%\Endpiece
\zendextract %Cierra de partitura sin barra vertical
\end{music}
%};}
\end{center}
%\end{figure}
%\end{tikzpicture}

\begin{center}
\tikz{\node[scale=0.7]{
\begin{music}
\smallmusicsize
\setclefsymbol1\empty
\nobarnumbers
\nostartrule % Inicia sin barra vertical
\startextract
%\startpiece
\notes \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j} \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j} \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j} \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j}\en
%\Endpiece
\zendextract %Cierra de partitura sin barra vertical
\end{music}
};}
\end{center}

\end{document}


What we need as output is as follow:
https://drive.google.com/file/d/1364kAgoQzIOaJfn8S1KlPmkp6rxd2kXn/view?usp=share_link

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
abravov
Posts: 2
Joined: Fri Nov 18, 2022 6:44 pm

Annotate a Score in Musixtex-LaTeX

Postby abravov » Sun Nov 27, 2022 6:59 pm

This is an altervative approach, but the width has not been set properly... Any suggestion how to configure this?

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usepackage{musixtex} 
\input{musixlyr}
\input {musixcho}
\input {musixdat}%fecha
\input {musixfll}
\input {musixgre}%gregoriano
\input {musixper}%percusión
\input {musixppff}
\input {musixstr}
\input {musixvbm}  % experimental vectorized beams
\input {musixdbr} % lineas de barras punteadas, discontinuas y arbitrariamente discontinuas
%Rutinas para Musixtex
\newcommand{\BBBl}[5][0]%
{\ibbbl{#1}{#2}{#3}\qb{#1}{#4}\tqb{#1}{#5}}
\newcommand{\BBBBl}[5][0]%
{\ibbbbl{#1}{#2}{#3}\qb{#1}{#4}\tqb{#1}{#5}}

\begin{document}
\begin{tikzpicture}[remember picture,overlay]
    %Primera partitura 
    \node[text width=12cm,align=center, scale=0.9] at (6,0){
    \begin{music}
      \normalmusicsize
      \setclefsymbol1\empty
      \nobarnumbers
      \nostartrule % Inicia sin barra vertical
      \startextract
      \notes \sk \wh j \sk \en
      \zendextract %Cierra de partitura sin barra vertical
    \end{music}};
    %Segunda partitura 
    \node[text width=12cm,align=center, scale=0.9] at (6,-1.5){
    \begin{music}
    \normalmusicsize
    \setclefsymbol1\empty
    \nobarnumbers
    \nostartrule % Inicia sin barra vertical
    \startextract
    \notes \sk \hl{j} \sk \hl{j} \sk \en%\alaligne
    \zendextract %Cierra de partitura sin barra vertical
    \end{music}};
    %Tercera partitura 
    \node[text width=12cm,align=center, scale=0.9] at (6,-3){
    \begin{music}
    \normalmusicsize
    \setclefsymbol1\empty
    \nobarnumbers
    \nostartrule % Inicia sin barra vertical
    \startextract
    \notes \ql{j} \ql{j} \ql{j} \ql{j} \sk \en
    \zendextract %Cierra de partitura sin barra vertical
    \end{music}};
    %Cuarta partitura 
    \node[text width=12cm,align=center, scale=0.9] at (6,-4.5){
    \begin{music}
    \normalmusicsize
    \setclefsymbol1\empty
    \nobarnumbers
    \nostartrule % Inicia sin barra vertical
    \startextract
    \notes \Dqbl jj \Dqbl jj \Dqbl jj \Dqbl jj \en
    \zendextract %Cierra de partitura sin barra vertical
    \end{music}};
    %Quinta partitura 
    \node[text width=12cm,align=center, scale=0.9] at (6,-6){
    \begin{music}
    \normalmusicsize
    \setclefsymbol1\empty
    \nobarnumbers
    \nostartrule % Inicia sin barra vertical
    \startextract
    \notes \Qqbbl jjjj \Qqbbl jjjj \Qqbbl jjjj \Qqbbl jjjj \en
    \zendextract %Cierra de partitura sin barra vertical
    \end{music}};
    %Sexta partitura 
    \node[text width=12cm,align=center, scale=0.9] at (6,-7.5){
    \begin{music}
    \normalmusicsize
    \setclefsymbol1\empty
    \nobarnumbers
    \nostartrule % Inicia sin barra vertical
    \startextract
    \notes \BBBl{l}{0}{jjjjjjj}{j} \BBBl{l}{0}{jjjjjjj}{j} \BBBl{l}{0}{jjjjjjj}{j} \BBBl{l}{0}{jjjjjjj}{j} \en
    \zendextract %Cierra de partitura sin barra vertical
    \end{music}};
    %Septima partitura 
    \node[text width=12cm,align=center, scale=0.7] at (6,-9){
    \begin{music}
    \normalmusicsize
    \setclefsymbol1\empty
    \nobarnumbers
    \nostartrule % Inicia sin barra vertical
    \startextract
    \notes \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j} \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j} \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j} \BBBBl{l}{0}{jjjjjjjjjjjjjjj}{j}\en
    \zendextract %Cierra de partitura sin barra vertical
    \end{music}};
    %Lineas de redonda a blanca
    \draw[draw=red, line width=3pt] (6,-0.15)--(5.55,-1.25);
    \draw[draw=red, line width=3pt] (6.1,-0.15)--(6.45,-1.25);
    %Lineas de blanca a negra (par de izquierda)
    \draw[draw=red, line width=3pt] (5.45,-2.05)--(5.05,-2.8);
    \draw[draw=red, line width=3pt] (5.55,-2.05)--(5.55,-2.8);
    %Lineas de blanca a negra (par de derecha)
    \draw[draw=red, line width=3pt] (6.35,-2.05)--(6.05,-2.8);
    \draw[draw=red, line width=3pt] (6.45,-2.05)--(6.55,-2.8);
    %Lineas de negra a corchea
    \draw[draw=red, line width=3pt] (4.85,-3.55)--(4.45,-4.3);
    \draw[draw=red, line width=3pt] (4.95,-3.55)--(4.85,-4.3);
    
    \draw[draw=red, line width=3pt] (5.45,-3.55)--(5.35,-4.3);
    \draw[draw=red, line width=3pt] (5.50,-3.55)--(5.75,-4.3);
    
    \draw[draw=red, line width=3pt] (5.95,-3.55)--(6.25,-4.3);
    \draw[draw=red, line width=3pt] (6.0,-3.55)--(6.60,-4.3);
    
    \draw[draw=red, line width=3pt] (6.5,-3.55)--(7.1,-4.3);
    \draw[draw=red, line width=3pt] (6.63,-3.55)--(7.5,-4.3);
    %Lineas de corchea a semi corchea
    \draw[draw=red, line width=2pt] (4.40,-5.0)--(3.0,-5.8);
    \draw[draw=red, line width=2pt] (4.40,-5.0)--(3.5,-5.8);
    %Lineas de semi corchea a fusa
    \draw[draw=red, line width=1pt] (2.9,-6.67)--(-0.1,-7.3);
    \draw[draw=red, line width=1pt] (2.9,-6.67)--(0.3,-7.3);
    %Lineas de fusa a semi fusa
    \draw[draw=red, line width=1pt] (-0.15,-8.1)--(-3.4,-8.85);
    \draw[draw=red, line width=1pt] (-0.15,-8.1)--(-3.1,-8.85);
    
    \end{tikzpicture}
    



\end{document}


Return to “LaTeX Beginner's Guide”

Who is online

Users browsing this forum: No registered users and 3 guests