Melodeon.net Forums
Discussions => Tunes => ABC => Topic started by: Roger Hare on April 05, 2019, 03:11:17 PM
-
I am using EasyABC on a HP machine running Windoze 10.
I have a problem with correct representation of numeric values in the Q: field.
Briefly, any value above 127 produces an incorrect value both in the display, and in the generated PDF file.
Here's an example:
X:1
T:Newcastle
M:4/4
L:1/8
Q:1/4=150
K:G
|: A2 | "G" B2 d2 "D7" G2 A2 | "G" G3 A G2 D2 | "G" B2 d2 G2 d2 | "C" e2 g4 fe |
"G" d2 B2 A2 G2 | "C" E2 e4 dc | "G" d2 B2 "D7" A3 G |1 "G" G4 G2 :|2 "G" G6 |]
|: ef | "G" gfed g3 B | "Am" A2 g4 A2 | "Em" G3 A "Bm" B2 F2 | "Em" E2 e4 f2 |
"G" gfed g3 B | "Am" A2 A2 c3 d | "C" e2 B2 "D7" A3 G | "G" G6 :|
I've attached the PDF generated by this ABC code - the metronome marking which should be 150 is
shown as -106.
A value of 127 works fine; a value of 128, yields -128; a value of 129 yields -127; and so on... (*)
I'm baffled by this - particularly as on my other W10 machine, it all works fine.
Any ideas?
Thank you. (I thought I had already asked this question, but I can't find any trace...)
Roger
(*) It hasn't escaped my attention that 127=(2**7)-1, and that the value produced is a discontinuous function of the input Q: value:
f(x)1:127=x;
f(x)128:256=x-256
which just shows that I'm a right smarty-knickers, but which doesn't get me much forrader... ::)
-
EasyABC on what platform, Roger? I just copied and pasted your ABC code into EasyABC for Windows - tempo displayed correctly - and exported to PDF - likewise displayed correctly.
Edit to add: just converted the file via the Windows command line to ps using abcm2ps and then to pdf with ghostscript and the resulting pdf is fine too.
-
(*) It hasn't escaped my attention that 127=(2**7)-1, and that the value produced is a discontinuous function of the input Q: value:
f(x)1:127=x;
f(x)128:256=x-256
which just shows that I'm a right smarty-knickers, but which doesn't get me much forrader... ::)
Looks like some silly programmer decided a single byte data type was enough to hold the Q value.
Actually, an unsigned byte would give a range of 0 - 255, which you'd mostly get away with.
Maybe they used char with a C compiler that treats char as signed instead of unsigned.
-
Roger, what are you using to generate the PDF? I just copied and pasted your ABC code into EasyABC - tempo displayed correctly - and exported to PDF - likewise displayed correctly.
Edit to add: just converted the file via the Windows command line to ps using abcm2ps and then to pdf with ghostscript and the resulting pdf is fine too.
I'm using a HP machine running Windoze 10. I just corrected my post to reflect the fact that I am using EasyABC!!!
Thank you for that. I haven't tried running abcm2ps/gs in the command prompt window as you describe,
perhaps I should. I think I'll try the ABC script in another ABC editor, to try and track down if it's a problem
with my implementation of EasyABC, or a problem with my OS.
If push comes to shove, I'll just xfer the file (~200 tunes) to the machine where it does work, before
producing my final PDF, but I'd like to get to the bottom of it if I can...
Thank you for the speedy reply.
-
...Looks like some silly programmer decided a single byte data type was enough to hold the Q value...
That's the immediate 'conclusion' innit? Strewth, I hope not - I thought we stopped doing that sort of
stuff about 40 years ago when memory started to come down in price...
-
...Looks like some silly programmer decided a single byte data type was enough to hold the Q value...
That's the immediate 'conclusion' innit? Strewth, I hope not - I thought we stopped doing that sort of
stuff about 40 years ago when memory started to come down in price...
As an ignoramus ;D I would expect EasyABC to be a well tested piece of software that normally functions ok.
Have you tried upgrading to the latest version. |I| canm't see you saying you have?
-
I would expect EasyABC to be a well tested piece of software that normally functions ok.
You'd think that about Boeing's plane control software too, wouldn't you? >:E]
Many a slip, etc....
(speaking as one who has released software with embarrassing bugs :|bl )
-
(speaking as one who has released software with embarrassing bugs :|bl )
Any one who says they have not has never written any proper software
Signed Ex Chief Engineer of a major Air Traffic Management company
-
I can see no error using Ubuntu Studio. abcm2ps, yaps and abc2abc all display the Q: field as expected. After conversion using abc2midi tempo is displayed with the correct value.
-
https://sourceforge.net/p/easyabc/tickets/12/
Conclusion: your EasyABC installation needs updating, or you can directly replace the abcm2ps binary it uses.
-
...Have you tried upgrading to the latest version...
Aye, I've got 1.3.7.7 (and 1.3.7.6, for that matter). Maybe I should try re-installing....
But, wait a minute!
https://sourceforge.net/p/easyabc/tickets/12/
Conclusion: your EasyABC installation needs updating, or you can directly replace the abcm2ps binary it uses.
Although I have got 1.3.7.7 installed, I have cleverly (:() managed to leave the 1.3.6.6 binaries selected in the
file settings. Changing to the 1.3.7.7 binaries fixed it. What a klutz!!! I really am usually more careful than that!!!
Thank you very much indeed Gena!!!