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

Discussion in 'Java' started by edward.chow, May 28, 2011.

  1. edward.chow

    edward.chow Guest

    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.
     
    edward.chow, May 28, 2011
    #1
    1. Advertising

  2. edward.chow

    Gavino Guest

    "edward.chow" <> wrote in message
    news:...
    > 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.
     
    Gavino, May 31, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    2
    Views:
    573
    Steve
    May 5, 2004
  2. GS
    Replies:
    0
    Views:
    402
  3. Hugo Villeneuve

    Java MIDI output device to MIDI Yoke.

    Hugo Villeneuve, Jul 4, 2003, in forum: Java
    Replies:
    0
    Views:
    964
    Hugo Villeneuve
    Jul 4, 2003
  4. Gilly
    Replies:
    6
    Views:
    434
    Ken Starks
    May 4, 2008
  5. Asbjørn Bjørnstad
    Replies:
    0
    Views:
    446
    Asbjørn Bjørnstad
    Oct 9, 2008
Loading...

Share This Page