Re: Kind of solved (Re: [abcusers] Accented characters in lyrics(abc2ps))

2003-07-05 Thread Manuel Reiter
> I  wonder  whether  we  should  keep  discussing  this   on
> abcusers,  or  do  it in private?  A public discussion does
> have the advantage of keeping others up  to  date  on  what
> we've  done, and it invites their comments.  I can think of
> several cases where we might want to bring in the  question
> of  what's  the  best way to do something, with the idea of
> putting it into the standard.

I for one wouldn't mind if you kept the discussion on the list. I'd be
quit interested in seeing the 2 abc2ps descendants converge, if only to
save me from having to find out which one I like better ;) 

I have noticed that both of you have dropped the original abc2ps's
transpose function. I guess there's a good reason for that, but I found it
quite convenient.

> One command-line change that I  made,  which  others  might
> find  useful:   I changed the input/output so that jcabc2ps
> acts like a conventional unix "filter".  If  there  are  no
> input  files,  it reads from stdin.  If there are no output
> options, rather  than  writing  to  Out.ps,  it  writes  to
> stdout.  This way, I can use preprocessors (like abcpp) and
> postprocessors (various perl programs  I  have  that  munge
> postscript),  without  the  mess  of  creating intermediate
> files and then trying to make sure that they're cleaned up.
> 
> I found that this really simplified the cleanup job for  my
> tune  finder's  conversions.   If you don't need to produce
> intermediate files, you don't have much cleanup.
>
> I have the impression that, at  least  on  unixoid  systems
> (which  now  includes  Macs),  lots of others have uses for
> pre- and post-processors, so many  users  would  find  this
> useful.

Being able to use stdin and stdout is nice, yes. At least for stdin, I
would have thought however that just givin a filename of '-' would have
sufficed to achieve that. Actually, I don't know whether this is a feature
of bash, Linux or Unix variants in general, but I guess every environment
in which reading from stdin makes sense would provide a similar means!?

I've also noticed that with the current version, jcabc2ps ignores
the output options and wrtites to stdout in all cases. Is this intended, a
bug, or am I doing something wrong? I found especially '-o =' quite useful
at times.

> I suppose you might want  another  option  to  suppress  ps
> output if you don't like the -/+ convention that I adopted.
> Or you could use the  backwards  approach  that  a  lot  of
> people  seem  to  like,  with  -o meaning produce ps and +o
> meaning don't produce ps output.  This strikes me as a  bit
> perverse, but it's common enough these days.

Actually I wouldn' mind either way, but it would be nice if both programs,
while they still exist separately, behaved in the same way in that
respect.

Greetings,

  Manuel

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Re: Kind of solved (Re: [abcusers] Accented characters in lyrics (abc2ps))

2003-07-05 Thread John Chambers
Jean-Francois Moine writes:
| On Thu, 03 Jul 2003 18:52:54 UTC, John Chambers <[EMAIL PROTECTED]>
| wrote:
|   [snip]
| >I've discussed with Jef the idea of  merging  the  jcabc2ps
| >extensions  into  abcm2ps.   I'd  like  to  use some of his
| >extensions, too.  Maybe we can work on  this  character-set
| >issue a bit more, and then look into starting the merger.
|
| I did some merge in abcm2ps-3.6.2, but I will not change the
| command-line options ('+' instead of '-') nor the voice name
| separator for many lines ('\\' instead of '\n').
|
| May you check the remaining things to do?

I  wonder  whether  we  should  keep  discussing  this   on
abcusers,  or  do  it in private?  A public discussion does
have the advantage of keeping others up  to  date  on  what
we've  done, and it invites their comments.  I can think of
several cases where we might want to bring in the  question
of  what's  the  best way to do something, with the idea of
putting it into the standard.

One command-line change that I  made,  which  others  might
find  useful:   I changed the input/output so that jcabc2ps
acts like a conventional unix "filter".  If  there  are  no
input  files,  it reads from stdin.  If there are no output
options, rather  than  writing  to  Out.ps,  it  writes  to
stdout.  This way, I can use preprocessors (like abcpp) and
postprocessors (various perl programs  I  have  that  munge
postscript),  without  the  mess  of  creating intermediate
files and then trying to make sure that they're cleaned up.

I found that this really simplified the cleanup job for  my
tune  finder's  conversions.   If you don't need to produce
intermediate files, you don't have much cleanup.

Implementing this turned out to be fairly easy.  The  first
stage  was  to  to  through  and changed every "printf(" to
"fprintf(stderr,".  I verified that the result never  wrote
to stdout at all. This is important, because you don't want
to get warning messages mixed with the ps.  And to  fit  in
with  other  unix  software,  messages  and warnings really
should go to stderr.

The next stage was to find the references to "Out.ps",  and
change them to deal with stdout instead.  This wasn't quite
as trivial, but not terribly difficult.  It only took a few
tries  before  "jcabc2ps foo.abc >foo.ps" produced a foo.ps
that worked ok.

Changing the input to use stdin when there  were  no  input
files was also pretty easy.  It mostly consisted of finding
the error messages and changing them to accept a null input
file name as a synonym for stdin.

I did introduce two global flags, use_stdin and use_stdout,
that kept track of what was being done.  This wasn't really
necessary, but it made the code  a  bit  simpler  and  more
readable.   A  quick check shows that the only C files that
changed were jcabc2ps.c and subs.c, which  is  probably  no
surprise.   I could send you the relevant sections, but you
can likely find them just as fast yourself.

I have the impression that, at  least  on  unixoid  systems
(which  now  includes  Macs),  lots of others have uses for
pre- and post-processors, so many  users  would  find  this
useful.

The -o and -O options could be left alone, though I do find
it  handy  to  make  -o  the  default.  It's really nice if
the commands
  abc2ps  foo.abc >foo.ps
  abc2ps foo.ps
do exactly what you expect them to do.  This saves me a lot
of  "Oops!"  reactions  and  repeating  the command with -o
included.

I suppose you might want  another  option  to  suppress  ps
output if you don't like the -/+ convention that I adopted.
Or you could use the  backwards  approach  that  a  lot  of
people  seem  to  like,  with  -o meaning produce ps and +o
meaning don't produce ps output.  This strikes me as a  bit
perverse, but it's common enough these days.

Of course, true unix geeks would just use  ">/dev/null"  to
suppress the output.

Anyway, maybe you should set up an "alpha release" URL  for
abcm2ps,  and  we can create a fast testing loop.  I have a
sizable collection of tiny abc  test  files,  most  testing
just  one  feature.   I  can  easily  make  an abcm2ps test
directory with the same test files, and tell  you  where  I
get failures.


To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Re: Kind of solved (Re: [abcusers] Accented characters in lyrics (abc2ps))

2003-07-05 Thread Jean-Francois Moine
On Thu, 03 Jul 2003 18:52:54 UTC, John Chambers <[EMAIL PROTECTED]> 
wrote:
[snip]
>I've discussed with Jef the idea of  merging  the  jcabc2ps
>extensions  into  abcm2ps.   I'd  like  to  use some of his
>extensions, too.  Maybe we can work on  this  character-set
>issue a bit more, and then look into starting the merger.
>
>I've looked at abcm2ps, and  both  of  us  have  made  some
>rather  significant  changes  to  the way parts of the code
>work. No surprise there.  Combining them might bit a bit of
>work.

Hello John,

I did some merge in abcm2ps-3.6.2, but I will not change the
command-line options ('+' instead of '-') nor the voice name
separator for many lines ('\\' instead of '\n').

May you check the remaining things to do?

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
|   http://moinejf.free.fr/
Pépé Jef|   mailto:[EMAIL PROTECTED]
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Re: Kind of solved (Re: [abcusers] Accented characters in lyrics (abc2ps))

2003-07-03 Thread John Chambers
I. Oppenheim writes:
| On Thu, 3 Jul 2003, Manuel Reiter wrote:
|
| > sorry to answer my own post, but I've gotten a bit further after some
| > reading up of Postscript specs and a lot of guesswork. ;-)
| >
| > By modifying 'subs.c' and 'syms.c' modified from the
| > current (08-Apr-2003) version of jcabc2ps jcabc2ps
| > can handle macron (\=), dot (\.), breve (\u) and
| > hacek (\v) accents in what I hope is a fairly
| > portable manner not depending on any special
| > postscript hardware.
|
| Thank you for the good work. I hope it'll find its way
| to abcm2ps as well.

I've discussed with Jef the idea of  merging  the  jcabc2ps
extensions  into  abcm2ps.   I'd  like  to  use some of his
extensions, too.  Maybe we can work on  this  character-set
issue a bit more, and then look into starting the merger.

I've looked at abcm2ps, and  both  of  us  have  made  some
rather  significant  changes  to  the way parts of the code
work. No surprise there.  Combining them might bit a bit of
work.


To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Re: Kind of solved (Re: [abcusers] Accented characters in lyrics(abc2ps))

2003-07-03 Thread I. Oppenheim
On Thu, 3 Jul 2003, Manuel Reiter wrote:

> sorry to answer my own post, but I've gotten a bit further after some
> reading up of Postscript specs and a lot of guesswork. ;-)
>
> By modifying 'subs.c' and 'syms.c' modified from the
> current (08-Apr-2003) version of jcabc2ps jcabc2ps
> can handle macron (\=), dot (\.), breve (\u) and
> hacek (\v) accents in what I hope is a fairly
> portable manner not depending on any special
> postscript hardware.

Thank you for the good work. I hope it'll find its way
to abcm2ps as well.


 Groeten,
 Irwin Oppenheim
 [EMAIL PROTECTED]
 ~~~*

 Chazzanut Online:
 http://www.joods.nl/~chazzanut/
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Kind of solved (Re: [abcusers] Accented characters in lyrics (abc2ps))

2003-07-03 Thread Manuel Reiter
Hi,

sorry to answer my own post, but I've gotten a bit further after some
reading up of Postscript specs and a lot of guesswork. ;-)

By modifying 'subs.c' and 'syms.c' modified from the current (08-Apr-2003)
version of jcabc2ps found at

http://trillian.mit.edu/~jc/music/abc/src/jcabc2ps-src.tar.gz

jcabc2ps can handle macron (\=), dot (\.), breve (\u) and hacek (\v)
accents in what I hope is a fairly portable manner not depending on any
special postscript hardware.

The modified files are temporarily available at

http://www.th.physik.uni-frankfurt.de/~reiter/subs.c
and
http://www.th.physik.uni-frankfurt.de/~reiter/syms.c

An example abc-input file (govori.abc) and the postscript my modified
version produces  are available at

http://www.th.physik.uni-frankfurt.de/~reiter/govori.abc
and 
http://www.th.physik.uni-frankfurt.de/~reiter/govori.ps

Please let me know whether this works for you!

A couple of issues I'm aware of:

- I fear that my implemetation could break Postscript's 'stringwidth' for
strings which contain accents. To work around that, I'd need a way to get
a glyphs width from a glyph in postscript, anybody want to help out?

- Placement of the accents works quite well for most characters but is
ugly for high lower-case characters like 'l' and 'b'.

- Including the other combining accents og Postscript's Latin1Encoding
(grave, acute, circumflex, tilde, diaeresis, ring above, double acute ) is
in principle trivial, but for some I didn't find a notation on 

http://www.musicaviva.com/abc/abcyclopedia/view.tpl?kw=Special%20characters

and others might conflict with built-in accented characters like (\'e) -
but that should be easy to fix.

I hope anybody besides me finds this helpful. :-) Maybe it will even make
its way into mainstream jcabc2ps when the above issues have been sorted
out.

Cheers,

  Manuel

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html