This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Do you mean the frequencies of different notes? Try this.
Joined: Mar 28, 2008
Unfortunately no. I'm trying to figure out the mystical numbers that ShortMessage's setMessage method use to set things like the instrument and the note played. I figure that 71 is a B (I don't have full perfect pitch, but I can recognize Bs), and that the notes increase by half steps for each number, but I don't know if there is a cheatsheet I could use to just look up the note I might want.
Ironically, I'm writing this software for two reasons, one just being to familiarize myself with the javax.sound.midi package, the other to write software to help me work on perfect pitch and ear training, yet I'm using my small amount of perfect pitch to write the software to help my perfect pitch!
Hello - I've been experimenting with the java MIDI interface for a couple days, and I think I can help you out. The note values are fairly straightforward - the note C4 is 60, and it increments/decrements one step per digit. For example, 59 is a B, 61 is a C#/Db, 62 is a D, 69 is a 440 Hz A, etc. If you prefer a visual reference, this page has a picture of a keyboard with all they notes & MIDI values filled in: http://phys.unsw.edu.au/jw/notes.html
The instrument values can be a bit trickier - the "standard" MIDI instrument list can be viewed here: http://somascape.org/midi/help/gmins.html - however, what you actually get can vary depending on what your MIDI device has loaded in it. The java installation on my linux box, for example, has a default soundbank with 410 different instruments! The first 128 of them appear to match up with the standard MIDI list from the above page, but I just gave it a quick look over - I didn't verify all of them. Here's a small class that will show you all the instruments included in your default soundbank:
I hope some of this helps, let me know if there is anything else I can try to answer.
Joined: Oct 13, 2005
Welcome to JavaRanch, Antonin Petrovich ( ) and thank you for finding the required information.