From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 macros/musictex/add-ons/harmonics.tex | 120 ++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
 create mode 100644 macros/musictex/add-ons/harmonics.tex

(limited to 'macros/musictex/add-ons/harmonics.tex')

diff --git a/macros/musictex/add-ons/harmonics.tex b/macros/musictex/add-ons/harmonics.tex
new file mode 100644
index 0000000000..f3d738c5df
--- /dev/null
+++ b/macros/musictex/add-ons/harmonics.tex
@@ -0,0 +1,120 @@
+%
+% Harmonics in MusicTeX
+% =====================
+%
+%\input musicnft
+%\input musictex
+%\input musicsty
+\input musicvbm
+\def\musictex{Music\TeX}%
+% ________________________________________________________________________
+%
+% Harmonic quaver duplets:-
+%                   _____                   2   3
+%           ypairu  |   |           ypairl  |   |
+%                   |   |                   |   |
+%                   2   3                   -----
+%
+\def\ypairu#1#2#3% #1 is beam number, #2 and #3 are notes
+{\Ibu{#1}{#2}{#3}1\yh{#1}{#2}\tbu{#1}\yh{#1}{#3}}\relax
+%
+\def\ypairl#1#2#3%  #1 is beam number, #2 and #3 are notes
+{\Ibl{#1}{#2}{#3}1\yb{#1}{#2}\tbl{#1}\yb{#1}{#3}}\relax
+%________________________________________________________________________
+\centerline{\enorme Harmonic notes in \musictex}
+\bigskip
+\bigskip
+\def\wbarno{}%
+\def\nbinstruments{1}%
+\cleftoksi={{0}{0}{0}{0}}%
+\staffbotmarg=12\Interligne%
+%
+% Note symbols by name
+%
+\def\bslash{{\tt\char'134}}%
+\def\mcra#1{\zcharnote{13}{\hbox to 1.3\Interligne{\hss\tt\bslash #1\hss}}}%
+\def\mcrb#1{\kern 10pt\mcra {#1}\kern -10pt}
+%
+\parindent 0mm%
+\debutextrait\normal\temps\NOTEs
+\qsk\qsk\hsk%
+\mcra{zd\bslash sk}\zd i\sk\qsk\mcra{du}\du i\qsk
+\mcra{dup}\dup i\qsk\mcra{dupp}\dupp i\qsk
+\mcra{duppp}\duppp i\qsk\mcra{dl}\dl i\qsk
+\mcra{dlp}\dlp i\qsk\mcra{dlpp}\dlpp i\qsk
+\mcra{dlppp}\dlppp i\enotes\finextrait
+\bigskip
+%
+\parindent 0mm%
+\debutextrait\normal\temps\NOTEs
+\qsk\qsk\hsk%
+\mcra{zy\bslash sk}\zy i\sk\qsk\mcra{yu}\yu i\qsk
+\mcra{yup}\yup i\qsk\mcra{yupp}\yupp i\qsk
+\mcra{yuppp}\yuppp i\qsk\mcra{yl}\yl i\qsk
+\mcra{ylp}\ylp i\qsk\mcra{ylpp}\ylpp i\qsk
+\mcra{ylppp}\ylppp i\enotes\finextrait
+%
+\parindent 0mm%
+\debutextrait\normal\temps\NOTEs
+\qsk\qsk\hsk%
+\mcra{ycu}\ycu i\qsk\mcra{yccu}\yccu i\qsk
+\mcra{ycccu}\ycccu i\qsk\mcra{yccccu}\yccccu i\qsk
+\mcra{ycl}\ycl i\qsk\mcra{yccl}\yccl i\qsk
+\mcra{ycccl}\ycccl i\qsk\mcra{yccccl}\yccccl i\qsk
+\enotes\finextrait
+%
+%
+\parindent 0mm%
+\debutextrait\normal\temps\NOTes
+\qsk\qsk\hsk%
+\mcrb{ypairu1cf}\ypairu1cf\sk%
+\mcrb{ypairu1eg}\ypairu1eg\sk%
+\mcrb{ypairl1jm}\ypairl1jm\sk%
+\mcrb{ypairl1ln}\ypairl1ln\sk%
+\enotes
+\finextrait
+%
+% Guitar Harmonics
+%
+\def\guitar#1#2#3% 1=note, 2=string, 3=fret
+{\zd #1\raise-12pt\hbox{\guitarsym#2#3}\sk}
+\def\lguitar#1#2#3% 1=note, 2=string, 3=fret
+{\raise-12pt\hbox{\guitarsym#2#3}\hqsk\zd #1\qsk\sk}
+%
+\centerline{\moyen Guitar harmonics}
+\medskip
+\parindent 0mm%
+%
+%     ---
+%    | A |  B
+%     ---
+%
+% A is the string number (Counting from treble E to bass E)
+% E string = 1, B = 2, G = 3, D = 4, A = 5, E = 6
+%
+% B is the fret number, counting from the nut (or the capot if one is used)
+% Thus 0 indicates an open string, 2 indicates fret 2 etc.
+%
+\font\eightrm=cmr8
+%
+\edef\catcodeat{\the\catcode`\@}\catcode`\@=11
+%
+\def\guitarsym#1#2{%
+% Modified version of \boxtext lifted from gentle.tex - A gentle intro to TeX
+\eightrm\setbox\strutbox=\hbox{\vrule height5.75pt depth0.75pt width\z@}%
+\hbox{\lower 1pt \hbox{\vbox{\hrule%
+\hbox{\strut \vrule #1\vrule}\hrule}}\hskip 0.5pt#2}}%
+%
+\catcode`\@=\catcodeat % Reset catcode of '@' to entry value
+%
+\def\sy#1#2% Inserts #2 as text #1 points to the right of the cursor
+{\kern#1pt\charnote0{#2}\kern-#1pt}%
+%
+\def\gs#1#2{\sy{-0.8}{\guitarsym{#1}{#2}}}\relax % One string
+%
+\debutextrait\normal\temps\NOtes\qsk%
+\lguitar L6{12}\lguitar a5{12}\lguitar b6{7}\lguitar d4{12}%
+\guitar e5{7}\guitar g3{12}\guitar h4{7}\guitar i2{12}%
+\guitar k3{7}\guitar l1{12}\sh m\guitar m2{7}\guitar n3{5}%
+\guitar p1{7}\guitar s1{5}\enotes\finextrait
+\bye
-- 
cgit v1.2.3

