需要实现一个 Bass Drum、Ride、Hi-Hat、Snare、Clave、Cow Bell 的鼓谱,基本代码如下:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usepackage{amsmath}%Para signo igual
\usepackage{musicography}
\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
\begin{document}
\begin{music}
\font\A=phvb8t at 10pt% added for letter type.
\largemusicsize
\setlines{1}{5}
%\setclefsymbol{1}{\empty}%
\setclefsymbol{1}{\drumclef}%
\nobarnumbers
\nostartrule
\startextract
\NOtes\zql f\doqu m\en
\NOtes\doql d\ibu0m0\doqb0{m}\en
\NOtes\tbu0\doqb0m\en
\NOtes\qu j\en
\NOtes\dcqu j\en
\NOtes\roql j\en
\NOtes\tgql l\en
\endextract
\end{music}
\end{document}
答案1
这是我在 MusiXTeX 中提出的解决方案:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usepackage{amsmath}%Para signo igual
\usepackage{musicography}
\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
\begin{document}
\begin{music}
\hsize=140mm%
\font\A=phvb8t at 10pt% added for letter type.
\largemusicsize
\setlines{1}{5}
%\setclefsymbol{1}{\empty}%
\setclefsymbol{1}{\drumclef}%
\nobarnumbers
\nostartrule
% \startextract
\startpiece%
\addspace{0.5\afterruleskip}%
\notes\ccharnote J{\A ~Bass Drum}\ccharnote t{\A ~Ride}\zql f\doqu m\hsk\ccharnote J{\A ~Hi-Hat \it (foot)}\ccharnote t{~$\circ$}\ccharnote w{\it ~open}\ccharnote z{\hsk\qsk\A ~Hi-Hat}\doql d\bsk\ibu0m0\doqb0{m}\ccharnote u{~+}\ccharnote w{\it ~closed}\tbu0\doqb0m\ccharnote t{\A ~Snare}\qu j\ccharnote w{\A ~Snare}\ccharnote t{\A ~rimshot}\dcqu j\ccharnote t{\A ~Clave}\roql j\ccharnote t{\A Cow Bell}\tgql l\en\setdoublebar%
\endpiece%
\end{music}%
\end{document}%
答案2
解决的代码如下:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usepackage{amsmath}%Para signo igual
\usepackage{musicography}
\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
\begin{document}
\begin{music}
\font\A=phvb8t at 10pt% added for letter type.
\largemusicsize
\setlines{1}{5}
%\setclefsymbol{1}{\empty}%
\setclefsymbol{1}{\drumclef}%
\nobarnumbers
\nostartrule
\startextract
\NOTes\zcharnote{-12}{\textbf\small \hspace*{-1.1cm} Bass Drum}\zql f\doqu m\zcharnote{17}{\textbf\small \hspace*{-1.6cm} Ride}\en
\znotes\hsk\doql d\en
\NOTes\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $\circ$}\ibu0m0\doqb0{m}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $+$}\en
\NOTes\tbu0\doqb0m\en
\NOTes\qu j\en
\NOTes\dcqu j\en
\NOTes\roql j\en
\NOTes\tgql l\en
\endextract
\end{music}
\end{document}
我认为有一种使用带有注释库的 Tikz 添加标签的简单方法。三角形也需要填充。
输出如下:
答案3
这是使用 tikzmark 添加文本的另一种方法。解决的代码需要在 pic cs 内进行额外的水平和垂直移位:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usetikzlibrary{tikzmark}
\usetikzlibrary{positioning}
\NewDocumentCommand{\addU}{mm}{\tikz[remember picture]{\node[overlay,above=of pic cs:#1]{#2};}}
\NewDocumentCommand{\addB}{mm}{\tikz[remember picture]{\node[overlay,below=of pic cs:#1]{#2};}}
\usepackage{amsmath}%Para signo igual
\usepackage{musicography}
\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
\begin{document}
\begin{music}
\font\A=phvb8t at 10pt% added for letter type.
\largemusicsize
\setlines{1}{5}
\setclefsymbol{1}{\drumclef}%
\nobarnumbers
\nostartrule
\startextract
\NOTes\tikzmark{BD}\zql f\tikzmark{R}\doqu m\en
\znotes\hsk\tikzmark{HH}\doql d\en
\NOTes\tikzmark{HHH}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $\circ$}\ibu0m0\doqb0{m}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $+$}\en
\NOTes\tbu0\doqb0m\en
\NOTes\tikzmark{S}\qu j\en
\NOTes\tikzmark{SR}\dcqu j\en
\NOTes\tikzmark{C}\roql j\en
\NOTes\tikzmark{CB}\tgql l\en
\endextract
\end{music}
\addU{R}{Ride}
\addU{S}{Snare}
\addU{HHH}{Hi-Hat}
\addB{BD}{Bass Drum}
\addB{HH}{Hi-Hat (foot)}
%\addU{SR}{Snare\\rimshot}
\addU{C}{Clave}
\addU{CB}{Cow Bell}
\end{document}
欢迎提供一些关于如何在图片 cs:#1 上添加额外移位的帮助!!!
答案4
解决的代码如下:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usetikzlibrary{calc}
\usetikzlibrary{tikzmark}
\usetikzlibrary{positioning}
\NewDocumentCommand{\addU}{mm}{\tikz[remember picture]{\node[overlay,above=10mm of pic cs:#1]{#2};}}
\NewDocumentCommand{\addUH}{mm}{\tikz[remember picture]{\node[overlay,above=14mm of pic cs:#1]{#2};}}
\NewDocumentCommand{\addUHH}{mm}{\tikz[remember picture]{\node[overlay,above=18mm of pic cs:#1]{#2};}}
\NewDocumentCommand{\addUHHH}{mm}{\tikz[remember picture]{\node[overlay] at ($(pic cs:#1)+(0.85cm,2.2cm)$) {#2};}}
\NewDocumentCommand{\addB}{mm}{\tikz[remember picture]{\node[overlay,below=of pic cs:#1]{#2};}}
\NewDocumentCommand{\addBB}{mm}{\tikz[remember picture]{\node[overlay,below=14mm of pic cs:#1]{#2};}}
\usepackage{amsmath}%Para signo igual
\usepackage{musixtex}
\input {musixfll}
\input {musixper}%percusión
\begin{document}
\begin{music}
\font\A=phvb8t at 10pt% added for letter type.
\largemusicsize
\setlines{1}{5}
\setclefsymbol{1}{\drumclef}%
\nobarnumbers
\nostartrule
\startextract
\NOTes\tikzmark{BD}\zql f\tikzmark{R}\doqu m\en
\znotes\hsk\tikzmark{HH}\doql d\en
\NOTes\tikzmark{HHH}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $\circ$}\ibu0m0\doqb0{m}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $+$}\en
\NOTes\tbu0\doqb0m\en
\NOTes\tikzmark{S}\qu j\hsk\en
\NOTes\tikzmark{SR}\dcqu j\hsk\en
\NOTEs\tikzmark{C}\roql j\hsk\en
\NOTEs\tikzmark{CB}\tgql l\en
\endextract
\end{music}
\addUH{R}{Ride}
\addUH{S}{Snare}
\addUHHH{HHH}{Hi-Hat}
\addB{BD}{Bass Drum}
\addBB{HH}{Hi-Hat (foot)}
\addUH{SR}{Snare\newline rimshot}
\addU{C}{Clave}
\addU{CB}{Cow Bell}
\end{document}
它剩余命令的换行符:\addUH{SR}{Snare\newline rimshot} 欢迎提供一些帮助!!!