Playing midi in java

hi i am making a little pokemon-like game for my younger brother and i want to know the simplest way to play a midi file over the game.
i have a thread all set up and the midi file. I just need the code which will play it.
please help me, thanks

wow thats kinda long and also for .wav files!
is there no simpler way of playing midi?

Similar Messages

  • How to play midi and update graphics at the same time?

    hello
    I want to begin playing a midi file and then immediately while the music is still playing I want to update the screen, for ex. panel.update();It now seems that that whole screen freezes until the music has finished. How can I simultaneously update UI and play midi. Please help. Thanx!
    -Wonderful-

    http://www.google.com/search?q=java+thread+tutorial
    Plenty of tutorials and examples out there.

  • How to play *.mid files

    Hi guys,
    I have a *.mid file "test.mid" and i want to play it on the wtk2.
    1-How can i play *.mid file?
    2-How can i make this mid file loops,and how can i stop it?
    3-How can i play another *.mid file(very small one 1-2 secondes) will the big one is being played (and looped)?
    I would realy apreciate if someone help me!
    Thanks.

    You can play midi files using the MMAPI. Here is a small example for how to play a midi file:
    import javax.microedition.media.*;
    import java.io.*;
    try{
        Player player;
        InputStream is = this.getClass().getResourceAsStream("/test.mid");
        player = Manager.createPlayer(is, "audio/midi");
        player.realize();
        player.start();
    }catch(Exception e) {
        System.out.println("Error: " + e.toString());
    }You can find a great tutorial from here:
    http://www.awprofessional.com/articles/article.asp?p=375708&seqNum=2&rl=1

  • Cant play MIDI

    How come java applets can no longer play MIDIs? Is there a way around this problem?
    Stuff like
    AudioClip clip=getAudioClip(getCodeBase(),"clip.mid");
    clip.loop();no longer works in java 1.6+

    That code as it stands is not correct. This works, but may not be what you want.
    AudioClip clip = Applet.newAudioClip(new URL("file:///absolutepathname.mid"));
    clip.loop();

  • Itunes 10.7 not playing MIDI files

    ITunes 10.7 is not playing midi files (.mid).  I often play MIDI files and convert them to MP3 files using iTunes. Has Apple stopped supporting playing and converting MIDI files in iTunes? 
    When I try to open a MIDI file in Quicktime 10.2, it also does not play MIDI files. I do get a message that Quicktime 7 is required to play midi files.
    I sure hope this is changed in future updates of  iTiunes and Quicktime.
    Tom R.

    I don't think this is the complete picture...  I have tried importing midi files into iTunes 10.7 on three different computers, and it worked on one, not the other two.  The differentiating factor? Seems to be the operating system:  it worked on the one with Snow Leopard but not on the ones with Mountain Lion.  I don't have a computer with Lion to test on, unfortunately.  This might be an actual bug, or temporary omission, from the build for Mountain Lion.  Worth filing a bug report, anyway - since it's free and the more people report it the higher priority we might hope it gets?  http://bugreport.apple.com/

  • How do i play sound in java??

    hello,
    How do i play sound in java??
    im new to java
    thanks,

    There are crude abilities to play sound in the core of java. If you really want to make good sound apps though you should look at the JMF.
    http://java.sun.com/products/java-media/jmf/

  • HOW to play flash inside java application program

    Do java provide any API for playing flash inside java application ?Pleae give me some help about it .Thank You ..

    pingyi wrote:
    Do java provide any API for playing flash inside java application ?Pleae give me some help about it .Thank You ..bro... I found out there from the internet... but you need to purchase it.
    hope it meets your expectation...
    JFlashPlayer is a Flash Player API Java package that lets developers play and interact with Adobe? Flash Player movies within Java applications. Advanced animations can improve the user experience and add to the professional appearance of an application. JFlashPlayer allows programmers to quickly add Flash movies to their Java application development for Windows.taken from: JflashPlayer

  • QuickTime X opens 7 to play MIDI files

    I've been wondering this for a while, but only recently thought to ask as it isn't that much of a concern. I installed QuickTime 7 on my Mountain Lion installation per the official instructions (I had QuickTime Pro on my old Mac and needed to retain that functionality), and since then when attempting to play a MIDI file QuickTime X closes and opens the file in QuickTime 7. Is this normal, expected behavior?

    Yep.
    QuickTime X can't play MIDI files (and many other older formats) so it passes them off to QuickTime Player 7.

  • What plugin do I need to play midi files in Safari 7.0

    I just upgraded to Maverick and Safari 7.0, and now when I click on midi file links at a website that I have long used, I get an error message saying I am missing a required plugin.  What plugin is necessary to play midi files with Safari?

    http://get.adobe.com/flashplayer/?promoid=BUIGP

  • How to play MIDI files on mac os 10.7?

    How to play MIDI files on mac os 10.7?

    As the owner of the G2M3 codec, Citrix (makers of the gotomeeting products) will be in a better position to help you resolve your problem than anybody here.

  • Can't play mid files in Audigy2

    I have installed my Audigy 2 ZX for months. I found it couldn't play midi files until recently. I had tried to cleansweep both the drivers and Creative's applications several times but no help. It is silent whenever I playback those files. What I noticed that the option of midi playback in Multimedia was blank. I had chosen different options but it return to blank next time.
    Anyone can help? TIA.
    Regards,
    Michael

    It should work.
    . Double-click the speaker icon near the clock.
    2. Select Options>Properties, put dot in Playback circle.
    3. Put a checkmark in the Midi Synth box and click OK
    4. Make sure Midi Synth is not muted and that it's volume control is near the top.
    Of course, you also need a player which will play midi files. Many do, but I prefer
    vanBasco's Player....free at http://www.vanbasco.com/
    Good luck,
    Arnie

  • How to get QuickTime Plugin to play .mid files?

    I have quicktime Plugin installed. It works for playing video files but I can't get it to play .mid files in browser. Firefox asks me to download the file first, even though through options -> application types, I have set it to use the QuickTime plugin.
    I have firefox 22 and quicktime 7.7.4

    Also through MIME settings in QuickTime I have set QuickTime to be associated with .mid and .midi files.

  • Can't play MIDI files on MacBook Pro 10.7.5

    PLEASE help! I'm an old boomer and not too tech-savvy (know enough to get all messed up!).
    I can't play MIDI files on MacBook Pro 10.7.5, and it's driving me CRAZY. I'm trying to play files from this website: http://www.hymntime.com/tch/ (just select a song under the "Titles" link), using Safari and/or Firefox browser -- to no good end!
    What can I buy or add on that will enable the playing of MIDI files??
    Thank you!

    I had heard that MIDI worked in Lion, but don't currently have it to test.
    There's a somewhat involved way to get it working described here, or you may be able to download the files & play them locally.

  • Can't play midi files anymore

    I've upgraded to QT 7.2 and now any midi file I download is unplayable. All I get it "Mac OS error -208". What gives? I use a lot of midi files for my work and now - nothing. Does anyone know a fix?

    I just ran into the same thing. Use to work fine, now it doesn't. I don't play midi often so I can't pin point it, but Michael might be on to something. I checked my log and on Sept. 20 I upgraded to QT 7.2. I just downloaded Mighty MIDI and it plays. Sounds bad though. And it plays find under Windows running on the same computer.
    Here's a link to a working file:
    http://home.comcast.net/~unclespongehead/22.mid
    Can somebody else with QT 7.2 try it and report the results here? TIA

  • Why can't I play midi files in firefox

    When I try to play midi files in firefox, instead of playing the audio I get a pop up box asking me if I want to open the file in quicktime. My quicktime plugin is activated.

    I suggest you go through this archive , it contains same as your concern
    https://support.mozilla.org/en-US/questions/960709
    https://support.mozilla.org/en-US/questions/981602
    hope it helps you

Maybe you are looking for