Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 5th, 2008, 01:05 PM
tictactactics tictactactics is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 3 tictactactics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 6 m 17 sec
Reputation Power: 0
Java Midi Synthesis Problems!

Hi! I've been searching for a solution to my problem for almost a week now. I'm new to Java so I was hoping someone here could help me out!

I'm familiar with a few other programming languages and I got all the "Hello World" stuff going, but the MIDI synthesis in Java is stumping me. Maybe it's just my computer that's the problem, but I'm not sure.

I'm using Eclipse for programming.
Inside my miditest.java file I have a miditest class with this code in it...
Code:
import javax.sound.midi.*;

class miditest
{ 
	   public static void main(String[] args) { 
				MidiDevice.Info[] mdi = MidiSystem.getMidiDeviceInfo();
				Synthesizer synth = MidiSystem.getSynthesizer();
		   		synth.close();
		   		synth.open();
			    final MidiChannel[] mc = synth.getChannels();
			    Instrument[] instr = synth.getDefaultSoundbank().getInstruments();
			    synth.loadInstrument(instr[90]);
			    mc[5].noteOn(60,600);
			    synth.close();
			    
	   }
}


At "MidiSystem.getSynthesizer()" it's throwing "MidiUnavailableException". It's throwing that at "synth.open()" too.

I've checked my MIDI for availability... and I'm assuming since every other program can run MIDI that my device is working fine.

Is the problem that I shouldn't be running this code in... a Class? or should it be an Interface? I'm not sure where to start like this in Java... so maybe I should figure out what those two things are....

Anyway, thanks for any help!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Java Midi Synthesis Problems!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT