Anybody knows how to get the following imformation from a midi file?

E

edward.chow

I'm attempting to make an applet for analyzing features of midi
files.
Anybody familiar with the APIs in javax.sound.midi package?


I've already been capable of getting the tempo of a file, but i met
some problems in connecting an object of Sequencer with an object of
Synthesizer.

I'll be glad and grateful if anybody knows how to get the instruments,
rhythm(whether 4/4 or 3/4 or etc.) and the pitch of each note from a
midi file using java APIs.
 
G

Gavino

edward.chow said:
I'll be glad and grateful if anybody knows how to get the instruments,
rhythm(whether 4/4 or 3/4 or etc.) and the pitch of each note from a
midi file using java APIs.

Use MidiSystem.getSequence() to create a Sequence from the File.
From the Sequence object, use getTracks() to extract the constituent tracks.
Then you can extract the individual MidiEvents from each track (using
get()), and analyse them to extract information about the notes, etc.

See the javax.sound.midi API docs for details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top