Sign in to follow this  
Promit

Music Rendering Woes (AGH!)

Recommended Posts

Promit    13246
So I’ve begun some preliminary work on a music notating system, Think Finale, rather than MuSTeX. That is, it’s real time processing, not offline rendering. Not surprisingly this is painful work, but it’s turning out to be even more frustrating than I expected. In short, the rendering is done with a true type font, where what would normally be roman characters of various sorts are instead musical characters. There’s no standard layout for these fonts; for the moment I’m using the Maestro font which is installed with Finale Notepad, as well as another called Jazz (a Finale compatible font that looks handwritten like a fake book). I’ve chosen Finale’s fonts because I figured it’s probably the closest I can get to any sort of industry standard here. The problem is that the horizontal spacing is totally bogus. For some of the clefs and things it’s acceptable, but the accidentals, for example, have absolutely no padding on their edges, so they just rub right up against their accompanying notes. How the heck am I supposed to determine the correct spacing, and scale it cleanly with the font size? I've tried so many different versions of this, all with varying but wrong results. It seems to me that if I ask for the string "Iq" to be drawn on screen (that's a sharp symbol followed by a quarter note), the spacing ought to work itself out. It doesn't -- the quarter is right up against the sharp. (Drawing the sharp and the quarter as two seperate strings and using MeasureString as a horizontal step size moves the sharp too far away.) As a result, I don't know of any robust way to cope with this. Hard coding values is out of the question; I want independence of the specific font being used and the size of the font. As far as I can tell, this kind of thing isn't documented on the net, period. The only OSS I've found is geared towards TeX style offline processing (and I'm not sure I want to go into those sources). Things are further complicated by the fact that no default spacing is necessarily correct; if you have a chord with a ton of accidentals on it, they're going to be pushed outward. I don't know if there's any standard way of determining these things, or how much I can rely on the font's glyph data to help me out. Personally I'm inclined to answer myself with "not at all" on the last count; musical layout seems heavily dynamic. I just don't know what to do.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I had a similar probelm rendering chinese fonts for a work project. The chinese characters were double the width of the roman ones. The solution was to change the font width on the fly, and print the characters one by one at the right location. It's a bit messy but it works. It looks crap for the written word but for musical notes it should be okay.

Other than that you could always make your own font rather than using the maestro one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this