On Tue, 02 Apr 2002 09:27:41 +0200, Rainer Dunker
<[EMAIL PROTECTED]> wrote:

>The strength of this method is that you can do virtually everything
>you can do within a normal music staff; its drawback is that you have to
>set its width explicitly.

This is a really elegant solution, Rainer! To prevent nasty line-break
surprises if one specifies too narrow a width, one could include a
\linegoal=1 statement in the macro as I've done below:


8<====================================================================
\input musixtex
\startmuflex

\def\notesintext#1#2{% #1 = width of music insertion; #2 = music text
  \vbox{\hsize#1
        \setlines10\smallmusicsize \nobarnumbers \nostartrule
        \staffbotmarg0pt \setclefsymbol1\empty
        \startpiece#2\linegoal=1\zstoppiece}}

Adjust the width of this extract:
\notesintext{3cm}{%
\Notes\qu0\en\notes\Dqbu 00\en\bar\notes\Dqbu 00\Dqbu 00\en} until it
looks the way you want.

\endmuflex
\bye
8<===================================================================


Now, though, can anyone tell me why this macro begins to behave oddly
when used in combination with (or more specifically, after an instance
of) an adapted version that writes a clef? In the three examples
below, the third one leaves extra white space before the first note,
and the space is exactly as much as a clef would take up. How does one
go about fixing this so that one can use both versions in a
music-and-text document?


8<===================================================================
\input musixtex
\startmuflex

% macro to insert lineless, clefless sequence of notes
\def\notesintext#1#2{
  \vbox{\hsize#1
        \setlines10\smallmusicsize \nobarnumbers \nostartrule
        \staffbotmarg0pt \setclefsymbol1\empty
        \startpiece#2\linegoal=1\zstoppiece}}

% macro adapted to insert music with clef & lines:
\def\musicintext#1#2{
  \vbox{\hsize#1
        \smallmusicsize \nobarnumbers \nostartrule
        \staffbotmarg0pt \setclefsymbol1\treblelowoct
        \startpiece#2\linegoal=1\stoppiece}\hskip 5pt}

Here's an insert
\notesintext{3cm}{%
\Notes\qu0\en\notes\Dqbu 00\en\bar\notes\Dqbu 00\Dqbu 00\en} 
without clef and lines.

Here's an insert
\musicintext{3cm}{\Notes\qu c\qu d\qu e\qu f\en}
with clef and lines.

And here's the first insert again
\notesintext{3cm}{%
\Notes\qu0\en\notes\Dqbu 00\en\bar\notes\Dqbu 00\Dqbu 00\en} 
with the space before it messed up!

\endmuflex
\bye
8<===================================================================


Eva


--
"Bach ist der Vater, wir sind die Buben. Wer von uns 
was Rechtes kann, hat's von ihm gelernt." 
            -- W. A. Mozart
_______________________________________________
TeX-music mailing list
[EMAIL PROTECTED]
http://sunsite.dk/mailman/listinfo/tex-music

Reply via email to