summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/musixtex/addons/curly.tex
blob: 902125486d08439c3a3ab5f8761a20a6bb8fd98a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  This is curly.tex, MusiXTex code for multiple left curly brackets   %
%                                                                      %
%         submitted by Mthimkhulu Molekwa <eMKay.sa@gmail.com>         %
%                   to the mutex list on 19 May 1999                   %
%                                                                      %
%                                                                      %
% usage:                                                               %
%   \curlybrackets{<instrument1lower><instrument1upper>                %
%                  <instrument2lower><instrument2upper>                %
%                  ...                                                 %
%                  <instrument_n_lower><instrument_n_upper>            %
%                 }                                                    %
%                                                                      %
%                                                                      %
%                                                                      %
%  This version corrected 07/23/2007 by Rainer Dunker to make it       %
%  insensitive to changes in \interstaff by PMX                        %
%                                                                      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\undefined\curlybrackets \else \endinput\fi
\makeatletter

\let\origin@lwrit@staffs\writ@staffs
\def\writ@staffs{%
  \origin@lwrit@staffs
  \ifx\br@cks\empty\else\expandafter\@bracks\br@cks\ende\fi}

\let\br@cks\empty
\def\curlybrackets#1{\def\br@cks{#1}}

\def\@bracks#1#2#3\ende{%
    \ifnum #1<#2 %=========================== inserted by D.S.(?)
      \noinstrum@nt=#1\s@l@ctinstr\b@zi\altitude
      \noinstrum@nt=#2\s@l@ctinstr\b@zii\altitude
      \advance\b@zii-\b@zi
      \C@Inter  
      \advance\b@zii\nblines\internote
      \advance\b@zii\nblines\internote
      \advance\b@zii-2\internote
      \n@v\b@zii \sp@pt\tw@ \advance\n@v\@cxxviii
      \divide\b@zii\tw@
      \advance\b@zi\b@zii
      \raise\b@zi\rlap{\mxsps\char\n@v\kern\instrum@in@group}%
    \fi %==================================== inserted by D.S.(?)
    \ifx\empty#3\else\@bracks#3\ende\fi}

\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%  End of curly.tex  %%%%%%%%%%%%%%%%%%%%%%%%%%