> I'm using sun.audio.AudioPlayer class
*
>...to play midi file in the
> representation of AudioStream
* That is an obscure class! How did you find out about it?
Why not use some of the (at least publicly documented)
classes from the javax.sound.midi package?
<http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/midi/package-frame.html>
> I found no built in function that can do a fade out.
>
> I thought about modifying the stream and reduce the amplitude
> gradually, but I don't know how to.
I doubt you will, not without going into the MIDI
sequence itself and altering the note velocities**.
Note that some 'OS level' players cannot alter the
level of MIDI playback because the programmers
either could not, or did not, hook into the sound
card's synthesizer volume control (which is quite
distinct from the channel through which you might
hear MP3's, MPEG soundtracks, WAV's..).
** Though that is a bit of a WAG.
Andrew T.
> I'm using sun.audio.AudioPlayer class to play midi file in the
> representation of AudioStream
[quoted text clipped - 5 lines]
>
> Please help.
When I google for "fade out midi java", I get
http://jmusic.ci.qut.edu.au/jmtutorial/BandMachine.html which has some
source code demonstrating fading in and out MIDI.
- Oliver
Jeff - 02 Nov 2006 21:58 GMT
> > I'm using sun.audio.AudioPlayer class to play midi file in the
> > representation of AudioStream
[quoted text clipped - 11 lines]
>
> - Oliver
Since you are using a midi file, most sequencer software will allow you
to apply a fade over a specified time. PowerTracks Pro is relatively
inexpensive ($49) and can perform many additional features you may wish
to use later. Alternatively, I haven't used it, but MidiYodi appears to
be a freeware program that can fade a midi file.