texlive[45089] Master: octave (21aug17)

commits+karl at tug.org commits+karl at tug.org
Mon Aug 21 22:46:21 CEST 2017


Revision: 45089
          http://tug.org/svn/texlive?view=revision&revision=45089
Author:   karl
Date:     2017-08-21 22:46:20 +0200 (Mon, 21 Aug 2017)
Log Message:
-----------
octave (21aug17)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/octave/
    trunk/Master/texmf-dist/doc/latex/octave/README.md
    trunk/Master/texmf-dist/doc/latex/octave/octave.pdf
    trunk/Master/texmf-dist/doc/latex/octave/octave.tex
    trunk/Master/texmf-dist/tex/latex/octave/
    trunk/Master/texmf-dist/tex/latex/octave/octave.sty
    trunk/Master/tlpkg/tlpsrc/octave.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/octave/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/octave/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/octave/README.md	2017-08-21 20:46:20 UTC (rev 45089)
@@ -0,0 +1,14 @@
+# The `octave` Package for Typesetting Musical Pitches with Octave Designations
+
+The `octave` package typesets musical pitch names with designations for the
+octave in either the Helmholtz system (letter name with subscript numeral for
+the octave, where middle C is `C4`), or the traditional system with upper- and
+lowercase letters and prime symbols, where middle C is `c'`.
+
+Using this package, authors can just write `\pitch{C}{4}` and then by calling a
+package option (`number` or `prime`), can render all the pitch names in either
+system.  
+The system can also be changed mid-document.
+
+This material is subject to the current version of the LaTeX Project Public License.
+The author and maintainer is Andrew A. Cashner, `andrewacashner at gmail.com`.


Property changes on: trunk/Master/texmf-dist/doc/latex/octave/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/octave/octave.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/octave/octave.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/octave/octave.pdf	2017-08-21 20:45:40 UTC (rev 45088)
+++ trunk/Master/texmf-dist/doc/latex/octave/octave.pdf	2017-08-21 20:46:20 UTC (rev 45089)

Property changes on: trunk/Master/texmf-dist/doc/latex/octave/octave.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/octave/octave.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/octave/octave.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/octave/octave.tex	2017-08-21 20:46:20 UTC (rev 45089)
@@ -0,0 +1,122 @@
+\documentclass{article}
+
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{semantic-markup}
+\usepackage{octave}
+\usepackage{fancyvrb}
+\frenchspacing
+\usepackage[
+    pdftitle={The octave Package for Typesetting Musical Pitches with Octave
+    Designations},
+    pdfauthor={Andrew A. Cashner},
+    pdfsubject={LaTeX package},
+    pdfkeywords={LaTeX, music, musicology, humanities}
+]{hyperref}
+
+\title{The \code{octave} Package for Typesetting Musical Pitches with Octave
+Designations}
+\author{Andrew A. Cashner\thanks{%
+    \href{mailto:andrewacashner at gmail.com}
+    {\nolinkurl{andrewacashner at gmail.com}}%
+    }%
+}
+
+\begin{document}
+\maketitle
+
+There are two standard ways of indicating the octave of a musical pitch:
+\begin{enumerate}
+    \item The Helmholtz system, which uses subscript numerals after the pitch
+        letter name, where \soCalled{middle C} is \pitch{C}{4}
+    \item {\octaveprimes
+        The traditional system, which uses upper- and lowercase letters followed
+        by prime (tick) marks, where \soCalled{middle C} is \pitch{C}{4} and
+        an octave higher is \pitch{C}{5}.}
+\end{enumerate}
+
+This package allows you to typeset pitch names conveniently using either method
+(or even switching between) without worrying about typography, with a simple,
+semantically meaningful interface.
+Authors can write their documents without worrying about which system of
+nomenclature their editor or press will prefer.
+Simply changing the option with which the package is called will change the
+display of all the pitches in the document that have been written with this
+package's commands.
+
+\tableofcontents 
+
+\section{Package Options}
+
+\begin{center}
+    \begin{tabular}{ll}
+        \code{number}   & (Default) Use Helmholtz numbers \\
+        \code{prime}    & Use the traditional system with prime/tick marks \\
+    \end{tabular}
+\end{center}
+
+To use octave numbers, just add \verb|\usepackage{octave}| to your preamble. 
+To use the traditional system, write \verb|\usepackage[prime]{octave}| instead.
+
+
+
+\section{Switching Systems within One Document}
+
+At any time, you can change from one system to the other.
+
+\begin{center}
+\begin{tabular}{ll}
+    \verb|\octaveprimes|    
+        & Switch to the traditional system (prime/tick marks) \\
+    \verb|\octavenumbers|   
+        & Switch to the Helmholtz system (numbers) \\
+\end{tabular}
+\end{center}
+
+\section{Style}
+
+The default setup (stored in the command \verb|\pitchfont|) is for pitch letters
+and numbers in the Helmholtz system to be in the normal font, while pitch
+letters and prime marks are in italic.  You can change this, for example:
+
+\verb|\renewcommand{\pitchfont}{\mdseries}|.
+
+\section{Entering Pitch Names}
+
+To enter a pitch name, use the \verb|\pitch| command.
+It takes three arguments:
+\begin{enumerate}
+    \item (Mandatory) Letter name of the pitch: Can be upper- or lowercase; the
+        package will adjust the case as necessary
+    \item (Optional, in square brackets) Accidental command, e.g., \verb|$\sharp$| or \verb|\sh|
+        from the \code{semantic-markup} package
+    \item (Mandatory) Number of the pitch in the Helmholtz system
+\end{enumerate}
+
+Yes, the package requires you to use the numbered system, even if you want the
+output to be in the traditional system. 
+Thus middle C is \verb|\pitch{C}{4}|, and an octave and a semitone above that is
+\verb|\pitch{C}[\sh]{5}| (using the \code{semantic-markup} package for the
+accidental).
+
+
+\section{Table of Octave Designations in the Two Systems}
+
+The package also provides the \verb|\octavetable| which displays a comparison
+of the two systems, shown in table~\ref{octavetable}.
+
+\begin{table}
+    \caption{Pitch designations in traditional (\code{prime}) and Helmholts
+    (\code{number}) systems}
+    \label{octavetable}
+    \begin{center}
+    \octavetable
+    \end{center}
+\end{table}
+
+\section{Code}
+
+\VerbatimInput{octave.sty}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/octave/octave.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/octave/octave.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/octave/octave.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/octave/octave.sty	2017-08-21 20:46:20 UTC (rev 45089)
@@ -0,0 +1,157 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{octave}
+[2017/08/21 Octave designations in Helmoltz or traditional style]
+
+% Copyright 2017 Andrew A. Cashner, andrewacashner at gmail.com
+
+% This work may be distributed and/or modified under the 
+% conditions of the LaTeX Project Public License, either
+% version 1.3 of this license or (at your option) any 
+% later version.
+% The latest version of this license is in 
+%    http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions
+% of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+% The Current Maintainer of this work is Andrew A. Cashner.
+% This work consists of the package file octave.sty
+% and the documentation file octave.tex.
+
+% CHANGE LOG
+% 2017-08-21 First version on CTAN
+
+\newif\if at OctaveNumber
+\@OctaveNumbertrue % Use Helmholtz numbers by default
+
+\DeclareOption{prime}  {\@OctaveNumberfalse}
+\DeclareOption{number} {\@OctaveNumbertrue}
+
+\ProcessOptions\relax
+
+\RequirePackage{xparse}
+
+% Allow user to switch styles mid-document
+\NewDocumentCommand{\octaveprimes}  {}{\@OctaveNumberfalse}
+\NewDocumentCommand{\octavenumbers} {}{\@OctaveNumbertrue}
+
+%****************************************************************************
+% Main user command to enter pitch
+% example: middle C is \pitch{c}{4}, semitone up is \pitch{C}[\sh]{4}
+% #1 Pitch letter (can be lower or uppercase)
+% #2 Optional accidental (e.g., $\flat$, or \fl{} from semantic-markup package)
+% #3 Octave number (Helmholtz numbers, middle C = 4)
+\NewDocumentCommand{\pitch}{ m o m }{%
+    \if at OctaveNumber
+        {\pitchfont{\MakeUppercase{#1}%
+        \IfValueTF{#2}{#2}{}\textsubscript{#3}}}%
+    \else
+        {\pitchfont{%
+            \@GetOctaveTick{#1}[#2]{#3}%
+        }}%
+    \fi
+}
+
+% Font for pitch and octave designation, default italics for prime style
+% User can change with \renewcommand
+\NewDocumentCommand{\pitchfont}{}{%
+    \if at OctaveNumber\mdseries%
+    \else\itshape%
+    \fi
+}
+
+%***************************************************************************
+% If using ticks, determine the right letter and octave symbols to print
+%
+% Octave  Designation
+%      0  C''
+%      1  C'
+%      2  C
+%      3  c
+%      4  c'
+%      5  c''
+% 
+% The input octave number can be less than zero or more than 5; this will just
+% produce a lot of tick marks (e.g., \pitch{c}{8} => c'''''
+
+% Mnemonic for selecting upper or lowercase letters, 
+% used as argument to \@PrintLetter
+\NewDocumentCommand{\@OctaveUpper}{}{1}
+\NewDocumentCommand{\@OctaveLower}{}{0}
+
+% Get the letter of the proper case and the right number of ticks.
+% #1 Pitch letter
+% #2 Optional accidental
+% #3 Pitch number in Helmholtz notation
+\newcount\@OctaveNum
+\NewDocumentCommand{\@GetOctaveTick}{ m o m }{%
+    \@OctaveNum = #3
+    \ifnum\@OctaveNum < 3 
+    % Octave < 3: Letter lowercase + (-OctaveNum + 2)ticks
+        \@PrintLetter{\@OctaveUpper}{#1}%
+        \multiply\@OctaveNum by -1 
+        \advance\@OctaveNum by 2 
+    \else
+    % Octave >= 3: Letter uppercase + (OctaveNum - 3)ticks
+        \ifnum\@OctaveNum > 2
+            \@PrintLetter{\@OctaveLower}{#1}%
+            \advance\@OctaveNum by -3
+        \fi
+    \fi
+    % Print accidental if there is one
+    \IfValueTF{#2}{\@SpacedAccidental{#2}}{}%
+    % Print ticks; No need to do so if octave 2 or 3
+    \ifnum\@OctaveNum > 0
+        \kern1pt\@PrintTicks{\@OctaveNum}%
+    \fi
+}
+
+% Accidental with spacing around it
+%  #1 accidental symbol code
+\NewDocumentCommand{\@SpacedAccidental}{ m }{%
+    \kern0.4pt#1\kern-0.4pt%
+}
+% Print letter in proper case
+% #1 \@OctaveUpper (=1) or \@OctaveLower (=0)
+% #2 Character to print
+\NewDocumentCommand{\@PrintLetter}{ m m }{%
+    \ifnum #1 = \@OctaveLower
+        \MakeLowercase{#2}%
+    \else
+        \MakeUppercase{#2}%
+    \fi
+}
+        
+% Print sequence of tick marks
+\newcount\@TickNum
+\NewDocumentCommand{\@PrintTicks}{ m }{%
+   \@TickNum = #1%
+   \loop
+        \@Tick{}%
+    \advance\@TickNum by -1
+    \ifnum\@TickNum > 0
+    \repeat
+}
+\NewDocumentCommand{\@Tick}{}{\ensuremath{'}}
+
+%*******************************************
+% Octave comparison table for demonstration
+\newcounter{@TableOctave}
+\NewDocumentCommand{\octavetable}{}{%
+    \def\@TablePitchNames{}%
+    \loop
+    \edef\@TablePitchNames{%
+        \@TablePitchNames
+        {\octaveprimes \pitch{C}{\the at TableOctave}} & 
+        {\octavenumbers \pitch{C}{\the at TableOctave}}\tabularnewline
+    }%
+    \stepcounter{@TableOctave}%
+    \ifnum\value{@TableOctave} < 8
+    \repeat
+    %
+    \begin{tabular}{ll}
+        \@TablePitchNames
+    \end{tabular}%
+}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/octave/octave.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-08-21 20:45:40 UTC (rev 45088)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-08-21 20:46:20 UTC (rev 45089)
@@ -452,7 +452,7 @@
     nrc ntgclass ntheorem ntheorem-vn nuc nucleardata
     numberedblock numericplots numname numnameru numprint numspell nwejm
   oberdiek objectz obnov
-    ocg-p ocgx ocgx2 ocherokee ocr-b ocr-b-outline ocr-latex octavo
+    ocg-p ocgx ocgx2 ocherokee ocr-b ocr-b-outline ocr-latex octave octavo
     odsfile ofs
     ogham oinuit old-arrows oldlatin oldstandard
     oldstyle olsak-misc

Modified: trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc	2017-08-21 20:45:40 UTC (rev 45088)
+++ trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc	2017-08-21 20:46:20 UTC (rev 45089)
@@ -21,6 +21,7 @@
 depend musixtex
 depend musixtex-fonts
 depend musixtnt
+depend octave
 depend piano
 depend pmx
 depend pmxchords

Added: trunk/Master/tlpkg/tlpsrc/octave.tlpsrc
===================================================================


More information about the tex-live-commits mailing list