> From: "I. Oppenheim" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [TeX-music] unbeamed triplets
>
> How can I produce unbeamed triplets in m-tx,
> or triplets of which only two notes are beamed?

If by m-tx you mean MusicTeX/MusixTeX, I developed these macros
a few months ago for just this purpose.  I don't think tuplet
brackets would go with beams!  It would be better to unbeam the
beamed notes.

Anyway, here are the macros.  One of these days I'll archive them.

%%%     Tuplet macros for MusicTeX.
%       Col. G. L. Sicherman.
%       2002-03-24.
%
%%%     REMARKS:
%
%       These structures are normally used in \zcharnote blocks
%       so they will not space the music forward.
%
%       Distances are TeX dimensions; e.g., "1.5in".
%       Note counts are numbers; e.g., "3".
%
%       These macros work only with dvips, T. Rokicki's
%       TeX driver for PostScript.  They have been tested
%       only with version 5.86 of dvips (1999).
%
%%%     CONTENTS:
%
%       \tupu   tuplet bracket, belly up.
%               #1 = horizontal length
%               #2 = vertical displacement
%               #3 = note count
%       \tupd   tuplet bracket, belly down.
%               #1 = horizontal length
%               #2 = vertical displacement
%               #3 = note count
%
%%%     THE MACROS:
%
% PostScript macros:
%
\special{!
%
%       sp - convert from scaled points to normal scale (big points).
%               Divide by 72.27 * 65536 and multiply by 72.
%
        /sp { 0.000015201782 mul } N
%
%       brackht - fixed length of vertical ends of bracket
%               in big points.
%
        /brackht 3 N
%
%       tupu - upward bracket.
%               $1 - width of bracket in scaled points.
%               $2 - vertical displace of bracket in scaled points.
%                       + is up, - is down.
%               $3 - width of break in scaled points.
%
        /tupu {
                0.3 setlinewidth
                newpath 0 0 moveto 0 brackht lineto slopes 0
                brackht neg rlineto stroke
        } N
%
%       tupd - downward bracket.
%               Same arguments as tupu.
%
        /tupd {
                0.3 setlinewidth
                newpath 0 0 moveto 0 brackht neg lineto slopes 0
                brackht rlineto stroke
        } N
%
%       slopes - draw the sloping parts of the bracket.
%               Same arguments as tupu.
%
        /slopes {
                sp /breakwidth exch N sp /vdisp exch N
                sp /width exch N /dx width breakwidth sub 2 div N
                /dy dx vdisp mul width div N
                dx dy rlineto
                breakwidth dup vdisp mul width div rmoveto
                dx dy rlineto
        } N}\relax
%
% TeX macros.
%
%       Define macros for using the PostScript macro.
%       \special does not interpolate variables,
%       but it interpolates macro arguments.
%
\def\tupuspecial#1#2#3{\special{" #1 #2 #3 tupu }}\relax
\def\tupdspecial#1#2#3{\special{" #1 #2 #3 tupd }}\relax
%
%       The user macros.
%
\def\tupu#1#2#3{\relax
\tupwd=#1\tupht=#2\tuphalfht=\tupht\relax
\divide\tuphalfht by 2 \advance\tuphalfht by 3pt\relax
% Compute width of count, allowing extra space of 1/2 char width.
\setbox\wdbox=\hbox{\slurptupfont #3}\relax
\tupcountwd=\wd\wdbox \advance\tupcountwd by \tupextrawd\relax
\setbox\wdbox=\hbox{\slurptupfont 3}\tupextrawd=\wd\wdbox\relax
\divide\tupextrawd by 2\relax
% Set count registers from dimension registers.
% All counts will be in scaled points.
\ntupwd=\tupwd \ntupht=\tupht
\advance\tupcountwd by \tupextrawd \ntupcountwd=\tupcountwd
\rlap{\raise\tuphalfht\vbox
to 0pt{\vss\hbox to \tupwd{\hss\slurptupfont #3\/\hss}\vss}}\relax
\tupuspecial{\the\ntupwd}{\the\ntupht}{\the\ntupcountwd}\relax
}\relax
%
\def\tupd#1#2#3{\relax
\tupwd=#1\tupht=#2\tuphalfht=\tupht\relax
\divide\tuphalfht by 2 \advance\tuphalfht by -3pt\relax
% Compute width of count, allowing extra space of 1/2 char width.
\setbox\wdbox=\hbox{\slurptupfont #3}\relax
\tupcountwd=\wd\wdbox \advance\tupcountwd by \tupextrawd\relax
\setbox\wdbox=\hbox{\slurptupfont 3}\tupextrawd=\wd\wdbox
\divide\tupextrawd by 2\relax
% Set count registers from dimension registers.
% All counts will be in scaled points.
\ntupwd=\tupwd \ntupht=\tupht
\advance\tupcountwd by \tupextrawd \ntupcountwd=\tupcountwd
\rlap{\raise\tuphalfht\vbox
to 0pt{\vss\hbox to \tupwd{\hss\slurptupfont #3\/\hss}\vss}}\relax
\tupdspecial{\the\ntupwd}{\the\ntupht}{\the\ntupcountwd}\relax
}\relax
%
%       Registers:
%
\newdimen\tupht \newdimen\tupwd
\newdimen\tuphalfht \newdimen\tupcountwd \newdimen\tupextrawd
\newcount\ntupht \newcount\ntupwd \newcount\ntupcountwd
\newbox\wdbox
%
%       Font.  Maybe this should be size-dependent like \ppff.
%
\font\slurptupfont=cmbxti10\relax
%
%%%     END OF TUPLET MACROS.
_______________________________________________
TeX-music mailing list
[EMAIL PROTECTED]
http://sunsite.dk/mailman/listinfo/tex-music

Reply via email to