Re: [abcusers] What software will translate this correctly?

2004-06-11 Thread Jon Freeman
From: Phil Taylor [EMAIL PROTECTED]
 A better solution would be to find a tune which causes this behaviour
 and send it to Jeff so he can fix the bug ( but of course that presupposes
 that  you notice it happening when you're using it yourself).

It only happened the once and I'm not even convinced that one of us who can
add abc to the song database was responsible for it. I also suspect that it
was faulty abc that caused this to happen and these days all abc gets tested
locally, perferably with abcm2ps but sometimes using other programs before
getting added to the on line system. I suppose the same could happen again
even with our precautions but it was having an open to all system and not
being able to do anything should a problem occur that concerned me the most.

Jon

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


Re: [abcusers] What software will translate this correctly?

2004-06-11 Thread Stephen Kellett
In message [EMAIL PROTECTED], Jon Freeman 
[EMAIL PROTECTED] writes
I must admit I had not read you post properly last time round.  Are you
suggesting that it could be possible to have a version of abcm2ps that could
watch itself and terminate itself if it did get out of control?  I wouldn't
have the first clue where to start but if that sort of idea is feasible, I
am intrested.
Yes, entirely possible. How you'd do it would depend on the operating 
system. If it was Windows I could do it for you trivially. If it was 
Unix I'd have to dust off some books and do some research.

Then Phil Taylor writes:
It might be simpler to just kill the program after a short period of 
time
every time it's used.  In this application where only single tunes are
being processed the program should have finished and quit in less than
a second, so if you can add something to the script to kill it after 
five
seconds that should do the job.

Yes, if that is the invocation pattern, that approach is fine. I wasn't 
sure if abcm2ps used in this context stayed around waiting for another 
request. I think 5 seconds may be a bit on the low side. If the shared 
server just happened to get a lot of work at the same time the user of 
abcm2ps may get they valid job dumped too soon.

Stephen
--
Stephen Kellett
Object Media Limitedhttp://www.objmedia.demon.co.uk
RSI Information:http://www.objmedia.demon.co.uk/rsi.html
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Re: [abcusers] force a linefeed in the ps output

2004-06-11 Thread joe mc cool
joe mc cool wrote:
How can I persuade abcm2ps to output a lf at the |: ?  Or indeed 
anywthere ?
Blah, it is so easy.  I just put a T: before each |:
I am really sorry for the stupidity of this question.
Joe
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Re: [abcusers] What software will translate this correctly?

2004-06-11 Thread John Chambers
Stephen Kellett writes:
| In message [EMAIL PROTECTED], Jon Freeman
| [EMAIL PROTECTED] writes
| I had one for a while but took it down after some abc from somewhere caused
| abcm2ps to loop and I had my ISP phoning me up asking what abcm2ps was and
| telling me that it had been using something like 90% of the processing power
| for a good hour or more. I'm not prepared to take the chance on the shared
| server again.
|
| Write a monitor process that monitors your abcm2ps processes. Any
| process that has been at a high CPU for more than X time, kill it. Or
| modify abcm2ps to include a monitor thread to do the same task (better
| as it'll know how long each tune processing has taken).

A monitoring process or thread is radical  overkill  for  this  task.
We're  talking about a C program.  The standard C library handles the
job almost trivially (as the term is understood by C programmers ;-).
Here's  a  demo program that should run anywhere you have a minimally
POSIX-compliant C library:


/*
* Demo of using the signal/alarm routines to interrupt a program that
* runs for too long.
*/
#include stdio.h
#include signal.h

int timeout = 5;/* Kill the program after this many seconds */

sig_t alrm() {  /* Alarm handler */
printf(Alarm!\n);
exit(0);/* Exit normally */
}

main(ac,av) char **av;
{   int n = 0;
signal(SIGALRM,(sig_t)alrm);/* Declare our alarm handler */
alarm(timeout); /* Set alarm timer */
while (++n) {
printf(%d ...\n,n);
sleep(1);
}
printf(Can't get here.\n);
exit(1);/* Paranoia */
}


Supposedly even Windows has a POSIX-compliant C library,  though  I'd
guess  you'll  find that this needs a bit of tweaking there.  Anyway,
this takes no extra process or thread. You should be able to copy the
alrm()  routine  and  the  signal()  and alarm() calls to any other C
program to kill the program after some interval.

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


Re: [abcusers] What software will translate this correctly?

2004-06-11 Thread Jon Freeman
From: John Chambers [EMAIL PROTECTED]

 Stephen Kellett writes:
 | In message [EMAIL PROTECTED], Jon Freeman
 | [EMAIL PROTECTED] writes
 | I had one for a while but took it down after some abc from somewhere
caused
 | abcm2ps to loop and I had my ISP phoning me up asking what abcm2ps was
and
 | telling me that it had been using something like 90% of the processing
power
 | for a good hour or more. I'm not prepared to take the chance on the
shared
 | server again.
 |
 | Write a monitor process that monitors your abcm2ps processes. Any
 | process that has been at a high CPU for more than X time, kill it. Or
 | modify abcm2ps to include a monitor thread to do the same task (better
 | as it'll know how long each tune processing has taken).

 A monitoring process or thread is radical  overkill  for  this  task.
 We're  talking about a C program.  The standard C library handles the
 job almost trivially (as the term is understood by C programmers ;-).
 Here's  a  demo program that should run anywhere you have a minimally
 POSIX-compliant C library:

example snipped

Thanks. I won't try to understand it but I think I should be able to copy
that code and compile abcm2ps with it included. As far as I can make out,
this will be the ideal solution for me. I'll have a play with it over the
weekend.

Jon

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


Re: [abcusers] What software will translate this correctly?

2004-06-11 Thread Jon Freeman
From: Stephen Kellett [EMAIL PROTECTED]

 In message [EMAIL PROTECTED], Jon Freeman
 I presume that this approach would have a new thread within abcm2ps?  And

 Yes. Main thread executing, 2nd thread monitoring. If 2nd thread notices
 1st thread has been running for too long it can either kill the program
 or just kill the first thread. I'll write you some code if you are
 interested. I'm busy this weekend, but after Monday I can do it for you.
 Shouldn't take me long.

Thanks, I'll try to see if I can try John Chambers' suggestion first but may
will be back

Jon

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


Re: [abcusers] force a linefeed in the ps output

2004-06-11 Thread Bert Van Vreckem
Jack Campin wrote:
How can I persuade abcm2ps to output a lf at the |: ?
Or indeed anywthere ?
Blah, it is so easy.  I just put a T: before each |:
I am really sorry for the stupidity of this question.
The question's fine, it's the answer there's a problem with.
T: lines are supposed to be in headers, not tune bodies.
If abcm2ps accepts your solution it's doing soemthing wrong.
Hmm. I also use T: in a tune body sometimes, e.g. in Flemish quadrilles. 
These are set dances that consist of several (usually three to five) 
movements. I want them in the same abc tune, but I want to separate 
the movements. Using P: doesn't suffice for this, as each movement has 
its own parts.

For an example, see http://flanders.blackmill.net/music/index-en.html 
and look for Kadril van {Brussel,Diest,Mazel}. The PNG's are rendered 
by John Chamber's tune finder and they're not optimal, but you can also 
take a look at the PDF with all the dance tunes on the page: 
http://flanders.blackmill.net/music/pdf/folk-dances.pdf.

If this is wrong, how should I do it right?
snip
abcm2ps is also doing something wrong if it doesn't recognize
a linebreak as a staffbreak.  I thought it did?  Have you
configured it in an odd way?
AFAIK, it does.
Cheers,
bert
--
Bert Van Vreckem  http://flanders.blackmill.net/
Te audire non possum. Musa sapientum fixa est in aure.
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html


Re: [abcusers] force a linefeed in the ps output

2004-06-11 Thread Phil Taylor
On 11 Jun 2004, at 15:52, Jack Campin wrote:
How can I persuade abcm2ps to output a lf at the |: ?
Or indeed anywthere ?
Blah, it is so easy.  I just put a T: before each |:
I am really sorry for the stupidity of this question.
The question's fine, it's the answer there's a problem with.
T: lines are supposed to be in headers, not tune bodies.
No, T: lines can go in the tune body too (so that if your tune
is actually a set of tunes you can title them individually).
If abcm2ps accepts your solution it's doing soemthing wrong.
It is indeed.  A T: line shouldn't force a staff break, as a
tune may end, and the next one start in the middle of a line
if that's what the user wants.
We have been over this before, but by far the best wolution
is for softwre to recognize an explicit staffbreak using !.
I thought that had been implemented in abcm2ps already?  (It
comes from abc2win, which unfortunately doesn't recognize a
source linebreak as a staffbreak, and is halfway-supported in
BarFly).
abcm2ps is also doing something wrong if it doesn't recognize
a linebreak as a staffbreak.  I thought it did?  Have you
configured it in an odd way?
I would guess that he's entering tunes with \ at the ends of the
lines and relying on the program to wrap the tune to the staves
correctly.  If so, all he has to do is remove the backslashes, and
the program will usually place the staff ends where the line ends
are in the text.  The exception to this is if there are too many
notes to fit on one line where it will create a new staff for the
overspill notes.  (BarFly just continues cramming the extra notes
in, which is OK if it's just one or two but becomes unreadable
when carried to excess.)
Phil Taylor
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html