On Thu, 14 Jun 2007 23:18:29 +0200
Arthur de Jong <[EMAIL PROTECTED]> wrote:

> Restoring the default colors does not always work for me (leaving the
> font sometimes bold, sometimes light grey (screenshot attached). Also
> the black background is a bit annoying (mine is light as you can see).

Black background is my default, I got used to old PC text modes.
I use an elaborate $PS1, which resets the colors every time:

        # Try it!  In console mode, it tells which console, Xterms excepted...
        PS1='\[\033[44;01;33m\]\u\[\033[m\] [VT\[\033[40;01;33m\]\[\033[m\]] 
\w>'

Quite useless for debugging this.  So I ran a white-background 'xterm'
with a plainer prompt:

        PS1="\w$ "

Which had the same results shown in your window capture.  Another
look at 'man console_codes', and:

        for f in 1 2 22 ; do seq -f "$f;%g" 31 37 ; done | rl -rc $L | for f in 
$S ; do read c ; /bin/echo -ne "\033[40;$c\155$f " ; done ; echo -e "\033[0\155

The only difference is the end, changing '39;49' (default
foreground/background colors) to '0' (default fore/back/intensity
colors); I just now learned about '0'.

For the demo, a fixed background is a must, as otherwise the random
foreground can be the same color as the background, making the text
invisible.  This version works on the 'xterm' default bright white
background:

        for f in 1 2 22 ; do seq -f "$f;%g" 30 36 ; done | rl -rc $L | for f in 
$S ; do read c ; /bin/echo -ne "\033[49;$c\155$f " ; done ; echo -e "\033[0\155"

Unfortunately that's not general; on other backgrounds it's prone to
invisible text.  Trouble is that '[49' bit:

        % man console_codes | grep -n 49
        226:       49      set default background color

I don't know how to make the background bright white, (when
it wasn't to begin with), and settled for '49'.

On a related note, an 'rl' application I'd love to get working is
changing 'timidity' patches at random for esoteric music.  Can't figure
it out...  here's an example of the desired output:

        % timidity  -x 'bank 0\n11 
/usr/share/timidity/patches/sfx/ambulanc.pat'  -x 'bank 0\n15 
/usr/share/timidity/patches/sfx/badmaou.pat'  -x 'bank 0\n27 
/usr/share/timidity/patches/sfx/birdtwee.pat'  -x 'bank 0\n28 
/usr/share/timidity/patches/sfx/bubbles1.pat'  -x 'bank 0\n35 
/usr/share/timidity/patches/sfx/bubbling.pat'  -x 'bank 0\n48 
/usr/share/timidity/patches/sfx/carcrash.pat'  -x 'bank 0\n56 
/usr/share/timidity/patches/sfx/carengin.pat'  -x 'bank 0\n57 
/usr/share/timidity/patches/sfx/carpass.pat' -x 'bank 0\n59 
/usr/share/timidity/patches/sfx/carstop.pat'  -x 'bank 0\n60 
/usr/share/timidity/patches/sfx/cat1.pat'  -x 'bank 0\n61 
/usr/share/timidity/patches/sfx/creak.pat'  -x 'bank 0\n65 
/usr/share/timidity/patches/sfx/cutnoiz.pat'  -x 'bank 0\n66 
/usr/share/timidity/patches/sfx/dialtone.pat'  -x 'bank 0\n67 
/usr/share/timidity/patches/sfx/dog1.pat'  -x 'bank 0\n127 
/usr/share/timidity/patches/sfx/dog2.pat'  Desktop/sound/midi/James_Bond.mid.OK

The melody is unrecognizable for some people.

So 'rl' could take a list of '.pat' files and mix them up.  The puzzle
is how to set the 'bank 0 \n65' stuff -- those last two bank digits
vary between '.mid' files.   Without the correct bank set it can't
work.  What's missing is a stdout util that shows the bank set for a
given midi file.

HTH...

PS:  I'm happy the color "safety" example and its rationale went over well!


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to