PDA

View Full Version : Midi Player


cooly291
03-18-2005, 01:19 AM
Hi, I have over 700 midi's on my site, I would like to have some kind of player, very simple, that will play the midi's on the site, instead of teh windows media, etc. Any suggestions?

tboss132
03-18-2005, 08:26 AM
deleted

tboss132
03-18-2005, 08:27 AM
Do you want users to download the player and then play the file? I think media player is still your best option as most users already have it on their sys. You could look into realone but i'm not sure it plays midi.
Btw, what's your site address?


Hey I forgot. You can make a player from Flash and put that on your site. That way, users don't have to download anything. They don't even need to see the file

JamieR
03-18-2005, 10:29 AM
You can use flash's media components in flash mx 2004 professional to create a dynamic Midi/mp3 player. The media components do most of the work for you.

cooly291
03-18-2005, 09:23 PM
the site is http://zeldalinks.net

I haben't updated the site to the new midi link..........I did find a nice javascrit. The page with the midi player is:

http://www.zeldalinks.net/midis/twwmidis.php

it is a pop-up, exactly what I wanted ^_^!

kb9agt
12-12-2008, 09:40 PM
hI,

I built a java applet to play MIDI scripts. The code is:

import java.applet.Applet;
import java.awt.Graphics;
import java.io.IOException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiUnavailableException;
import javax.sound.midi.Sequence;
import javax.sound.midi.Sequencer;

/**
*
* @author KB9AGT
*/
public class MidiApplet extends Applet {

Sequencer sequencer = null;
Sequence mySeq = null;

// MIDI file loader.
public static URL getMidiFileURL(String fileName) {
ClassLoader cl = MidiApplet.class.getClassLoader();
URL resourceURL = cl.getResource(fileName);
return resourceURL;
}

@Override
public void init() {

try {
mySeq = MidiSystem.getSequence(getMidiFileURL("brown.mid"));
} catch (InvalidMidiDataException ex) {
Logger.getLogger(MidiApplet.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(MidiApplet.class.getName()).log(Level.SEVERE, null, ex);
}
try {
sequencer = MidiSystem.getSequencer();
} catch (MidiUnavailableException ex) {
Logger.getLogger(MidiApplet.class.getName()).log(Level.SEVERE, null, ex);
}

if (sequencer == null) {
// Error -- sequencer device is not supp
// orted.
// Inform user and return...
} else {
try { // Acquire resources and make operational.
sequencer.open();
} catch (MidiUnavailableException ex) {
Logger.getLogger(MidiApplet.class.getName()).log(Level.SEVERE, null, ex);
}
sequencer.setLoopCount(-1);
try {
sequencer.setSequence(mySeq);
} catch (InvalidMidiDataException ex) {
Logger.getLogger(MidiApplet.class.getName()).log(Level.SEVERE, null, ex);
}
}
}

@Override
public void paint(Graphics g) {
//Draw a Rectangle around the applet's display area.
g.drawRect(0, 0,
getWidth() - 1,
getHeight() - 1);

g.drawString("This midi is made from MidiWriter, rolling the die and spinner." , 5, 35);
g.drawString("see: http://www.grain-brain.com/blog/?p=9", 5, 49);

}

@Override
public void start() {
sequencer.start();
}

@Override
public void stop() {
sequencer.stop();
}

@Override
public void destroy() {
}
}
Of course you will need to figure out how to get your files into this as a parameter.
Good luck!

WebSight
12-13-2008, 07:42 AM
the site is http://zeldalinks.net

I haben't updated the site to the new midi link..........I did find a nice javascrit. The page with the midi player is:

http://www.zeldalinks.net/midis/twwmidis.php

it is a pop-up, exactly what I wanted ^_^!

FYI, your site appears to be down at the moment. I was hoping to see the Midi link in action.

_Aerospace_Eng_
12-18-2008, 10:05 AM
Seriously this thread is over 3 years old...