Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java midi sound is weird  (Read 4278 times)
0 Members and 1 Guest are viewing this topic.
Offline Pyrodragoon

Junior Devvie

Exp: 14 years

« Posted 2009-10-22 21:40:12 »

Hi @all,

2 days ago java did something, that I don't understand at all.
I have a little program that plays music with javax.midi
and the
which I loaded by:
soundbank = MidiSystem.getSoundbank(new File(soundbankFile));
sequencer = MidiSystem.getSequencer();
trans = sequencer.getTransmitter();
synth = MidiSystem.getSynthesizer();
rcvr = synth.getReceiver();

On my computer it works quite well,
but 2 days ago a friend of mine called me and said,
that my tool has something like an echo.
It plays normal notes and with some milliseconds delay
something different, which sounds awful.
We have the exact same program, both the same
OS (XP) and the same java version (Build 1.6.0_15-b03).
Without loading the soundbank the problem doesn't occur
on her pc. I don't know what to do, this is completely strange.
As I said the problem seems to be down to loading a different soundbank,
but what difference could there be between my pc and hers?
Offline Jono
« Reply #1 - Posted 2009-10-22 23:18:10 »

If somehow two instruments are being associated with the same id (because the initial sound bank isn't unloading), you could try out

Or do some checks with synth.getLoadedInstruments() to see if something strange is going on.
Offline Pyrodragoon

Junior Devvie

Exp: 14 years

« Reply #2 - Posted 2009-10-27 15:38:50 »

I acted on your advice but
it didn't help.
Actually the synthesizer has 0 instruments loaded from the default soundbank.
It's empty...  Huh
Also as I said, it seems really weird to me because the program
is working on my pc.
And in the past it worked on my friends pc as well, so it
can't depend on the hardware, which hasn't changed.
It's also not the code.
I don't know what to do, I
can't even think of anything I could try out to examine this more.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline paulscode

Senior Devvie

Medals: 12

Staff Sergeant

« Reply #3 - Posted 2009-10-27 19:48:40 »

If you try playing without loading the soundbank on the problem machine, does anything play?  I've had situations in the past where the default synthesizer indicates that it doesn't have any instruments, when in fact it does.

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Offline Pyrodragoon

Junior Devvie

Exp: 14 years

« Reply #4 - Posted 2009-11-02 15:26:34 »

Yeah, you're right, here as well without loading the soundbank
the program plays the default soundbank although the getLoadedInstruments()
method returns an emty array...
I tried something else:

Info [] dat = MidiSystem.getMidiDeviceInfo();
for (Info q : dat) {

the output is:

ffMicrosoft MIDI-Mapper

ffMicrosoft GS Wavetable SW Synth


ffReal Time Sequencer

ffJava Sound Synthesizer

When I compiled the code
with 1.5 (done by changing the used JRE in eclipse)
the "error" disappeared and on all machines the sound was correct.

Maybe that helps you to help me  Wink
Offline Jono
« Reply #5 - Posted 2009-11-02 19:44:25 »

Someone here seems to have had the same problem, with the default soundbank playing at the same time as the new one:

Their "solved" reply doesn't give much info though. Something to do with the location of their new soundbank's .gm file.  Undecided
Offline Pyrodragoon

Junior Devvie

Exp: 14 years

« Reply #6 - Posted 2009-11-03 22:48:48 »

If I understand correctly the user there put
his soundbank into the JRE directory to replace the default one.
That solves the problem on a really low level,
because everybody has to do the same in their own
installation. One should not need to change the JRE package I think.
And that is also just a way around the actual problem.

Is this maybe a new bug in 1.6 ?
Pages: [1]
  ignore  |  Print  

DesertCoockie (33 views)
2018-05-13 18:23:11

nelsongames (75 views)
2018-04-24 18:15:36

nelsongames (70 views)
2018-04-24 18:14:32

ivj94 (752 views)
2018-03-24 14:47:39

ivj94 (82 views)
2018-03-24 14:46:31

ivj94 (622 views)
2018-03-24 14:43:53

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!