Re: Simboli musicali come fosse matematica

#88908
Up
0
Down
::

logos” post=88320Ciao a tutti,

Per una dispensa che sto scrivendo avrei bisogno di inserire nel testo simboli musicali (le tre chiavi, i simboli dei valori, quelli delle pause) ed attualmente riesco a farlo in modo un po’ rocambolesco con i font di musixtex. D’altra parte, dovendo anche inserire frammenti di spartito, utilizzo lilypond-book e quindi i font di lilypond, con un conseguente guazzabuglio di font differenti.

Vorrei dunque crearmi un pacchetto di comandi che inseriscono i simboli, un po’ come si fa con amsmath per la matematica, ma non saprei come fare. Anzitutto vorrei usare i font di lilypond, ma non so quali siano né se pdflatex li può usare. Inoltre vorrei creare comandi tipo \clef{G} per la chiave di violino, \clef{F} per quella di basso ecc. in formato ridotto perché nel testo non diano troppo fastidio all’interlinea. Di fatto i comandi sono tre: uno per le chiavi, uno per i valori e uno per le pause, con gli argomenti per il tipo di valore (per esempio \note{1}{4} per la semiminima). Qualcuno di voi può darmi dei suggerimenti di come posso fare?

Ciao e grazie,

Andrea

Concordo con il nostro amico:

http://www.openlilylib.org/public/manuals/lilyglyphs_0-2-1.pdf

Urs Liska, autore del pacchetto, a breve lo caricherà su CTAN. Qualche avvertimento: il pacchetto funziona solo con XeLaTeX, dato che i font Emmentaler sono OpenType. Anch’io sto scrivendo qualcosa con [tt]lilypond-book[/tt] e ho dovuto fare qualche giochetto, perché quest’ultimo funziona solo con pdfLaTeX 🙁

Ti serve visitare anche questo:

https://github.com/openlilylib/lilyglyphs

Ma non è ancora tutto facile. Ho dovuto compormi io il file [tt].sty[/tt] per farlo funzionare… Guarda anche

http://lists.gnu.org/archive/html/lilypond-user/2013-09/msg00036.html

Tanto per capirci, il mio preambolo è il seguente:

`% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = LilyPond-Book
% !LILYPOND tex = xelatex

\documentclass[…]{…}

% pacchetti specifici di xetex
\usepackage{ifxetex}
\ifxetex
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{…}
\setsansfont[Scale=MatchLowercase]{…}
\usepackage{polyglossia}
\setmainlanguage{italian}
\setotherlanguages{english,french,german}
\usepackage{lilyglyphs}
\else
\fi

% pacchetti comuni a xetex e pdftex
\usepackage{graphicx}
\graphicspath{{immagini/}}
\captionsetup{font={rm,it,small},justification=centering}
\usepackage{subfig}
\usepackage[italian]{varioref}
\usepackage[output-decimal-marker={,},detect-all]{siunitx}
\usepackage[hidelinks]{hyperref}

% nuovi comandi
\newcommand{\bemolle}{\ifxetex\,\lilyGlyph[scale=1.3,raise=0.5]{accidentals.flat}\else\fi} % si usa così: si\bemolle{}
\newcommand{\diesis}{\ifxetex\,\lilyGlyph[scale=1.1,raise=0.6]{accidentals.sharp}\else\fi} % si usa così: do\diesis{}
\newcommand{\naturale}{\ifxetex\,\lilyGlyph[scale=1.2,raise=0.6]{accidentals.natural}\else\fi} % si usa così: mi\naturale{}
\newcommand{\ditoi}[1]{\ifxetex\lilyText[scale=1,raise=-0.05]{#1}\else\fi} % per diteggiature del tipo: 1
\newcommand{\ditoii}[2]{\ifxetex\lilyText[scale=1,raise=-0.05]{#1}-\lilyText[scale=1,raise=-0.05]{#2}\else\fi} % per diteggiature del tipo: 1-2
\newcommand{\ditoiii}[3]{\ifxetex\lilyText[scale=1,raise=-0.05]{#1}-\lilyText[scale=1,raise=-0.05]{#2}-\lilyText[scale=1,raise=-0.05]{#3}\else\fi} % […]: 1-2-3
\newcommand{\betweenLilyPondSystem}[1]{\vspace{5mm}\linebreak} % aggiunge spazio tra i pentagrammi creati con lilypond-book
\def\preLilyPondExample{\begin{center}} % inserisce l'ambiente lilipond a propria volta in un ambiente center per distanziare decentemente la musica dal testo
\def\postLilyPondExample{\end{center}} % vedi sopra

% comincia il documento
\begin{document}

% finisce il documento
\end{document}
`

Analogamente ti puoi creare altri comandi. Copia il seguente codice nel tuo editor e salvalo come [tt]lilyglyphs.sty[/tt]:
`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This file is part of the 'lilyglyphs' LaTeX package. %
% ========== %
% %
% https://github.com/uliska/lilyglyphs %
% %
% Copyright 2012 by Urs Liska, git@ursliska.de %
% %
% 'lilyglyphs' is free software: you can redistribute it and/or modify %
% it under the terms of the GNU General Public License as published by %
% the Free Software Foundation, either version 3 of the License, or %
% (at your option) any later version. %
% %
% This program is distributed in the hope that it will be useful, %
% but WITHOUT ANY WARRANTY; without even the implied warranty of %
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% GNU General Public License for more details. %
% %
% You should have received a copy of the GNU General Public License %
% along with this program. If not, see <http://www.gnu.org/licenses/>. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lilyglyphs}

% Enable the creation of starred commands
\RequirePackage{suffix}

% Access OpenTypeFonts
\RequirePackage{fontspec}

% Introduce key=value options
\RequirePackage{keyval}

% Necessary for calculations.
% Is that really necessary or can it be achieved much cheaper?
% OTOH I assume that we will use tikz/pgf anyway.
\RequirePackage{pgf}

% Create a vertically stacked box (time signatures)
\RequirePackage[export]{adjustbox}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% select from the optical sizes fonts
\def\lilyOpticalSuffix{16}
\newcommand{\lilyOpticalSize}[1]{\def\lilyOpticalSuffix{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% include the functionality for the key=value options
\makeatletter
\define@key{lilyDesignOptions}{scale}{\def\lilyDesignOptions@scale{#1}}
\define@key{lilyDesignOptions}{raise}{\def\lilyDesignOptions@raise{#1}}
\define@key{lilyGlobalOptions}{scale}{\def\lilyGlobalOptions@scale{#1}}
\define@key{lilyGlobalOptions}{raise}{\def\lilyGlobalOptions@raise{#1}}
\def\lilyGlobalOptions@scale{1}
\def\lilyGlobalOptions@raise{0}
\newcommand*{\lilyGlobalOptions}[1]{\setkeys{lilyGlobalOptions}{#1}}
\define@key{lilyCmdOptions}{scale}{\def\lilyCmdOptions@scale{#1}}
\define@key{lilyCmdOptions}{raise}{\def\lilyCmdOptions@raise{#1}}
\newcommand*{\interpretLilyOptions}[1]{%
% initialize user arguments (no argument = no change)
% in order to avoid uninitialized arguments
\setkeys{lilyCmdOptions}{scale=1,raise=0}%
% Options that are present override the defaults
\setkeys{lilyCmdOptions}{#1}%
% calculate the scaling factor
\pgfmathsetmacro{\lilyEffectiveScale}{%
\lilyGlobalOptions@scale * \lilyCmdOptions@scale * \lilyDesignOptions@scale}%
% calculate the raise level from the design value and the optional user value
\pgfmathsetmacro{\lilyEffectiveRaise}{%
\lilyGlobalOptions@raise + \lilyCmdOptions@raise + \lilyDesignOptions@raise}%
}
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% include the basic functionality to select and print glyphs
\newcommand*{\lilyPrint}[2][]{%
% interpret optional argument
\interpretLilyOptions{#1}%
% print the glyph in a raisebox
\raisebox{\lilyEffectiveRaise ex}{%
{\fontspec[Scale=\lilyEffectiveScale]{Emmentaler-\lilyOpticalSuffix}#2}%
}%
}

\makeatletter
\newcommand*{\currentFontRatio}{%
% store point size of current font
\xdef\currentFontSize{\f@size}%
{%
% Temporarily switch to normal size
\normalsize%
% and store normal point size
\xdef\normalFontSize{\f@size}%
}%
% Calculate ratio and store the value
\pgfmathsetmacro{\getCurrentFontRatio}{%
\currentFontSize / \normalFontSize}%
}
\makeatother

\newcommand*{\lilyScaleImage}{%
\currentFontRatio%
\pgfmathsetmacro{\lilyImageEffectiveScale}{%
\lilyEffectiveScale * \getCurrentFontRatio}%
}

\newcommand*{\lilyPrintImage}[2][]{%
% interpret optional argument
\interpretLilyOptions{#1}%
% determine scaling factor to accomodate the current font size
% (as images don't scale automatically with the font)
\lilyScaleImage%
% Print the image in a raisebox
\raisebox{\lilyEffectiveRaise ex}{%
\includegraphics[scale=\lilyImageEffectiveScale]{#2.pdf}%
}%
}

\usepackage{ifluatex,ifxetex}

\ifluatex
\usepackage{luaotfload,luacode}
\begin{luacode}
documentdata = documentdata or { }

local stringformat = string.format
local texsprint = tex.sprint
local slot_of_name = luaotfload.aux.slot_of_name

documentdata.fontchar = function (chr)
local chr = slot_of_name(font.current(), chr, false)
if chr and type(chr) == “number” then
texsprint
(stringformat ([[\char”%X”]], chr))
end
end
\end{luacode}

\def\lilyGetGlyph#1{\directlua{documentdata.fontchar “#1″}}
\fi

\ifxetex
\newcommand*{\lilyGetGlyph}[1]{\XeTeXglyph\XeTeXglyphindex”#1” }
\fi

\newcommand*{\lilyGetGlyphByNumber}[1]{\char”#1 }

\newcommand*{\lilyGlyph}[2][]{%
% set defaults
\setkeys{lilyDesignOptions}{scale=1,raise=0}%
\lilyPrint[#1]{\lilyGetGlyph{#2}}%
}

\newcommand*{\lilyGlyphByNumber}[2][]{%
% set defaults
\setkeys{lilyDesignOptions}{scale=1,raise=0}%
\lilyPrint[#1]{\lilyGetGlyphByNumber{#2}}%
}

\newcommand*{\lilyText}[2][]{%
% set defaults
\setkeys{lilyDesignOptions}{scale=1,raise=0}%
\lilyPrint[#1]{#2}%
}

\newcommand*{\lilyImage}[2][]{%
% set defaults
\setkeys{lilyDesignOptions}{scale=1, raise=0}%
% interpret optional argument
\interpretLilyOptions{#1}%
\raisebox{\lilyEffectiveRaise ex}{%
\includegraphics[scale=\lilyEffectiveScale]{#2}%
}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% include logic and functionality to create dotted symbols
\newcommand*{\lilyDot}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0}%
\lilyPrint[#1]{\lilyGetGlyph{dots.dot}}%
}

\makeatletter
\newcommand*{\lilyCalcDotSpace}[4]{%
\pgfmathsetmacro{\lilyDotSpaceF}{%
#1 * #1% x^2
* #2 – #2%
+ #1 * #3 – #3 + #4}%
}
\newcommand*{\lilySetDotOptions}[4][]{%
% Initialize the user's command option in case he didn't provide them
\setkeys{lilyCmdOptions}{scale=1,raise=0}%
% process the optional argument to access the values
\setkeys{lilyCmdOptions}{#1}%
% calculate optional arguments for the dot,
% based on “design options” and the given arguments
\pgfmathsetmacro{\lilyDotScale}{\lilyCmdOptions@scale * \lilyDesignOptions@scale}%
\pgfmathsetmacro{\lilyDotRaise}{\lilyCmdOptions@raise + \lilyDesignOptions@raise}%
% calculate the space between the rest and the dot
\lilyCalcDotSpace{\lilyCmdOptions@scale}{#2}{#3}{#4}%
}
\makeatother

\newcommand*{\lilyDotSpace}{\hspace*{\lilyDotSpaceF ex}}

\newcommand*{\lilyPrintDot}{\lilyDot[raise=\lilyDotRaise,scale=\lilyDotScale]}

\newcommand*{\lilyPrintMoreDots}[1][0.25]{%
\hspace*{#1 ex}\lilyPrintDot%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definitions of the glyphs in groups
% corresponding to the glyph list in the LilyPond docs

%%%%%%%%%%%%%%
% \treble clef
\newcommand*{\clefG}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.2,raise=0.25}%
\lilyPrint[#1]{\lilyGetGlyph{clefs.G}}%
}

\newcommand*{\clefGInline}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.8,raise=0.15}%
\lilyPrint[#1]{\lilyGetGlyph{clefs.G}}%
}

%%%%%%%%%%%%
% \bass clef
\newcommand*{\clefF}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.4,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{clefs.F}}%
}

\newcommand*{\clefFInline}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.1,raise=0.65}%
\lilyPrint[#1]{\lilyGetGlyph{clefs.F}}%
}

%%%%%%%%%%%%
% \alto clef
\newcommand*{\clefC}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.1,raise=0.6}%
\lilyPrint[#1]{\lilyGetGlyph{clefs.C}}%
}

\newcommand*{\clefCInline}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.9,raise=0.6}%
\lilyPrint[#1]{\lilyGetGlyph{clefs.C}}%
}

%\input{commands/numbers.inp}

% \time 4/4
\newcommand*{\lilyTimeC}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.4,raise=0.7}%
\lilyPrint[#1]{\lilyGetGlyph{timesig.C44}}%
}

% \time 2/2
\newcommand*{\lilyTimeCHalf}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.4,raise=0.7}%
\lilyPrint[#1]{\lilyGetGlyph{timesig.C22}}%
}

% general \time n/m command (prints time signature as a fraction in emmentaler font)
% doesn't need curly braces after it
\newcommand*{\lilyTimeSignature}[3][]{%
\setkeys{lilyDesignOptions}{scale=1.1,raise=0}%
\setkeys{lilyCmdOptions}{#1}%
\adjustbox{stack=cc}{%
\baselineskip=0pt%
\lilyPrint[#1]{#2}\\%
\lilyPrint[#1]{#3}\par}%
}

\newcommand{\lilyDynamics}[2][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0}%
\lilyPrint[#1]{#2}%
}

\newcommand{\lilyRF}[1][]{%
\mbox{\lilyDynamics[#1]{r\hspace{0.035ex}f}}%
}

\newcommand{\lilyRFZ}[1][]{%
\mbox{\lilyDynamics[#1]{r\hspace{0.035ex}fz}}%
}

\newcommand*{\decrescHairpin}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.9,raise=0}%
\lilyPrintImage[#1]{decrescHairpin}%
}

\newcommand*{\crescHairpin}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.9,raise=0}%
\lilyPrintImage[#1]{crescHairpin}%
}

%%%%%%%%%%%%%%%
% Accidentals %
%%%%%%%%%%%%%%%

% “accidentals.natural”
\renewcommand*{\natural}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.natural}}%
}

%%%%%%%%
% flats
%%%%%%%%

% “accidentals.flat”
\renewcommand*{\flat}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.2}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.flat}}%
}

% “accidentals.flatflat”
\newcommand*{\flatflat}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.2}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.flatflat}}%
}

%%%%%%%%
% sharps
%%%%%%%%

% “accidentals.sharp”
\renewcommand*{\sharp}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp}}%
}

% “accidentals.sharp.arrowup”
\newcommand*{\sharpArrowup}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp.arrowup}}%
}

% “accidentals.sharp.arrowdown”
\newcommand*{\sharpArrowdown}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp.arrowdown}}%
}

% “accidentals.sharp.arrowboth”
\newcommand*{\sharpArrowboth}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp.arrowboth}}%
}

% “accidentals.sharp.slashslash.stem”
\newcommand*{\sharpSlashslashStem}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp.slashslash.stem}}%
}

% “accidentals.sharp.slashslashslash.stemstem”
\newcommand*{\sharpSlashslashslashStemstem}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp.slashslashslash.stemstem}}%
}

% “accidentals.sharp.slashslashslash.stem”
\newcommand*{\sharpSlashslashslashStem}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp.slashslashslash.stem}}%
}

% “accidentals.sharp.slashslash.stemstemstem”
\newcommand*{\sharpSlashslashStemstemstem}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.sharp.slashslash.stemstemstem}}%
}

% “accidentals.doublesharp”
\newcommand*{\doublesharp}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.5,raise=0.35}%
\lilyPrint[#1]{\lilyGetGlyph{accidentals.doublesharp}}%
}

%\input{commands/noteheads.inp}

% “rests.1o – half note rest upwards”
\newcommand*{\wholeNoteRest}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.3,raise=0.4}%
\lilyPrint[#1]{\hspace*{0.25ex}\lilyGetGlyph{rests.0o}}%
}

% Dotted half note rest
\newcommand*{\wholeNoteRestDotted}[1][]{%
% define the optional arguments for the dot
\setkeys{lilyDesignOptions}{scale=0.8,raise=0.2}%
% Calculate effective scale/raise and the hspace for the dot
\lilySetDotOptions[#1]{0}{0.5}{0.4}%
% Print the rest and then the dot
\wholeNoteRest[#1]\lilyDotSpace\lilyPrintDot
}

%%%%%%%%%%%%%%%%%
% Half note rests
%%%%%%%%%%%%%%%%%

% “rests.1o – half note rest upwards”
\newcommand*{\halfNoteRest}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.3,raise=0.4}%
\lilyPrint[#1]{\hspace*{0.25ex}\lilyGetGlyph{rests.1o}}%
}

% Dotted half note rest
\newcommand*{\halfNoteRestDotted}[1][]{%
% define the optional arguments for the dot
\setkeys{lilyDesignOptions}{scale=0.8,raise=0.2}%
% Calculate effective scale/raise and the hspace for the dot
\lilySetDotOptions[#1]{0}{0.5}{0.4}%
% Print the rest and then the dot
\halfNoteRest[#1]\lilyDotSpace\lilyPrintDot
}

%%%%%%%%%%%%%%%%%
% Crotchet Rests
%%%%%%%%%%%%%%%%%

% Crotchet Rest
\newcommand*{\crotchetRest}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.3,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{rests.2}}%
}

% Dotted crotched rest
\newcommand*{\crotchetRestDotted}[1][]{%
% define the optional arguments for the dot
\setkeys{lilyDesignOptions}{scale=0.8,raise=0.2}%
% Calculate effective scale/raise and the hspace for the dot
\lilySetDotOptions[#1]{0}{0}{-0.5}%
% Print the rest and then the dot
\crotchetRest[#1]\lilyPrintDot%
}

%%%%%%%%%%%%%%%
% Quaver Rests
%%%%%%%%%%%%%%%

% Quaver Rest
\newcommand*{\quaverRest}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.3,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{rests.3}}%
}

% Dotted crotched rest
\newcommand*{\quaverRestDotted}[1][]{%
% define the optional arguments for the dot
\setkeys{lilyDesignOptions}{scale=0.8,raise=0.2}%
% Calculate effective scale/raise and the hspace for the dot
\lilySetDotOptions[#1]{0}{0}{-0.5}%
% Print the rest and then the dot
\quaverRest[#1]\lilyPrintDot%
}

%%%%%%%%%%%%%%%%%%
% Semiquaver Rests
%%%%%%%%%%%%%%%%%%

% Semiquaver Rest
\newcommand*{\semiquaverRest}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.3,raise=0.5}%
\lilyPrint[#1]{\lilyGetGlyph{rests.4}}%
}

% Dotted crotchet rest
\newcommand*{\semiquaverRestDotted}[1][]{%
% define the optional arguments for the dot
\setkeys{lilyDesignOptions}{scale=0.8,raise=0.2}%
% Calculate effective scale/raise and the hspace for the dot
\lilySetDotOptions[#1]{0}{0}{-0.3}%
% Print the rest and then the dot
\semiquaverRest[#1]\lilyPrintDot%
}

% “scripts.ufermata”
\newcommand*{\fermata}[1][]{%
\setkeys{lilyDesignOptions}{scale=1.2,raise=0.5}%
\lilyPrint[#1]{\hspace*{0.55ex}\lilyGetGlyph{scripts.ufermata}}%
}

% Definitions of complex glyphs created with LilyPond
% and included as image files

%%%%%%%%%%%
% crotchets

% crotchet with upward stem
% created by buildglyphimages.py on 2012-11-06
\newcommand*{\crotchet}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.2}%
\lilyPrintImage[#1]{crotchet}%
}

% crotchet with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\crotchetDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{crotchetDown}%
}

% dotted crotchet with upward stem
% created by buildglyphimages.py on 2012-11-07
\newcommand*{\crotchetDotted}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.2}%
\lilyPrintImage[#1]{crotchetDotted}%
}

% dotted crotchet with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\crotchetDottedDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{crotchetDottedDown}%
}

% doubledotted crotchet with upward stem
% created by buildglyphimages.py on 2012-11-08
\newcommand*{\crotchetDottedDouble}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.2}%
\lilyPrintImage[#1]{crotchetDottedDouble}%
}

% doubledotted crotchet with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\crotchetDottedDoubleDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{crotchetDottedDoubleDown}%
}

%%%%%%%%%%%%
% half notes

% half note with upward stem
% created by buildglyphimages.py on 2012-11-06
\newcommand*{\halfNote}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.2}%
\lilyPrintImage[#1]{halfNote}%
}

% half note with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\halfNoteDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{halfNoteDown}%
}

% dotted half note with upward stem
% created by buildglyphimages.py on 2012-11-07
\newcommand*{\halfNoteDotted}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.2}%
\lilyPrintImage[#1]{halfNoteDotted}%
}

% dotted half note with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\halfNoteDottedDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{halfNoteDottedDown}%
}

% doubledotted half note with upward stem
% created by buildglyphimages.py on 2012-11-08
\newcommand*{\halfNoteDottedDouble}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.2}%
\lilyPrintImage[#1]{halfNoteDottedDouble}%
}

% doubledotted half note with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\halfNoteDottedDoubleDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{halfNoteDottedDoubleDown}%
}

%%%%%%%%%
% quavers

% quaver with upward stem
% created by buildglyphimages.py on 2012-11-06
\newcommand*{\quaver}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.25}%
\lilyPrintImage[#1]{quaver}%
\hspace*{-0.5ex}%
}

% quaver with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\quaverDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{quaverDown}%
}

% dotted quaver with upward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\quaverDotted}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{quaverDotted}%
}

% dotted quaver with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\quaverDottedDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{quaverDottedDown}%
}

% doubledotted quaver with upward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\quaverDottedDouble}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{quaverDottedDouble}%
}

% doubledotted quaver with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\quaverDottedDoubleDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{quaverDottedDoubleDown}%
}

%%%%%%%%%%%%%
% semiquavers

% semiquaver with upward stem
% created by buildglyphimages.py on 2012-11-06
\newcommand*{\semiquaver}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.1}%
\lilyPrintImage[#1]{semiquaver}%
\hspace*{-0.4ex}%
}

% semiquaver with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\semiquaverDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{semiquaverDown}%
}

% dotted semiquaver with upward stem
% created by buildglyphimages.py on 2012-11-07
\newcommand*{\semiquaverDotted}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.1}%
\lilyPrintImage[#1]{semiquaverDotted}%
}

% dotted semiquaver with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\semiquaverDottedDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{semiquaverDottedDown}%
}

% doubledotted semiquaver with upward stem
% created by buildglyphimages.py on 2012-11-08
\newcommand*{\semiquaverDottedDouble}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.1}%
\lilyPrintImage[#1]{semiquaverDottedDouble}%
}

% doubledotted semiquaver with downward stem
% created by buildglyphimages.py on 2012-11-13
\newcommand*{\semiquaverDottedDoubleDown}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.75,raise=-0.4}%
\lilyPrintImage[#1]{semiquaverDottedDoubleDown}%
}

%%%%%%%%%%%%%%%%
% Beamed notes %
%%%%%%%%%%%%%%%%

%——————————
% Two notes connected by a beam

% two beamed quavers with diagonal beam
% created by buildglyphimages.py on 2012-11-08
\newcommand*{\twoBeamedQuavers}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.7,raise=-0.4}%
\lilyPrintImage[#1]{twoBeamedQuavers}%
}

% lilyglyphs logo to be used in texts about lilyglyphs
% created by genGlyphCommands.py on 2012-11-10
\newcommand*{\lilyglyphsBase}[1][]{%
\setkeys{lilyDesignOptions}{scale=0.9,raise=-0.8}%
\lilyPrintImage[#1]{lilyglyphs_logo}%
}
\newcommand*{\lilyglyphs}[1][]{\lilyglyphsBase[#1] }
\WithSuffix\newcommand\lilyglyphs*[1][]{\lilyglyphsBase[#1]}`

Poi metti il file nella tua cartella di lavoro. Nella stessa cartella copia le immagini in formato PDF che trovi qui:

https://github.com/openlilylib/lilyglyphs/tree/master/glyphimages/pdfs

E leggi la documentazione 🙂 A me funziona.

Dimenticavo! Devi mettere i font emmentaler in un posto dove xetex possa vederli. Io li ho installati con FontBook molto semplicemente. Non so su quale sistema operativo tu lavori. Trovi i font qui (sono i file con estensione [tt].otf[/tt]):

https://github.com/openlilylib/lilyglyphs/tree/master/fonts

Ciao
Tommaso

Go to top