OT - Most important features of a note insertion program

Have questions? Just saying hello? This is the place.
No explicit, hateful, or hurtful language. Nothing illegal.
Post Reply
Pianotehead
Posts: 325

Post by Pianotehead »

Hi, I'd like to ask you fellow Synthesians for a help regarding an assignment I'm taking in a computer science course. We are supposed to make some GUI software.

I chose to make a note insertion program, something that many of you are familiar with, Finale, Sibelius, Notation Composer and MuseScore, to name a few. Of course it'll not be as powerful as those mentioned, just with some basic features.

So I'd like to ask you a few questions about notation programs, and would be very thankful if you took the time to answer.
  • What are the most important features a note writing program should have?
  • Would you want it to be able to make XML files or read from XML files?
  • Is it important to be able to save to or read from MIDI files?
  • Do you prefer to insert notes by clicking icons with the mouse or would you rather like to use keyboard shortcuts?
  • Is it important to insert directly into a music sheet? (Other possibilities might include typing the note as a few fields, like pitch name, which octave and note length. As an example a quarter note middle C would be C - 4 - 4, C note, octave 4 and length 4.)
  • Would you like to be able to hit a note on a virtual keyboard and let it be mapped to it's right place on a music sheet?
With thanks in advance.
Raymond
Posts: 528

Post by Raymond »

  • What are the most important features a note writing program should have?
    Adding/Removing notes. :roll: Moving notes are useful as well.
    Selecting notes, Transposing.
  • Would you want it to be able to make XML files or read from XML files? No.
  • Is it important to be able to save to or read from MIDI files? Yes.
  • Do you prefer to insert notes by clicking icons with the mouse or would you rather like to use keyboard shortcuts?
    Both. I use the mouse for touch ups.
  • Is it important to insert directly into a music sheet? With the mouse it would be.
  • Would you like to be able to hit a note on a virtual keyboard and let it be mapped to it's right place on a music sheet? No
User avatar
stephenhazel
Posts: 223

Post by stephenhazel »

HERE's a topic near and dear to my heart :D


> I chose to make a note insertion program

You chose a VERY tough task for your first gui program.
I would recommend something simpler like editing text, or pixels.

The GUI and file editing a music app has to do is NOT for beginners.
I'd recommend starting with piano roll format.
Sheet music format is EXTREMELY difficult.

> What are the most important features a note writing program should have?
load midi files, display on screen in either piano roll or sheet music format (or both),
play the notes out midi, record notes from midi, save back to a midi file.
Playing the notes out midi involves using a high resolution timer and
converting the milliseconds to music time by current tempo.


> Would you want it to be able to make XML files or read from XML files?
no. midi is the standard file format for music.
the midi format allows for extensions, but they're non-standard.
Such as storing fingering - there's no standard way to do that, but you CAN
stick the info in a midi file.

But if you're asking specifically about your project, then YES.
xml files are a breeze to load. midi files are VERY difficult.


> Is it important to be able to save to or read from MIDI files?
(just answered that)


> Do you prefer to insert notes by clicking icons with the mouse or would you rather like to use keyboard shortcuts?
Both. And you'll need to be more specific. Clicking what? which button? which screen location?
pressing a key during what conditions?
And you have a full midi keyboard with 88 velocity sensitive buttons and tons of sliders and pedals at your disposal.
This is also the input device that's CLOSER to your user than the keyboard or mouse.


> Is it important to insert directly into a music sheet?
> (Other possibilities might include typing the note as a few fields, like pitch name,
> which octave and note length. As an example a quarter note middle C would be C - 4 - 4, C note, octave 4 and length 4.)

As I mentioned, sheet music format is EXTREMELY difficult to do right.
Read a book called "Behind Bars" - it's pretty dang thick.
It's something you can hope to do in about 3 years :shock:


Google "piano roll" to see a grid format for music that's much easier to do.
Similar to Synthesia bar notes, but not moving, and more compressed so you can
see more of the whole song.

In addition to note,octave,duration, there are other things to track per note:
time (bar, beat, "ticks"), noteDown velocity, noteUp velocity, track.
And for a given track, there's sound, balance, volume, device, holdpedals (and more...)
There's also overall time, tempo, time signature, key signature, chord symbols, dynamics markings, lyrics.
And that list ain't complete :o


> Would you like to be able to hit a note on a virtual keyboard and let it be mapped to it's right place on a music sheet?[/*]

Yes. That's the most basic part of a note editor. Even your simple app will HAVE to do this.
(And it's much easier than reading/writing .mid files or displaying/editing notes.)


> With thanks in advance.

I wish you good luck. That's the path I started down a loooong time ago.
It's a WONDERFUL path. But a long one.
Start with something extremely simple.
Figure out how to open a midiin device and record note info to memory.
Get it DONE, then add:
Display it in piano roll format, maybe just the first bar or something.
Get it DONE, then add:
Save/Load it in your own custom XML format.
(Get it... you get the idea...)
Allow some sort of "pick a note, update a note" capability.
The computer friendly route, not the user friendly route :)

If you keep AT it for long enough, you'll end up with something
similar to Synthesia or Sibelius or PianoCheater or MuseScore.
Although, probably with your own peculiarities.
All of these programs are a little bit different focusing in SOME
areas and not in others.
Music software is AWESOME !!
At least start on it. It's been my hobby for many many years, and it's a great one.

When I was a high school kid, I thought hmmm, do I wanna go down the
music app route? Or the graphics app route?
Graphics is destined for 3d and tons of math.
Music, eh, not so much math - I'll go that route.
That was a rather simplistic decision way back then, but it turned out to be the RIGHT one :D

Also, I think Nicholas has some public domain midi i/o code from an earlier
version of Synthesia... I'm sure he'll chime in if he hasn't beat me to the reply already :)
Pianotehead
Posts: 325

Post by Pianotehead »

Thank you for your contributions, Raymond and stephenhazel. Raymond, that sounds logical for a notation program to have as a feature - adding and removing notes! Still, everything has to be mentioned, no matter how self explanatory it is.

A very informative post from someone experienced in the field stephenhazel. Much appreciated.

A bit disappointing though, to read that I've undertaken a hard task. We were actually given four choices. 1) A calculator, 2) a drawing program, 3) a calendar with a possibility to add tasks and finally 4) something else, but had to get the consent of our teachers. Obviously they have no background in music/software. :oops:

I can actually skip the sheet music part, if it's that difficult. Still I'd like to ask you (stephenhazel) about something. You say that the sheet music part is extremely difficult, yet you say that my program will have to be able to map from a virtual (or MIDI) keyboard to sheet music. Isn't that just as hard as making the notes appear as reaction to mouse or computer keyboard events?

Another thing, is it hard to grab and react to MIDI events, as opposed to creating action listeners grabbing mouse or (computer) keyboard events?

Thanks again you guys, I really appreciate your help.
User avatar
stephenhazel
Posts: 223

Post by stephenhazel »

> We were actually given four choices. 1) A calculator, 2) a drawing program, 3) a calendar with a possibility to add tasks and finally
> 4) something else, but had to get the consent of our teachers. Obviously they have no background in music/software.

Ok, for more detail, you'll need to tell me which language/OS you're using.
I'm guessing C# on windows?
The 3 things mentioned sound like something c# was designed for - basic gui apps.

I'm using c++ and straight win32 API. I think Nicholas is using c++ and a custom DirectX sort of GUI.
We use that because it's good for high performance midi I/O.
It's NOT as good for a beginner GUI app.

> You say that the sheet music part is extremely difficult,
> yet you say that my program will have to be able to map from a virtual (or MIDI) keyboard to sheet music.
> Isn't that just as hard as making the notes appear as reaction to mouse or computer keyboard events?

I meant to say that if you'll be writing a note editing program, you'll probably want to be able
to read from a midi in device. Not necessarily put the note into sheet music notation, but into piano roll notation.

So, I guess my advice is to take a SMALL bite instead of
trying to write a program that does a kajillion different things like a song editor.

If the assignment is for a simple GUI app, start with, well, a simple GUI app.
Just keep in mind that a program that does a kajillion things starts as a program
that does ONE thing, gets done, then does another, gets done, etc.
Eventually, it does a kajillion things.


> Another thing, is it hard to grab and react to MIDI events, as opposed to creating action listeners grabbing mouse or (computer) keyboard events?

"Action listeners", eh? Maybe java? Probably java I'm guessing.
I don't know java or c# well.
But to answer your question, nope - not as easy. You'll probaby have to read up on midi a great deal before
you can figure out why the APIs are the way they are.


So try something simpler to get a decent grade.
But start a project on your own outside of school for something like a song editor :)
Or whatever else that you like. Robots?
If you want to be a programmer, nobody will take you seriously unless you have a
"pet project" that's all your own.
Pianotehead
Posts: 325

Post by Pianotehead »

Thanks SH. Yes, Java, the teacher recommended it over C#. I've only studied those two, we were taught about C for the first three or four weeks, just some basic stuff.
Raymond
Posts: 528

Post by Raymond »

Iv been messing with MIDI and Java. It is a little different then keyboard/mouse.
Although doesn't seem to be much documentation for MIDI. Unless you just want to load and play a MIDI file. :roll:

MIDI files and everything is built in. So it's not too bad. ;)
Pianotehead
Posts: 325

Post by Pianotehead »

I never took the time to thank you guys, so I'll do it now and can say that you helped me a lot. I've started writing my program and thought I'd show you what I have, a piano made of buttons. Actually I got the bulk of it from stackoverflow.com :oops: but the ActionListener is mine.

This virtual piano is not making any sounds, I haven't reached that stage yet and probably won't in this assignment. See attached file. It's a Java code file, but for some reason I couldn't upload the file with .java ending, so I changed it to a .txt file. Regards.
Attachments
storaVP.txt
(1.78 KiB) Downloaded 227 times
Pianotehead
Posts: 325

Post by Pianotehead »

Just wanted to show you guys the final version (I think) of my Java assignment, for which I got 10 (A in the American system.) I only uploaded the Java file the first time, which is no good because there are a lot of helper files. Here's the whole package.

http://theodorn.blog.is/users/28/theodo ... /stora.zip

It should work if you unzip it to the the folder C:\Java, works only on PCs. You can run it from the command prompt like this

C:\Java (- must be this folder -) java storaVP

The program opens a window with a keyboard of four or five octaves and you can click with the mouse on the notes. Hope it works, worked on my system and you can use this code without restrictions (if it's of any use.) If you click the button Spila it plays what you've inserted and clears the buffer. If you click Vista XML it saves the song into an xml-file, which can be read by MuseScore. Beware not to click Spila, before saving to xml, because by that you clear the buffer. So Vista XML only saves the notes played from the last Spila.

I'd be thankful if you programmers would tell me what you think. Again thanks to StephenHazel and Raymond for their help.
User avatar
stephenhazel
Posts: 223

Post by stephenhazel »

Good for you!!

I think you probably have to set the dang classpath env var, too, eh?
(see java whining below)
Although I may not find time to play with it, I'm glad you chose to pursue midi !!
Don't give up - there's LOTS of cool stuff to do.
software synthesis, sequencer stuff (recording/storing/playing midi - like your thing here),
notation and so forth.
I find it TOTALLY AWESOME :)

Good luck to ya - and keep workin' on it :mrgreen:


C:\_\Temp\stora\stora>java storaVP
Exception in thread "main" java.lang.NoClassDefFoundError: Queue
at storaVP.main(storaVP.java:29)
Caused by: java.lang.ClassNotFoundException: Queue
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
Pianotehead
Posts: 325

Post by Pianotehead »

Thanks Stephen, sorry it didn't work (did you try compiling it again, with "javac {filename and path}?) Yes, I probably had to mess with the classpath/system environment variable, can't remember for sure because it was four months ago and on a different computer.

C:\Java had to be in the classpath, maybe also C:\Java\stora (where the zip file is supposed to be unzipped.) This is probably too rigid even for another programmer to try out, but I'm a noobie in all this stuff, an absolute beginner. I know there's an easier way to make the code work independent of the path where it's put, but I just don't know how. Thank you for taking the time to try.

Hopefully I'll have time to pursue MIDI/musical programming, as it's not part of my studies formally. I might squeeze it in again as I did in the spring semester.
User avatar
stephenhazel
Posts: 223

Post by stephenhazel »

i think the .class files in subdirs need to be found, and java needs a classpath set to include the subdir with the .class files (compiled .java => .class, right?)

Anyways, working on midi isn't my job, but it IS my hobby (which i prioritize QUITE a bit higher than my job:)
Pianotehead
Posts: 325

Post by Pianotehead »

I think you're right, first all my code was just in one folder, but when I needed to put it in subfolders, as in this assignment, things started to go wrong. That is, new things started to go wrong, the old things kept going wrong. :D
Raymond
Posts: 528

Post by Raymond »

Ya I couldn't get it to run. (I might try using eclipse later)

It's good to hear everything worked out good! :D
Pianotehead
Posts: 325

Post by Pianotehead »

Thanks Raymond. I think I know what the problem is. The code has to reside in C:\Java, in the folder Java immediately under the root, C. I got exactly the same error message as Stephen, when I ran it from C:\Java\stora. Here's the session from my command line, (hopefully) showing this.

C:\Users\Andrea>cd..

C:\Users>cd..

C:\>cd Java

C:\Java>cd stora

C:\Java\stora>java storaVP
Exception in thread "main" java.lang.NoClassDefFoundError: Queue
at storaVP.main(storaVP.java:29)
Caused by: java.lang.ClassNotFoundException: Queue
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more

C:\Java\stora>javac storaVP.java
'javac' is not recognized as an internal or external command,
operable program or batch file.

C:\Java\stora>cd..

C:\Java>java storaVP

C:\Java>java storaVP

C:\Java>

If anyone is curious as to how the code works, this is the way. Just copy everything in the zip file into C:\Java. Everything that is in the folder stora, which is made by unzipping stora.zip.

But don't do it if you already have a file named C:\Java with a lot of your own code, it might get mixed up with your own programs. Don't want to mess up someone else's code, made by hard work! I might make a video showing how my primitive program works.

Sorry for a too long post!
Pianotehead
Posts: 325

Post by Pianotehead »

Probably need to have these files as well in the same folder as the rest of the code. That's what the compiler is complaining about in the error messages.

http://theodorn.blog.is/users/28/theodo ... queue.java

http://theodorn.blog.is/users/28/theodo ... ueue.class

Hope you enjoyed this programming exercise....
Raymond
Posts: 528

Post by Raymond »

Yup I was jsut missing those files. ;)
It looks good!
Pianotehead
Posts: 325

Post by Pianotehead »

Thank you, glad it finally worked. Spila = play, Vista XML = Save to XML and Þögn = Rest. Translation for the buttons, not wise to have them in Icelandic, when distributing internationally!
Post Reply