Hier ein erster Entwurf, wie man mit LaTeX Drum Patters setzen kann.
\documentclass[12pt,ngerman]{scrartcl}
\usepackage[margin=1cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% Define the pattern as a comma-separated list
\def\pattern{x,-,-,-,-,x,x,-,-,-,x,x,-,-,-,x}
\def\cellsizex{1cm}
\def\cellsizey{0.5cm}
\node[draw, rectangle,minimum width = \cellsizex, align=left,minimum height=\cellsizey] (a) at (\cellsizex/2,\cellsizey/2){\tiny 1};
% Loop through each character in the pattern
\foreach \cell [count=\index from 1] in \pattern {
% If 'x' fill the cell, otherwise leave it empty
\if\cell x
\fill[gray,draw=black] ({\index*\cellsizex}, 0) rectangle ++(\cellsizex, \cellsizey);
\else
\draw ({\index*\cellsizex}, 0) rectangle ++(\cellsizex, \cellsizey);
\fi
}
\end{tikzpicture}
See also: Original Source by Uwe Ziegenhagen
Note: The copyright belongs to the blog author and the blog. For the license, please see the linked original source blog.
Leave a Reply
You must be logged in to post a comment.