Take the 2-minute tour ×
Musical Practice & Performance Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

I'm currently writing a software application which creates notes on a staff, when a piano key is pressed. Unfortunately I have no background in music, and thus am finding it quite hard to get started.

Could someone kindly tell me if the following screenshot represents what it would look like on the staff (approximately) if someone presses all the white keys on a 25-key keyboard (15 white, 10 black) from left to right, and then from right to left?

Am I on the right track, or is this completely wrong? (The notes are just displayed as circles for now - im trying to get the positioning right).

share|improve this question
2  
Your vertical spacing is a little wiggly: make sure you're rounding the device coordinates. If the "space" notes can't be perfectly centered, they should hug closer to the line below (gravity). –  luser droog Dec 14 '11 at 7:14
4  
You need a reference on musical notation; the one I always have next to my monitor is the Essential Dictionary of Musical Notation, published by Alfred: amazon.com/Essential-Dictionary-Music-Notation-Practical/dp/… –  Iain Hallam Dec 26 '11 at 14:03

6 Answers 6

up vote 9 down vote accepted

The vertical positioning is almost correct, although every dot should be either exactly between two lines, or exactly vertically centred on a line. The top F is OK (assuming this is a treble stave) but by the time you reach the E at the bottom of the clef, positioning errors have accumulated and it's difficult to tell at a glance where the note is supposed to be.

Horizontally, I would say that a musician would normally expect the notes to be more widely spaced.

Typesetting music is analogous to typesetting words. You can reasonably easily come up with something that isn't "wrong", but is the music equivalent of a printing an essay in Courier New.

You can go a step further and get something that's the musical equivalent of using a nicer font, but being naive about kerning and aliasing.

To get something that's comparable to a professionally produced score -- or the typesetting of something like TeX -- that's the domain of people who are both extremely talented software developers and musicians and to some extent artists.

Most software that produces stave output doesn't aspire to that level of quality, mind you. Stuff like GarageBand or Cubase is somewhere in the middle. Lilypond aims high, but acknowledges that perfection is a long way off. Sibelius aims high, and gets the brightest and best to work on it.

share|improve this answer
    
If this is not a homework problem, you might be better off using existing software. JTab is a JavaScript/SVG solution. GNU Lilypond is a serious notation tool. –  slim Dec 13 '11 at 15:28
    
The vertical positioning is wrong considering that he played 25 notes straight (15 white, 10 black). For example: F and F# have the same vertical position in most key signatures. And I prefer Lilypond over Sibelius... xD –  Victor Dec 13 '11 at 15:29
1  
No, he only wanted the white notes. "presses all the white keys on a 25-key keyboard" –  slim Dec 13 '11 at 15:33
    
True, my bad, I misread it. Edit your answer so I can remove the my down vote. –  Victor Dec 13 '11 at 15:35
    
Heh, no probs. BTW I've never used Sibelius, but I've seen one of the programmers do a presentation on some of the problems they have to solve typesetting scores. –  slim Dec 13 '11 at 15:37

Hire a piano teacher and take a short introductory piano course. You will understand lots more about notation after that, and you may get useful hints by discussing your software with the teacher.

Maybe you would be a strange student, so tell the teacher in advance about your goals.

share|improve this answer

As a pianist I balked immediately upon seeing your image, mainly because the notes do not have exactly the same diameter as the vertical distance between the lines; and some of the notes do not line up perfectly centered on the line or in the space between.

The absolute worst is the 4th and 5th dots from the left. One seems to be hanging off the bottom line, and the next is sitting on top of the line; both are very ambiguous.

Each note must:

  1. have a vertical height equal to the vertical distance between two lines of the stave; and preferably have the same width (or perhaps slightly wider)

  2. be either vertically centered on a line (e.g. for E, G, B, D and F, if this is a treble), or touching but not overstepping both lines (e.g. for F, A, C and E). For notes outside this range, the note should be positioned as if there were extra stave lines to hold it - and indeed, for notes lower than D and higher than high G, you must add extra horizontal staff lines (ledger lines) for that note. See for example: http://en.wikipedia.org/wiki/File:Cifrado_americano.JPG

enter image description here

To test your scheme, you should generate a random series of notes (not in the smooth progression you have there) and give them to a musician or singer to read. Ask them if they can read the notes easily and unambiguously (of course, to do this you'd also need to add a clef).

More info: http://en.wikipedia.org/wiki/Staff_(music)

share|improve this answer
    
Lower than D (C# needs a ledger line)... and higher than G (Ab does too)... on the treble clef. –  David Axtell Moore II May 28 '12 at 22:51
    
@DavidAxtellMooreII - thanks, corrected –  Jeffrey Kemp May 29 '12 at 0:19
    
I just figured you were transposing from a different Clef or something... have a good one. –  David Axtell Moore II May 29 '12 at 1:18
    
Can't remember what I was thinking at the time :) –  Jeffrey Kemp May 29 '12 at 2:06

You are trying to find simplistic answers to a relatively complex subject. At the very least you should go to a music store and purchase a beginning piano book or a beginning music book for children or adults and study the basics of how music is notated.

By way of example, I do not think you would be successful at writing a computer program to display Chinese calligraphy on a computer screen if you were completely ignorant of how brush strokes are used in Chinese characters, and you thought you could accomplish the task without learning the basics of Chinese brush strokes.

Read a book or consult with a piano teacher.

And with regard to your diagram, you have failed to distinguish which octaves your 25 pitches are located in. This must be designated by the correct clef signs and ledger lines. Furthermore, piano music is notated on two staves, not one. Here is an example.

enter image description here

share|improve this answer
1  
Good example. If he wants real challenge/kick in the pants, I'd suggest the first few chapters of Paul Hindemith's "Elementary Training for Musicians". –  NReilingh Dec 24 '11 at 23:29
1  
It's important to note that in most contexts even when one has a treble and bass cleff adjacent to each other, a melodic line which starts in the treble cleff and descends down a little below middle C and then goes back up will often be notated using ledger lines attached to the treble cleff, and likewise with the bass cleff for lines which go slightly above middle C and go back down. –  supercat Jan 26 '13 at 0:20

You are not completely wrong.

  • The size of the dots needs to be larger, so that one note fits exactly between two lines.
  • The notes must be exactly centered on a line, or fitting exactly between two lines.
  • The dots should not be circles, rather tilted or skewed ellipses. See the examples at http://en.wikipedia.org/wiki/Musical_notation .
  • The notes lower than the one below (but touching) the lowest line must have ledger lines (see ledger lines on wikipedia). Same thing above the staff.
  • If you need to notate rythms, the distance between dots is dependent on the length of the tone, but not quite proportional. The rules are very complicated there, and somewhat subjective. If you only need to notate pitch, you should space the dots a bit more for readability anyway.
  • You need a clef. A dot at a given position does not always mean the same, depending on the clef. See Clef on wikipedia.
share|improve this answer
    
I'm not sure, but whether it's drawn as an ellipse or a circle shouldn't matter - more of a style thing I think. Maybe ellipses are slightly easier to read. –  Jeffrey Kemp May 29 '12 at 0:24
    
I have yet to see any printed material with circles (or rather discs), I have only seen that in beginners' handwriting. –  Gauthier May 29 '12 at 11:54
1  
Agreed, and I wouldn't be very impressed by printed material that didn't use the elliptical shape. Just saying it's not essential for comprehension; certainly not as important as placement. –  Jeffrey Kemp May 31 '12 at 3:25

Well, if you don't have any musical background, you should read about it. It's more complicated then it looks. Search for lilypond, or go for "musical notation" in wikipedia.

http://en.wikipedia.org/wiki/Musical_notation

By the way, your result is wrong.

share|improve this answer
    
I've been reading about it but cannot find anything simple enough for the scope of this project. Do notes always start from the very left on the staff, or do they have a fixed position on the 'x axis'? –  123 Dec 13 '11 at 15:09
1  
@Sean, well, that's important info. You're reading on the wrong places. Google something like "how to read music". The position and symbols that complement a note depends on which clef and which key signature you chose. –  Victor Dec 13 '11 at 15:13
6  
agreed; if you don't have time to understand the problem domain, you don't have time to code it. –  slim Dec 13 '11 at 15:23
3  
@Sean music notation is not a simple thing. Compare it to learning a new language; there isn't going to be a simple 5 step tutorial for you. My suggestion is to immerse yourself in musical scores until you can see all the intricacies of the notation. –  Reina Abolofia Dec 13 '11 at 17:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.