<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
%
% Copyright (cc) 2020 by Thomas Nicholson
%
% This work is licensed under the Creative Commons Attribution 4.0 International License. 
% To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or 
% send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
%
%
% \fi

% \iffalse
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}[2005-12-01]
%&lt;package&gt;\ProvidesPackage{helmholtz-ellis-ji-notation}[2020-05-19 v1.1]

%&lt;*driver&gt;
\documentclass[a4paper, 10pt]{ltxdoc}
\usepackage{helmholtz-ellis-ji-notation}
\usepackage{hologo}
\usepackage{makecell}
\usepackage{microtype}
\usepackage[all]{nowidow}
\usepackage{longtable}
\usepackage{fontspec}
\DisableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
	\DocInput{helmholtz-ellis-ji-notation.dtx}
\end{document}
%&lt;/driver&gt;
% \fi
%
% \CheckSum{200}
%
% \changes{v1.0}{2019-12-09}{Initial version}
%
% \GetFileInfo{helmholtz-ellis-ji-notation.sty}
%
% \title{The \textsf{helmholtz-ellis-ji-notation} package\thanks{This document corresponds to \textsf{helmholtz-ellis-ji-notation} v1.1, dated 2020-05-19.}}
% \author{Thomas Nicholson \\ \texttt{thomas@thomasnicholson.ca}}
% 
%
% \maketitle
%
% \section{Introduction}
% The Helmholtz-Ellis JI Pitch~Notation~(HEJI), devised in the early 2000s by Marc~Sabat and Wolfgang~von~Schweinitz, explicitly notates the raising and lowering of the \textit{untempered} diatonic Pythagorean notes by specific microtonal ratios defined for each prime. It provides visually distinctive ``logos'' distinguishing families of justly tuned intervals that relate to the harmonic series. These take the form of strings of additional accidental symbols based on historical precedents, extending the traditional sharps and flats. Since its 2020 update, HEJI~ver.~2 (``HEJI2'') provides unique microtonal symbols through the 47-limit. 
%
% The \textsf{helmholtz-ellis-ji-notation} package is a simple \hologo{LaTeX} implementation of HEJI2 that allows for in-line typesetting of microtonal accidentals for use within theoretical texts, program notes, symbol legends, etc. 
%
% \section{Compatibility}
% Documents must be compiled using the \hologo{XeLaTeX} engine.
% 
% \section{Installation}
% Insall the package either through your \hologo{TeX} distribution (TeXLive, MiKTeX) or by manually insalling the |helmholtz-ellis-ji-notation.ins| file (e.g. run |latex helmholtz-ellis-ji-notation.ins| in Command Prompt) and compiling |helmholtz-ellis-ji-notation.dtx| using \hologo{XeLaTeX} to create the latest version of this documentation. Include the package 
%
% \vspace{3mm}
% |\usepackage|\oarg{option}|{helmholtz-ellis-ji-notation}|  
% \vspace{3mm}
% 
% \noindent
% in your document preamble. You must also install the |HEJI2Text.otf| font file and verify that it appears in your system's system font directory.
%
% \newpage
% \section{Usage}
% The \textsf{helmholtz-ellis-ji-notation} package provides the general \DescribeMacro{heji}|\heji| macro for typesetting microtones. It takes two arguments.
%
% \vspace{3mm}
% |\heji|\marg{note}\marg{string}
% \vspace{3mm}
%
% \noindent
% The first argument, \DescribeMacro{note}\marg{note}, corresponds to the desired diatonic pitch name (\textit{e.g.}~A--G, do--ti) and is typeset in the document's default body font. The second argument, \DescribeMacro{string}\marg{string}, corresponds to the appropriate character mapping of the desired accidental (combination) within the |HEJI2Text.otf| file \textbf{or} the appropriate string of \textit{accidental macros} (see table in section~5). For example, the pitch 7/4 above \heji{C}{\nat} may be typeset by writing either |\heji{B}{&lt;e}| or |\heji{B}{\otonalseven\flat}| to produce \heji{B}{\otonalseven\flat}. By default, tones are displayed in note--accidental format. Including the \DescribeMacro{accfirst option}option |accfirst| when loading the package reverses the order of elements to accidental--note format. To print an accidental on its own, use the macro \DescribeMacro{acc}|\acc|\marg{string}.
%
% The stand-alone macros \DescribeMacro{otonal, utonal}|\otonal| and |\utonal| may be used when describing partials of harmonic and subharmonic series, e.g. |15\otonal\| for 15\otonal\ and |\utonal 7| for \utonal 7. Note the extra backslash when the |\otonal| macro is used. This is required because \hologo{LaTeX} ignores spaces immediately following these macros (which is why a space \textit{is}, confusingly, inserted after |\utonal| in order to \textit{adjoin} it to the following digit). Including a backslash on the tail of |\otonal| \textit{forces} a space after the symbol is printed. If no space is desired (e.g. if the symbol is followed by a period or a comma) then the trailing backslash may, of course, be omitted.
%
% \section{Accidental macros \&amp; font mappings}
%
% \setlength{\extrarowheight}{3pt}
% \begin{longtable}{ccc}
%	\textbf{Notation} &amp; \textbf{Accidental macro} &amp; \textbf{Font mapping} \\
%	\hline
%	\endfirsthead
%	\multicolumn{3}{l}{\textbf{Accidental macros \&amp; font mappings} -- \textit{cont'd from previous page}} \\
%	\textbf{Notation} &amp; \textbf{Accidental macro} &amp; \textbf{Font mapping} \\
%	\hline
%	\endhead
%   \multicolumn{3}{r}{\textit{cont'd on next page}} \\
%	\endfoot
%	\endlastfoot
%	\heji{}{\tempflatflat} &amp; |\tempflatflat| &amp; |A| \\
%	\heji{}{\tempflat} &amp; |\tempflat| &amp; |a| \\
%	\heji{}{\tempnat} &amp; |\tempnat| &amp; |j| \\
%	\heji{}{\tempsharp} &amp; |\tempsharp| &amp; |z| \\
%	\heji{}{\tempsharpsharp} &amp; |\tempsharpsharp| &amp; |Z| \\
%	\hline
%   \heji{}{\flatflat} &amp; |\flatflat| &amp; |E| \\
%   \heji{}{\flat} &amp; |\flat| &amp; |e| \\
%   \heji{}{\nat} &amp; |\nat| &amp; |n| \\
%   \heji{}{\sharp} &amp; |\sharp| &amp; |v| \\
%   \heji{}{\sharpsharp} &amp; |\sharpsharp| &amp; |V| \\
%   \hline
%	\heji{}{\otonalsixtwentyfiveflatflat} &amp; |\otonalsixtwentyfiveflatflat| &amp; |I| \\
%	\heji{}{\otonalsixtwentyfiveflat} &amp; |\otonalsixtwentyfiveflat| &amp; |K| \\
%	\heji{}{\otonalsixtwentyfivenat} &amp; |\otonalsixtwentyfivenat| &amp; |M| \\
%	\heji{}{\otonalsixtwentyfivesharp} &amp; |\otonalsixtwentyfivesharp| &amp; |O| \\
%	\heji{}{\otonalsixtwentyfivesharpsharp} &amp; |\otonalsixtwentyfivesharpsharp| &amp; |R| \\
%   \heji{}{\otonalonetwentyfiveflatflat} &amp; |\otonalonetwentyfiveflatflat| &amp; |B| \\
%   \heji{}{\otonalonetwentyfiveflat} &amp; |\otonalonetwentyfiveflat| &amp; |b| \\
%   \heji{}{\otonalonetwentyfivenat} &amp; |\otonalonetwentyfivenat| &amp; |k| \\
%   \heji{}{\otonalonetwentyfivesharp} &amp; |\otonalonetwentyfivesharp| &amp; |s| \\
%   \heji{}{\otonalonetwentyfivesharpsharp} &amp; |\otonalonetwentyfivesharpsharp| &amp; |S| \\
%   \heji{}{\otonaltwentyfiveflatflat} &amp; |\otonaltwentyfiveflatflat| &amp; |C| \\
%   \heji{}{\otonaltwentyfiveflat} &amp; |\otonaltwentyfiveflat| &amp; |c| \\
%   \heji{}{\otonaltwentyfivenat} &amp; |\otonaltwentyfivenat| &amp; |l| \\
%   \heji{}{\otonaltwentyfivesharp} &amp; |\otonaltwentyfivesharp| &amp; |t| \\
%   \heji{}{\otonaltwentyfivesharpsharp} &amp; |\otonaltwentyfivesharpsharp| &amp; |T| \\
%   \heji{}{\otonalfiveflatflat} &amp; |\otonalfiveflatflat| &amp; |D| \\
%   \heji{}{\otonalfiveflat} &amp; |\otonalfiveflat| &amp; |d| \\
%   \heji{}{\otonalfivenat} &amp; |\otonalfivenat| &amp; |m| \\
%   \heji{}{\otonalfivesharp} &amp; |\otonalfivesharp| &amp; |u| \\
%   \heji{}{\otonalfivesharpsharp} &amp; |\otonalfivesharpsharp| &amp; |U| \\
%   \heji{}{\utonalfiveflatflat} &amp; |\utonalfiveflatflat| &amp; |F| \\
%   \heji{}{\utonalfiveflat} &amp; |\utonalfiveflat| &amp; |f| \\
%   \heji{}{\utonalfivenat} &amp; |\utonalfivenat| &amp; |o| \\
%   \heji{}{\utonalfivesharp} &amp; |\utonalfivesharp| &amp; |w| \\
%   \heji{}{\utonalfivesharpsharp} &amp; |\utonalfivesharpsharp| &amp; |W| \\
%   \heji{}{\utonaltwentyfiveflatflat} &amp; |\utonaltwentyfiveflatflat| &amp; |G| \\
%   \heji{}{\utonaltwentyfiveflat} &amp; |\utonaltwentyfiveflat| &amp; |g| \\
%   \heji{}{\utonaltwentyfivenat} &amp; |\utonaltwentyfivenat| &amp; |p| \\
%   \heji{}{\utonaltwentyfivesharp} &amp; |\utonaltwentyfivesharp| &amp; |x| \\
%   \heji{}{\utonaltwentyfivesharpsharp} &amp; |\utonaltwentyfivesharpsharp| &amp; |X| \\
%   \heji{}{\utonalonetwentyfiveflatflat} &amp; |\utonalonetwentyfiveflatflat| &amp; |H| \\
%   \heji{}{\utonalonetwentyfiveflat} &amp; |\utonalonetwentyfiveflat| &amp; |h| \\
%   \heji{}{\utonalonetwentyfivenat} &amp; |\utonalonetwentyfivenat| &amp; |q| \\
%   \heji{}{\utonalonetwentyfivesharp} &amp; |\utonalonetwentyfivesharp| &amp; |y| \\
%   \heji{}{\utonalonetwentyfivesharpsharp} &amp; |\utonalonetwentyfivesharpsharp| &amp; |Y| \\
%   \heji{}{\utonalsixtwentyfiveflatflat} &amp; |\utonalsixtwentyfiveflatflat| &amp; |J| \\
%   \heji{}{\utonalsixtwentyfiveflat} &amp; |\utonalsixtwentyfiveflat| &amp; |L| \\
%   \heji{}{\utonalsixtwentyfivenat} &amp; |\utonalsixtwentyfivenat| &amp; |N| \\
%   \heji{}{\utonalsixtwentyfivesharp} &amp; |\utonalsixtwentyfivesharp| &amp; |P| \\
%   \heji{}{\utonalsixtwentyfivesharpsharp} &amp; |\utonalsixtwentyfivesharpsharp| &amp; |Q| \\
%	\hline
%   \heji{}{\otonalfortynine} &amp; |\otonalfortynine| &amp; |,| \\
%   \heji{}{\otonalseven} &amp; |\otonalseven| &amp; |&lt;| \\
%   \heji{}{\utonalseven} &amp; |\utonalseven| &amp; |&gt;| \\
%   \heji{}{\utonalfortynine} &amp; |\utonalfortynine| &amp; |.| \\
%	\hline
%   \heji{}{\otonaleleven} &amp; |\otonaleleven| &amp; |4| \\
%   \heji{}{\utonaleleven} &amp; |\utonaleleven| &amp; |5| \\
%	\hline
%   \heji{}{\otonalthirteen} &amp; |\otonalthirteen| &amp; |0| \\
%   \heji{}{\utonalthirteen} &amp; |\utonalthirteen| &amp; |9| \\
%	\hline
%   \heji{}{\otonalseventeen} &amp; |\otonalseventeen| &amp; |:| \\
%   \heji{}{\utonalseventeen} &amp; |\utonalseventeen| &amp; |;| \\
%	\hline
%   \heji{}{\otonalnineteen} &amp; |\otonalnineteen| &amp; |/| \\
%   \heji{}{\utonalnineteen} &amp; |\utonalnineteen| &amp; |*| \\
%	\hline
%   \heji{}{\otonaltwentythree} &amp; |\otonaltwentythree| &amp; |3| \\
%   \heji{}{\utonaltwentythree} &amp; |\utonaltwentythree| &amp; |6| \\
%	\hline
%   \heji{}{\otonaltwentynine} &amp; |\otonaltwentynine| &amp; |2| \\
%   \heji{}{\utonaltwentynine} &amp; |\utonaltwentynine| &amp; |7| \\
%	\hline
%   \heji{}{\otonalthirtyone} &amp; |\otonalthirtyone| &amp; |1| \\
%   \heji{}{\utonalthirtyone} &amp; |\utonalthirtyone| &amp; |8| \\
%	\hline
%   \heji{}{\otonalthirtyseven} &amp; |\otonalthirtyseven| &amp; |Ăˇ| \\
%   \heji{}{\utonalthirtyseven} &amp; |\utonalthirtyseven| &amp; |Ă&nbsp;| \\
%	\hline
%   \heji{}{\otonalfortyone} &amp; |\otonalfortyone| &amp; |+| \\
%   \heji{}{\utonalfortyone} &amp; |\utonalfortyone| &amp; |-| \\
%	\hline
%   \heji{}{\otonalfortythree} &amp; |\otonalfortythree| &amp; |Ă©| \\
%   \heji{}{\utonalfortythree} &amp; |\utonalfortythree| &amp; |Ă¨| \\
%	\hline
%   \heji{}{\otonalfortyseven} &amp; |\otonalfortyseven| &amp; |Ă­| \\
%   \heji{}{\utonalfortyseven} &amp; |\utonalfortyseven| &amp; |Ă¬| \\
%   \hline
%   \multicolumn{3}{c}{\textit{stand-alone macros for o- and utonal symbols}} \\
%   \heji{}{\otonal} &amp; |\otonal| &amp; |Ă¶| \\
%   \heji{}{\utonal} &amp; |\utonal| &amp; |ĂĽ| \\
%   \heji{}{\Otonal} &amp; |\Otonal| &amp; |Ă–| \\
%   \heji{}{\Utonal} &amp; |\Utonal| &amp; |Ăś| \\
% \end{longtable}
%
% \StopEventually{}
% \newpage
% \section{Implementation}
% \begin{macro}{\heji}
% The package requires \textsf{fontspec} to access the required font files.
%    \begin{macrocode}
\RequirePackage{fontspec}[2018-07-30 vv2.6h]
\newfontfamily{\HEJIfont}{HEJI2Text}
\makeatletter
\newcommand*{\fsize}{\dimexpr\f@size pt\relax}
\makeatother
\newcommand*{\tempflatflat}{A}
\newcommand*{\tempflat}{a}
\newcommand*{\tempnat}{j}
\newcommand*{\tempsharp}{z}
\newcommand*{\tempsharpsharp}{Z}
\newcommand*{\otonalsixtwentyfiveflatflat}{I}
\newcommand*{\otonalsixtwentyfiveflat}{K}
\newcommand*{\otonalsixtwentyfivenat}{M}
\newcommand*{\otonalsixtwentyfivesharp}{O}
\newcommand*{\otonalsixtwentyfivesharpsharp}{R}
\newcommand*{\otonalonetwentyfiveflatflat}{B}
\newcommand*{\otonalonetwentyfiveflat}{b}
\newcommand*{\otonalonetwentyfivenat}{k}
\newcommand*{\otonalonetwentyfivesharp}{s}
\newcommand*{\otonalonetwentyfivesharpsharp}{S}
\newcommand*{\otonaltwentyfiveflatflat}{C}
\newcommand*{\otonaltwentyfiveflat}{c}
\newcommand*{\otonaltwentyfivenat}{l}
\newcommand*{\otonaltwentyfivesharp}{t}
\newcommand*{\otonaltwentyfivesharpsharp}{T}
\newcommand*{\otonalfiveflatflat}{D}
\newcommand*{\otonalfiveflat}{d}
\newcommand*{\otonalfivenat}{m}
\newcommand*{\otonalfivesharp}{u}
\newcommand*{\otonalfivesharpsharp}{U}
\newcommand*{\flatflat}{E}
\renewcommand*{\flat}{e}
\newcommand*{\nat}{n}
\renewcommand*{\sharp}{v}
\newcommand*{\sharpsharp}{V}
\newcommand*{\utonalfiveflatflat}{F}
\newcommand*{\utonalfiveflat}{f}
\newcommand*{\utonalfivenat}{o}
\newcommand*{\utonalfivesharp}{w}
\newcommand*{\utonalfivesharpsharp}{W}
\newcommand*{\utonaltwentyfiveflatflat}{G}
\newcommand*{\utonaltwentyfiveflat}{g}
\newcommand*{\utonaltwentyfivenat}{p}
\newcommand*{\utonaltwentyfivesharp}{x}
\newcommand*{\utonaltwentyfivesharpsharp}{X}
\newcommand*{\utonalonetwentyfiveflatflat}{H}
\newcommand*{\utonalonetwentyfiveflat}{h}
\newcommand*{\utonalonetwentyfivenat}{q}
\newcommand*{\utonalonetwentyfivesharp}{y}
\newcommand*{\utonalonetwentyfivesharpsharp}{Y}
\newcommand*{\utonalsixtwentyfiveflatflat}{J}
\newcommand*{\utonalsixtwentyfiveflat}{L}
\newcommand*{\utonalsixtwentyfivenat}{N}
\newcommand*{\utonalsixtwentyfivesharp}{P}
\newcommand*{\utonalsixtwentyfivesharpsharp}{Q}
\newcommand*{\otonalfortynine}{,}
\newcommand*{\otonalseven}{&lt;}
\newcommand*{\utonalseven}{&gt;}
\newcommand*{\utonalfortynine}{.}
\newcommand*{\otonaleleven}{4}
\newcommand*{\utonaleleven}{5}
\newcommand*{\otonalthirteen}{0}
\newcommand*{\utonalthirteen}{9}
\newcommand*{\otonalseventeen}{:}
\newcommand*{\utonalseventeen}{;}
\newcommand*{\otonalnineteen}{/}
\newcommand*{\utonalnineteen}{*}
\newcommand*{\otonaltwentythree}{3}
\newcommand*{\utonaltwentythree}{6}
\newcommand*{\otonaltwentynine}{2}
\newcommand*{\utonaltwentynine}{7}
\newcommand*{\otonalthirtyone}{1}
\newcommand*{\utonalthirtyone}{8}
\newcommand*{\otonalthirtyseven}{Ăˇ}
\newcommand*{\utonalthirtyseven}{Ă&nbsp;}
\newcommand*{\otonalfortyone}{+}
\newcommand*{\utonalfortyone}{-}
\newcommand*{\otonalfortythree}{Ă©}
\newcommand*{\utonalfortythree}{Ă¨}
\newcommand*{\otonalfortyseven}{Ă­}
\newcommand*{\utonalfortyseven}{Ă¬}
\newcommand{\heji}[2]{\mbox{#1\HEJIfont\large #2}}
\DeclareOption{accfirst}{
\renewcommand{\heji}[2]{\mbox{{\HEJIfont\large #2}#1}}
}
\newcommand{\acc}[1]{\mbox{\HEJIfont\large #1}}
\newcommand*{\otonal}{\mbox{\HEJIfont\large Ă¶}}
\newcommand*{\utonal}{\mbox{\HEJIfont\large ĂĽ}}
\newcommand*{\Otonal}{\mbox{\HEJIfont\large Ă–}}
\newcommand*{\Utonal}{\mbox{\HEJIfont\large Ăś}}
\ProcessOptions\relax
%    \end{macrocode}
% \end{macro}
% \Finale</pre></body></html>