On Sunday, February 25, 2001 6:51 AM, David Bobroff 
[SMTP:[EMAIL PROTECTED]] wrote:
> Hello all,
>
> I want to connect a single note to a triplet beam with the 
 connection being
> only a single beam.  I've not figured out how to do this in pmx. 
Consider
> the one-measure example (I've edited the set-up block so that it is
> a single measure):
>
> %%%%%%%%%%%%%%%%%%%%%%
> 1 1 4 4 4 4 0 -2
> 1 1 20 0.08
>
> b
> ./
> r1d [ f32 Df g8x3 f en ] f8d d1+ b2 /
>
> %%%%%%%%%%%%%%%%%%%%%%%
>
>...
> Can I achieve this same beaming with a rest at the beginning, or do
> I have to edit the *.tex file?
>

Last question first: When using PMX, it's usually a bad idea to rely 
on editing the *.tex, because every time after that when you want to 
change ANYTHING in the *.pmx, you'll have to re-edit *.tex.  But the 
good news is that there are two other kinds of solutions. First you 
could ask for the feature you want to be built into PMX, but that 
could take anywhere from 2 days to forever.  (In fact I will have a 
look at this one, because it is syntactically possible and logically 
sensible, so it ought to work).  The other kind of solution is 
in-line TeX; it's immediately available and almost always can solve 
the problem.  And if you know enough TeX to get your desired result 
by manually editing *.tex, then you know about 90% of what you need 
to do it with in-line TeX.

This is a PERFECT example.  Here's a solution; then I'll explain the 
process in some generality for anyone who's interested.

===============
r1d
\let\rbbbut\rbbbu\def\rbbbu#1{\rbbu{#1}\let\rbbbu\rbbbut}\
[ f32 Df \nbbu1\ g8x3 f en ] f8d d1+ b2 /
===============

The general process is
(1) Generate (using PMX) or imagine what TeX will actually be 
generated by the "bare" PMX.
(2) Manually generate or imagine what TeX you want.
(3) Comparing the two, insert or redefine macros into the first in 
order to generate the second.
(4) Enter the insertions and/or redefinitions into *.pmx using in-  
line TeX.

In this case the relevant section of TeX from the original source is

\pnotes{1.00}\ibbbu1F0\pmxdyn{-7}0\f\rbbbu1\qb1F\en%
\pnotes{1.15}\xnum{1.15}B3\qb1G\qb1F\bigna E\tbu1\qb1E\en%

where \rbbbu is a right-shifted beam termination defined in pmx.tex 
as \roff{\tbbbu{#1}} . The TeX you want is

\pnotes{1.00}\ibbbu1F0\pmxdyn{-7}0\f\rbbu1\qb1F\en%
\pnotes{1.15}\xnum{1.15}B3\nbbu1\qb1G\qb1F\bigna E\tbu1\qb1E\en%

I got this by playing around with the TeX, and I confess I didn't get 
it right the first time.  But one of the great things about our 
software system is that it doesn't cost you anything (except time) to 
do this sort of experimentation.  In this case I wasn't sure if I 
needed \rbbbu1\rbbu1 or just \rbbu1 so I tried both.  In fact they 
both worked but I'm a bit of an efficiency freak :-)

So first I want to REPLACE \rbbbu1 in the original TeX with \rbbu1. 
 The longish piece of inline TeX does exactly that.  The steps here 
are
(1) store the meaning of the original macro in a temporary token 
using \let.
(2) redefine the original macro to (a) do what you want, and then (b) 
restore itself (!) to its original meaning with another \let .
Sometime (b) isn't needed (because MusiXTeX redefines many things 
itself internally at various times), but it never hurts.

The second modification to the original TeX is to simply insert 
\nbbu1, to increase the beam multiplicity back up to 2.

Sometimes the insertion or replacement process is complicated due to 
PMX's rigid rules for where it puts in-line TeX: generally any type-1 
strings will go before the PMX-generated TeX associated with the note 
in question.  For example, for the first mod in this case we might 
have wanted to simply insert \rbbu1 after \rbbbu1 .  But there's no 
way to get PMX to put it there with a simple insertion.

This exercise does suggest a possible future PMX enhancement: an 
option on a type-1 TeX string that forces it to be placed immediately 
before the note (or next "spacing" command). Would anyone ever use 
such an animal?

--Don Simons

Reply via email to