[Audio-engine-dev] FW: Gervill 0.2

Florian Bomers javasound-dev at bome.com
Thu Oct 11 02:31:57 PDT 2007


Hi Karl,

sounds great! I support inclusion of Gervill into the openjdk
(pending functional tests...).
Things to solve:

- soundbank:
  1) I expect Sun to not want to keep a soundbank in the
     JRE/JDK because of size. I think we should extend
     MidiSystem with methods to initialize and, if
     necessary, download a default soundbank from a
     hardcoded location. This should also work from applets.
  2) For that, we should provide a soundbank that is free
     to be used with Java. This soundbank should be freely
     accessible on a reliable server "for ever" so that
     it can be downloaded on demand by Java.

- a standardized way of setting the mixer and audio format of the
synth.
Also, should we add properties to select the default audio device
used for the synthesizer, similar to the properties in
AudioSystem? And, the equivalent format to choose the default
Synthesizer at all.

Below I propose a new interface to be implemented by Software
Synthesizers.

Thanks,
Florian

package javax.sound.midi;
import javax.sound.sampled.*;

interface SoftwareSynthesizer extends Synthesizer {


  /**
   * Return the rendering format of this synthesizer.
   *
   * @return the rendering format
   */
  public AudioFormat getFormat();

  /**
   * Set the rendering format of this synthesizer.
   *
   * @param format the new audio format
   * @throws IllegalArgumentException if this synthesizer
   *     cannot render in this format.
   * @throws IllegalStateException when this
   *     SoftwareSynthesizer is already open and the
   *     implementation does not support setting the
   *     format when open.
   */
  public void setFormat(AudioFormat format);

  /**
   * Query the software synthesizer if the output
   * mixer can be chosen with the setMixer() or
   * the setLine() methods. If it is not supported,
   * the synthesizer will play on a default device.
   *
   * @return true if assigning an arbitrary mixer
   *         and/or line is possible, false otherwise.
   */
  public boolean canSelectMixer();

  /**
   * Get the currently selected mixer type. If the default
   * mixer is used, this method returns null.
   *
   * @return the mixer descriptor that this synthesizer
   *         writes its audio data to, or null if using
   *         the default mixer.
   */
  public Mixer.Info getOutputMixer();

  /**
   * Get the currently selected SourceDataLine type.
   * If the default line of the selected mixer is
   * used, this method returns null.
   *
   * @return the line descriptor for a SourceDataLine that
   *         this synthesizer writes its audio data to, or
   *         null if using the default mixer.
   */
  public DataLine.Info getOutputLine();

  /**
   * Set the mixer descriptor used for rendering the
   * Synthesizer's audio output, and use the default
   * SourceDataLine from it. The mixer should provide
   * at least one SourceDataLine that supports the
   * synthesizer's audio format.
   * <p>
   * Use <code>null</code> to let the implementation
   * choose a default output device, usually the default
   * mixer as returned by AudioSystem.getMixer(null).
   *
   * @param mixerInfo the mixer descriptor to use
   *     for rendering, or <code>null</code> to use
   *     a default mixer.
   * @throws IllegalStateException when this
   *     SoftwareSynthesizer is already open
   * @throws IllegalArgumentException if the specified
   *     Mixer does not provide a SourceDataLine of
   *     the required format, or if setting the mixer
   *     is not possible at all (see canSelectMixer()).
   */
  public void setMixer(Mixer.Info mixerInfo);

  /**
   * Set the mixer descriptor and its Line descriptor
   * used for rendering the Synthesizer's audio output.
   * The Line descriptor should be an instance returned
   * by that mixer's getSourceLineInfo() method, cast
   * to DataLine.Info, and its line class must be
   * assignment compatible with the SourceDataLine
   * interface. The specified SourceDataLine should
   * support this synthesizer's audio format.
   * <p>
   * Use <code>null</code> for both parameters to let
   * the implementation choose a default output device,
   * usually the default mixer as returned by
   * AudioSystem.getMixer(null).
   *
   * @param mixerInfo the mixer descriptor to use
   *     for rendering, or <code>null</code> to use
   *     a default mixer.
   * @param sourceLineInfo the line descriptor of
   *     a SourceDataLine as returned by the
   *     specified mixer.
   * @throws IllegalStateException when this
   *     SoftwareSynthesizer is already open
   * @throws IllegalArgumentException if the specified
   *     SourceDataLine does not provide
   *     the required format, or if setting the mixer
   *     is not possible at all (see canSelectMixer()).
   * @throws NullPointerException if sourceLineInfo
   *     is non-null and mixerInfo is null.
   */
  public void setMixer(Mixer.Info mixerInfo,
                       DataLine.Info sourceLineInfo);

  /**
   * [same description of MidiDevice.open()]
   * <p>
   * If the Mixer or SourceDataLine where this synthesizer
   * writes its data to, cannot be found, or is not
   * available, or the line does not support the
   * requested format, and no output stream is set,
   * a MidiUnavailableException is thrown,
   * where its cause is set to the respective Exception
   * thrown by the audio system.
   */
  @Override
  public void open() throws MidiUnavailableException;

  /**
   * Set an OutputStream where the rendered audio is
   * written to.
   * After setting a valid OutputStream, this synthesizer
   * will not render its audio to a SourceDataLine, but
   * to the specified stream. To revert the default
   * behavior, set the stream to <code>null</code>.
   *
   * @throws IllegalStateException when this
   *     SoftwareSynthesizer is already open and the
   *     implementation does not support setting the
   *     mixer when open.
   * @param stream the output stream receiving the
   *     the rendered audio stream in the format
   *     returned by getFormat().
   */
   public void setOutputStream(OutputStream stream);
}


On 10/2/2007 5:03 PM, Karl Helgason wrote:
> Hi Florian,
> 
> Here are to answer your questions.
> 
> 1.
> The synthesizer is licensed in GPL with Classpath exception.
> I have also signed the Sun Contributor Agreement.
> 
> 2.
> With the GUS patch format support we can use freepats:
> see: http://freepats.opensrc.org/
> But they are probably to large.
> 
> 3.
> There is no dll file involved only .class files. And the current .jar
> file is 170 kb, which can be compressed further
> by dropping debugging information and using pack200 compression.
> 
> 4.
> Yeb it uses javasound default mixer by default.
> 
> 5.
> Curently is done by caling the method setMixer(Mixer) in the SoftSynthesizer class.
> There are problaby many other ways this can be done.
> 
> regards,
> Karl Helgason
> 
> ________________________________________
> Frá: Florian Bomers [javasound-dev at bome.com]
> Sent: 2. október 2007 12:44
> Viðtakandi: Karl Helgason
> Samrit: audio-engine-dev at openjdk.java.net
> Efni: Re: [Audio-engine-dev] Gervill 0.2
> 
> Hi Karl,
> 
> that sounds fantastic. DLS and SF2 support for Java Sound is
> great. Some questions:
> 
> 1) under which license do you intend to make it available for
> OpenJDK?
> 
> 2) for Linux and Solaris, do you know a GM compatible soundbank
> that could be included?
> 
> 3) how large (in KB) is the engine (.class + .dll/.so)? The
> smaller the better, because download size of the JRE should be
> kept to a minimum...
> 
> 4) Does/Can it use Java Sound output devices?
> 
> 5) one important feature is to select the sound device used for
> output, are there any provisions? I'm not sure how that can be
> solved, but one solution would be to provide one Synthesizer
> object per audio device. The default Synthesizer would use Java
> Sound's default audio device, as determined by
> AudioSystem.getMixer().
> 
> Regards,
> Florian
> 
> 
> On 10/2/2007 1:56 PM, Karl Helgason wrote:
>> Hi,
>>
>> I have updated the midi synthesizer:
>> http://sourceforge.net/project/showfiles.php?group_id=175084&package_id=246500
>>
>> - Large format support.
>> - Fix SoundFont modulator mapping.
>> - Fix handling of unsigned 16 bit streams
>> - Improved GUS patch support
>> - Add support for ping-pong/bi-directional and reverse loops
>>
>> regards
>> Karl Helgason
>> _______________________________________________
>> audio-engine-dev mailing list
>> audio-engine-dev at openjdk.java.net
>> http://mail.openjdk.java.net/mailman/listinfo/audio-engine-dev
>>
>>
> 
> --
> Florian Bomers
> Bome Software
> 
> -------------------------------------------------------
> Music Software, Development Tools:  http://www.bome.com
> Java Sound extensions, plugins: http://www.tritonus.org
> The Java Sound Resources:    http://www.jsresources.org
> -------------------------------------------------------
> Please quote this email in your reply. Thanks!
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.13.37/1042 - Release Date: 1.10.2007 18:59
> 
> _______________________________________________
> audio-engine-dev mailing list
> audio-engine-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/audio-engine-dev
> 
> 
> 

-- 
Florian Bomers
Bome Software

-------------------------------------------------------
Music Software, Development Tools:  http://www.bome.com
Java Sound extensions, plugins: http://www.tritonus.org
The Java Sound Resources:    http://www.jsresources.org
-------------------------------------------------------
Please quote this email in your reply. Thanks!




More information about the audio-engine-dev mailing list