Re: [abcusers] Anyone up for writing a little script?
Atte writes: | Dafydd Monks wrote: | | I was thinking of a GIF/MIDI parser really - andone that dose not need the | backed of abc(m)2ps. | | Ok, I see. Would be very cool indeed. Recently I got my ands on a BlackBerry 7280 (cool geek toy ;-), and of course I had to see if I could make it work with my Tune Finder. The browser worked OK. It can display images, so I started converting tunes to GIF and PNG. If they're too big, they get converted to the screen size (240x160 pixels). The result invariably was that some of the horizontal and vertical lines came out a fuzzy smudge. Most were quite unreadable. No problem, you might think; just tell the ps2gif and ps2png image converters to create a 240x160 image. Nope. The only converters that I've been able to find refuse to deal in pixels, as does PS. The best converter that I've found is the one that comes with ghostscript, and it has a resulution arg that is a number without unit. A simple test shows that it is definitely not a pixel count. Resolution is usually measured in pixels/unit-of-lenght, of course, so I calculated the nnumbers for the screen, using inches, mm and cm as the unit-of-length. All were wildly wrong. I eventually found, after hours of experimenting, that a horizontal resolution of 32 and a vertical resolution of 36 produces GIF and PNG images with solid vertical and horizontal lines. The image is a few pixels narrower than the screen, but close enough. The numbers 32 and 36 don't seem to be close to any nuumber that could be called resolution on this screen. Meanwhile, my wife got a Palm Tungsten, which comes with wifi and a real browser. I tried the Tune Finder on it, downloaded a GIF - and it came out about 2.5 times as wide as the screen. Working a tiny little scrollbar while trying to read a line of music isn't the most practical thing in the world. So I'll probably spend some more time writing code to detect that client and discovering the magic numbers that makes the image come out readable on that (320x320) screen. I'll guess that the numbers won't resemble any relating to the 320x320 size of the screen. Now, GIF and PNG are scan-line formats, and deal basically in pixels. What I'm tempted to try is digging into my abc2ps clone and adding some new output formats. Actually, unix systems come with this huge library that converts images to/from the ppm format, so that might be the best to use. Writing copies of the PS output routines that draw in a 2D array of pixels shouldn't be all that difficult; not much worse than what the PS routines are doing. Maybe the next time I'm unemployed I'll tackle this. Meanwhile, I wonder if there's any usable scheme to discover the screen size of a web client. To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
You can use JavaScript to get the users resolution, maybe you could use CGI or PHP to grab this information in POST protocol. Just a thought. Dafydd. - Original Message - From: John Chambers [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 02, 2004 7:51 PM Subject: Re: [abcusers] Anyone up for writing a little script? Atte writes: | Dafydd Monks wrote: | | I was thinking of a GIF/MIDI parser really - andone that dose not need the | backed of abc(m)2ps. | | Ok, I see. Would be very cool indeed. Recently I got my ands on a BlackBerry 7280 (cool geek toy ;-), and of course I had to see if I could make it work with my Tune Finder. The browser worked OK. It can display images, so I started converting tunes to GIF and PNG. If they're too big, they get converted to the screen size (240x160 pixels). The result invariably was that some of the horizontal and vertical lines came out a fuzzy smudge. Most were quite unreadable. No problem, you might think; just tell the ps2gif and ps2png image converters to create a 240x160 image. Nope. The only converters that I've been able to find refuse to deal in pixels, as does PS. The best converter that I've found is the one that comes with ghostscript, and it has a resulution arg that is a number without unit. A simple test shows that it is definitely not a pixel count. Resolution is usually measured in pixels/unit-of-lenght, of course, so I calculated the nnumbers for the screen, using inches, mm and cm as the unit-of-length. All were wildly wrong. I eventually found, after hours of experimenting, that a horizontal resolution of 32 and a vertical resolution of 36 produces GIF and PNG images with solid vertical and horizontal lines. The image is a few pixels narrower than the screen, but close enough. The numbers 32 and 36 don't seem to be close to any nuumber that could be called resolution on this screen. Meanwhile, my wife got a Palm Tungsten, which comes with wifi and a real browser. I tried the Tune Finder on it, downloaded a GIF - and it came out about 2.5 times as wide as the screen. Working a tiny little scrollbar while trying to read a line of music isn't the most practical thing in the world. So I'll probably spend some more time writing code to detect that client and discovering the magic numbers that makes the image come out readable on that (320x320) screen. I'll guess that the numbers won't resemble any relating to the 320x320 size of the screen. Now, GIF and PNG are scan-line formats, and deal basically in pixels. What I'm tempted to try is digging into my abc2ps clone and adding some new output formats. Actually, unix systems come with this huge library that converts images to/from the ppm format, so that might be the best to use. Writing copies of the PS output routines that draw in a 2D array of pixels shouldn't be all that difficult; not much worse than what the PS routines are doing. Maybe the next time I'm unemployed I'll tackle this. Meanwhile, I wonder if there's any usable scheme to discover the screen size of a web client. To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
Dafydd Monks writes: | You can use JavaScript to get the users resolution, maybe you could use CGI | or PHP to grab this information in POST protocol. | | Just a thought. Yeah, but sensible users run with JavaScript and all other scripting turned off, so you'd only get the info from clients with little sense. ;-) The recent warnings from the Dept of Homeland Security about IE are just the latest in a long series of warning about what could happen if you browsed with scripting enabled. To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
I've never heard anything about turning scripting off? Is everyone insane? No one in the UK has scripting off. Dafydd. - Original Message - From: John Chambers [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 02, 2004 10:06 PM Subject: Re: [abcusers] Anyone up for writing a little script? Dafydd Monks writes: | You can use JavaScript to get the users resolution, maybe you could use CGI | or PHP to grab this information in POST protocol. | | Just a thought. Yeah, but sensible users run with JavaScript and all other scripting turned off, so you'd only get the info from clients with little sense. ;-) The recent warnings from the Dept of Homeland Security about IE are just the latest in a long series of warning about what could happen if you browsed with scripting enabled. To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
I hate to tell you this, but lots of users switch off javascript. Unlike ActiveX and Java the code that can get executed on the client machine can't be signed and so it much harder to authenticate. It stops sites grabbing registry information on the fly (say my email address), as well as making sure that unexpected code doesn't get executed on my machine. As it happens I tend to leave javascript enabled, but there are quite a few people who switch it off (even ones in the UK). Guy Dafydd Monks wrote: I've never heard anything about turning scripting off? Is everyone insane? No one in the UK has scripting off. Dafydd. - Original Message - From: John Chambers [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 02, 2004 10:06 PM Subject: Re: [abcusers] Anyone up for writing a little script? Dafydd Monks writes: | You can use JavaScript to get the users resolution, maybe you could use CGI | or PHP to grab this information in POST protocol. | | Just a thought. Yeah, but sensible users run with JavaScript and all other scripting turned off, so you'd only get the info from clients with little sense. ;-) The recent warnings from the Dept of Homeland Security about IE are just the latest in a long series of warning about what could happen if you browsed with scripting enabled. To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
On 1 Jul 2004, at 06:43, Atte André Jensen wrote: Dafydd Monks wrote: Anyone out there up for writing a little ABC processor (midi and GIF) in PHP? You mean like this: http://www.atte.dk/abc/ I submitted a minimal abc tune to this to try it out: X:1 T:test C:nobody M:C K:C ABcd ABcd |] Transpose worked OK (but only into flat keys), but neither Mac Preview nor Acrobat could display the pdf. Both said it was corrupted. I tried the postscript version and Ghostscript barfed on that too. I'd guess this is something going wrong with abc(m)2ps, rather than the php, but you might want to take a look at it Atte. Phil Taylor To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
I was thinking of a GIF/MIDI parser really - andone that dose not need the backed of abc(m)2ps. I know it's possible - there's a midi class out there, and GD could be used to create the GIFs. Acrobat PDF is not really a requirement, I only want to be able to provide my users with sheet music embedded into a html (or from a database) page. and let them play a midi file - if they want anything else they can put the ABC through ABC2WIN or one of those kind of programs. I still think this would be a worthwhile excercise - all PHP. If you look at the source to abc(m)2ps or another command line program like this, it's only a matter of converting everything to PHP. (which of course is better as it can run on any server with PHP, my web host won't let me install any of the command line routines that are in compiled C) Dafydd. - Original Message - From: Phil Taylor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 01, 2004 2:21 PM Subject: Re: [abcusers] Anyone up for writing a little script? On 1 Jul 2004, at 06:43, Atte André Jensen wrote: Dafydd Monks wrote: Anyone out there up for writing a little ABC processor (midi and GIF) in PHP? You mean like this: http://www.atte.dk/abc/ I submitted a minimal abc tune to this to try it out: X:1 T:test C:nobody M:C K:C ABcd ABcd |] Transpose worked OK (but only into flat keys), but neither Mac Preview nor Acrobat could display the pdf. Both said it was corrupted. I tried the postscript version and Ghostscript barfed on that too. I'd guess this is something going wrong with abc(m)2ps, rather than the php, but you might want to take a look at it Atte. Phil Taylor To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
Dafydd Monks wrote: I was thinking of a GIF/MIDI parser really - andone that dose not need the backed of abc(m)2ps. Ok, I see. Would be very cool indeed. -- peace, love harmony Atte http://www.atte.dk To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
Re: [abcusers] Anyone up for writing a little script?
Dafydd Monks wrote: Anyone out there up for writing a little ABC processor (midi and GIF) in PHP? You mean like this: http://www.atte.dk/abc/ -- peace, love harmony Atte http://www.atte.dk To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html