Hi,

First:

I can confirm this is a bug.

Calling getReceiver before opening the synthesizer results in 
NullPointerException.
This is not supposed to happen. Thanks for noticing this.

Second:

I tried our way to change volume, and it does work with Gervill.
Please explain better how it failed.

I uploaded updated version of gervill with this bug fixed:
Please download "gervill-0.8-fix1.jar" from:
   https://gervill.dev.java.net/servlets/ProjectDocumentList?folderID=0
and let me know how this works.

regards,
Karl

________________________________________
Frá: [EMAIL PROTECTED] [EMAIL PROTECTED] Fyrir hönd Andreas Wenger [EMAIL 
PROTECTED]
Sent: 6. febrúar 2008 17:08
Viðtakandi: [email protected]
Efni: [Audio-engine-dev]  Possible bugs

Hi,


I'm no experienced Java Sound user, so please forgive me if the following
"bugs" are not caused by Gervill but my own program.

I tried to integrate Gervill into my program Xenoage Player, which
is a free MIDI player for MusicXML files, http://www.xenoage.com/player/


First:

This works:
> sequencer = MidiSystem.getSequencer();
> synthesizer = MidiSystem.getSynthesizer();
But this fails (works perfectly with old Java Sound):

> sequencer = MidiSystem.getSequencer(false);
> synthesizer = MidiSystem.getSynthesizer();
> Transmitter seqTransmitter = sequencer.getTransmitter();
> seqTransmitter.setReceiver(synthesizer.getReceiver());
with
> java.lang.NullPointerException
>     at com.sun.media.sound.SoftReceiver.<init>(Unknown Source)
>     at com.sun.media.sound.SoftSynthesizer.getReceiver(Unknown Source)
>     at com.xenoage.player.Player.<init>(Player.java:79)
Line 79 is "seqTransmitter.setReceiver(synthesizer.getReceiver());"


Second:

This is the way I change the playback volume (maybe this is bad code,
but it was the only way it worked for me with old Java Sound):

> MidiChannel[] channels = synthesizer.getChannels();
> //...
> for (int i = 0; i < channels.length; i++)
> {
>   channels[i].controlChange(7, (int) (volume * max));
> }
This doesn't change the volume, while old Java Sound does.


If it helps, code is available by SVN, see the website.
If these are no bugs, please forgive me ;-)

Bye,


Andi





_______________________________________________
audio-engine-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/audio-engine-dev

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.20/1261 - Release Date: 5.2.2008 20:57

_______________________________________________
audio-engine-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/audio-engine-dev

Reply via email to