Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Music Note Rendering

This thread is locked; no one can reply to it. rss feed Print
Music Note Rendering
Korval
Member #1,538
September 2001
avatar

Once upon a time on this board, I mentioned that writing the front-end to a music editor was easier than the back-end. So, I've started writing a music editor (or, at least, the front end).

Unfortunately, I've run into a bit of a snag, visually. How do you draw a note head (let along odd things like quarter rests, clefs, and other music notation things)? I've looked on the internet for similar programs I could leech off of, with no luck.

In particular, I don't want to blit BITMAPs. I want vector graphics, not raster for this. That means lines, Bezier-splines, that sort of thing.

Any ideas/websites/GDI metafiles?

Bruce Perry
Member #270
April 2000

Have a look at NoteWorthy Composer. It's Shareware, but it includes a Truetype font containing the various components of musical notation. I'm not suggesting you steal the font, but it might give you some ideas.

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Trumgottist
Member #95
April 2000
avatar

That's the way the big ones do it too. If you are not familiar with them you should take a moment to see how they do things, download a demo:
Finale is the big one in notation. Sibelius is another highly regarded one.

If a sequencer is more your thing, then Cubase is what you should look at.

They have come a long way in useability, if you look at them you can save yourself from reinventing the wheel.

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

gnolam
Member #2,030
March 2002
avatar

Ahh.. that explains the .sib files in the file section of my choir's yahoo group and why some of the MIDI files have "(sibelius)" in their filename :)

I had this hunch all along that Sibelius didn't compose "Kalinka" ;)

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Korval
Member #1,538
September 2001
avatar

Interfaces, I can design; that's not the problem. What I need is a way to render a note head. I can draw things in Win32. I just don't know the correct spline placement to render a note head, or other musical symbols.

To get that from a program, I would likely need some form of source code. I was just wondering/hoping somebody around here ran into something that I could use to figure this out.

Justin_W
Member #655
September 2000
avatar

Well, I'd say you have four options.
1. Trial and error.
2. Write a mini-paint program that works in splines and such that you want but saves the images you create as the source code needed to generate them.
3. Use Allegro's compiled sprites which is really quite similar and probably faster, though without clipping.
4. Break down and use bitmaps. ;)

Trumgottist
Member #95
April 2000
avatar

It also depends on how picky you want to be, and what kind of program you are making. Do you just want the music to show and be readable, or do you want it to be both correct according to all rules and looking good? (Something to be of help for making music on the computer, like the notation in cheaper sequencers, or something to print music for real musicians.) If the later is the case, I would recommend reading up on music notation - there's a lot to it. I have the name of a good book on the subject in a pile of paper somewhere, I could look it up for you if you are interested. What kind of program are you making?

You say that you can design interfaces. I have two questions: 1) How is your interface going to look? 2) Are you familiar with the existing music software? It has taken the professionals many years (and versions of their programs) to create what finally is easy to use programs.

Technical implementation details is another thing, though, and an area where I am unable to help. (But as I said in my previous post, practically all the big ones use TTF, so it's probably not a bad idea.)

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

Korval
Member #1,538
September 2001
avatar

Quote:

Do you just want the music to show and be readable, or do you want it to be both correct according to all rules and looking good? (Something to be of help for making music on the computer, like the notation in cheaper sequencers, or something to print music for real musicians.)

Ultimately, the program will be a near-professional quality music "sequencer" (I really hate that term, but that is the technical term for an editor that can save music files that can later be played). In terms of the staff view (where you edit music in a note-style format), I want everything to look as much like real musical notation as possible.

Printing is, also, something important. That's why I don't want to use BITMAPs or anything else that can't scale up/down easily.

Quote:

If the later is the case, I would recommend reading up on music notation - there's a lot to it. I have the name of a good book on the subject in a pile of paper somewhere, I could look it up for you if you are interested.

Don't worry about that; I've done my homework. I played an instrument (actually, my last year, I played several) for about 6 years, and I have a couple of books on musical notation already. I'm suprised at how much I forgot from back when I played music, but I picked it up pretty quick.

Quote:

1) How is your interface going to look?

I'm not certain quite yet. I'm still designing the basic staff view; once I get done with that, and have a design that interfaces nicely with a backend data structure, I can move on to plaining the overall interface. I do have a few ideas currently, though.

Quote:

Are you familiar with the existing music software? It has taken the professionals many years (and versions of their programs) to create what finally is easy to use programs.

I used CakeWalk once. The fact that it seemed rather simple (kinda) and that there was no freeware alternative that had anywhere near the capabilites or even a decent interface (and no, trackers don't have a decent interface) convinced me to start this project.

I've alreays felt that music in games was very important. In my games, either I am going to write it, or I'll find someone else to do it. I'm pretty sure that someone else, who is good enough for me to want to work with them, will be unwilling to use anything less than a useful tool. And, if it's me, then I refuse to use crappy tools as well (they get in the way more than they help).

Commonly avaliable professional software can only export to propriatery formats or to .mid files. The effects avaliable to a .mid are rather limitted, and certainly cannot be changed as I see fit. That's the main reason I need to write a tool. Granted, I don't have a backend player yet, but I'm pretty far from needing one. If the interface works, I can find ways to integrate a backend player for it.

Quote:

But as I said in my previous post, practically all the big ones use TTF, so it's probably not a bad idea.

Two questions immediately spring to mind:

1) How do you get fonts to have variable length stems and connected flags?

2) How do you make a TTF?

MoreK
Member #1,855
January 2002
avatar

Korval,
I have been using Cakewalk/Sonar for ten years. Some two years ago I needed better notation cababilities, and found this:

http://www.myriad-online.com/enindex.htm

Worth of checking... There are two French guys behind this SW, and if you have any questions or anything you can always ask them, they are very helpful.

- MoreK -

--------------------------------------------------------------
MoreK, Helsinki
Vompatti

Trumgottist
Member #95
April 2000
avatar

Like the term "sequencer" or hate it, but it's useful to separate the kind of programs like Cakewalk or Cubase from the notation programs like Finale and Sibelius. For a sequencer your notation knowledge should be sufficient since you know how to read music and play an instrument. (If you were making a notation program I would disagree, though. Even I who have studied music a lot would have to read up on the finer details.)

How to make a TTF? I'm not aware of any freeware program that lets you do that, and I have searched.

Stems and note lines will have to be drawn as separate lines anyway, I think. Consider notes tied togerther with a flag. That can't be done using only a font. And if you are going to include ties and slurs then things get really complicated! (I have yet to see a sequencer handle that in a good way.) IMHO you should consider if you really want to bother with the notation part of the program. Maybe you should just do it the traditional sequencer way.

I will be interested to see how your project comes along.

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

Korval
Member #1,538
September 2001
avatar

Quote:

IMHO you should consider if you really want to bother with the notation part of the program. Maybe you should just do it the traditional sequencer way.

If I wanted that, I wouldn't bother writing one. I would take the source to any number of crappy freeware synthesizers on the net and use those.

The ability to edit music on a real musical staff is vital to this project, which is why I'm starting off getting that working first. That is even before designing the internal music data structures or having a back-end player.

I am aware that building staff editing is non-trivial, although so far, with the exception of not having a real notehead, everything seems to be going rather smoothly. The design I envisioned seems to be working well enough, and it seems to be extendable to all kinds of things.

Ultimately, I'd like to have a 3ds Max-like plugin system, where you can create notational elements (say, a new type of fermata, articulation, tie/slur, or even an accidental that doesn't apply to all the following notes of the measure). Such a system would, of course, have to tie into the back-end renderer so that it could actually effect the music.

Quote:

There are two French guys behind this SW, and if you have any questions or anything you can always ask them, they are very helpful.

As helpful as I'm sure they are, I seriously doubt they are going to help me create a competing, free product.

MoreK
Member #1,855
January 2002
avatar

Korval, I didn't put my words well. I was refering your motives to start creating your own interface:

Quote:

I used CakeWalk once. The fact that it seemed rather simple (kinda) and that there was no freeware alternative that had anywhere near the capabilites or even a decent interface (and no, trackers don't have a decent interface) convinced me to start this project.

This Myriad's Melody Assistant is Shareware, but you can use it free as long as you like. And, if you decide to pay the license, it's ridiculous 15 euros. I though you maybe wanted to check out this one before starting your own.... And I didn't mean that you should ask assistance for your own creation, I meant you get a good service as a user there....

--------------------------------------------------------------
MoreK, Helsinki
Vompatti

Go to: