Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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 3201 times)
0 Members and 1 Guest are viewing this topic.
Offline Pyrodragoon

Junior Devvie

Art calculated with java...

« 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

Art calculated with java...

« 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

Art calculated with java...

« 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

Art calculated with java...

« 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  
You cannot reply to this message, because it is very, very old.

BurntPizza (22 views)
2015-10-08 03:11:46

BurntPizza (15 views)
2015-10-08 00:30:40

BurntPizza (17 views)
2015-10-07 17:15:53

BurntPizza (32 views)
2015-10-07 02:11:23

KaiHH (37 views)
2015-10-06 20:22:20

KaiHH (16 views)
2015-10-06 19:41:59

BurntPizza (32 views)
2015-10-06 19:04:48

basil_ (46 views)
2015-09-30 17:04:40

shadowstryker (24 views)
2015-09-29 15:55:06

TheSpaceHedgehog (30 views)
2015-09-29 01:58:48
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!