Package javax.sound.midi

Examples of javax.sound.midi.Soundbank


  }
   
  public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    Soundbank defsbk = synth.getDefaultSoundbank();
    if(defsbk != null)
    {
      synth.unloadAllInstruments(defsbk);
      SimpleSoundbank sbk = new SimpleSoundbank();
      SimpleInstrument ins = new SimpleInstrument();
View Full Code Here


    }

    public static void main(String[] args) throws Exception {
        AudioSynthesizer synth = new SoftSynthesizer();
        synth.openStream(null, null);
        Soundbank defsbk = synth.getDefaultSoundbank();
        if (defsbk != null) {
            assertTrue(defsbk.getInstruments().length == synth
                    .getLoadedInstruments().length);
        }
        synth.close();
        Map<String, Object> p = new HashMap<String, Object>();
        p.put("load default soundbank", false);
View Full Code Here

    synth.openStream(null, null);
    SimpleSoundbank sbk = new SimpleSoundbank();
    SimpleInstrument ins = new SimpleInstrument();
    sbk.addInstrument(ins);
    assertTrue(synth.isSoundbankSupported(sbk));
    Soundbank dummysbk = new Soundbank()
    {
      public String getName() {
        return null;
      }
      public String getVersion() {
View Full Code Here

  }
   
  public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    Soundbank defsbk = synth.getDefaultSoundbank();
    if(defsbk != null)
    {
      synth.unloadAllInstruments(defsbk);
      SimpleSoundbank sbk = new SimpleSoundbank();
      SimpleInstrument ins = new SimpleInstrument();
View Full Code Here

public class TestCreateSoundbank {

    public static void main(String[] args) throws Exception {

        Soundbank soundbank = EmergencySoundbank.createSoundbank();
        for (int i = 0; i < 128; i++) {
            Patch patch = new ModelPatch(0, i, false);
            ModelInstrument ins = (ModelInstrument)soundbank.getInstrument(patch);
            if(ins == null)
                throw new Exception("Instrument " + i + " is missing!");
            if(ins.getPerformers().length == 0)
                throw new Exception("Instrument " + i + " doesn't have any performers!");
        }
        Patch patch = new ModelPatch(0, 0, true);
        ModelInstrument ins = (ModelInstrument)soundbank.getInstrument(patch);
        if(ins == null)
            throw new Exception("Drumkit instrument is missing!");
        if(ins.getPerformers().length == 0)
            throw new Exception("Drumkit instrument doesn't have any performers!");
    }
View Full Code Here

            throw new RuntimeException("assertTrue fails!");
    }

    public static void main(String[] args) throws Exception {
        File file = new File(System.getProperty("test.src", "."), "ding.sf2");
        Soundbank sf2 = new SF2SoundbankReader().getSoundbank(file);
        assertTrue(sf2.getInstruments().length == 1);
        Patch patch = sf2.getInstruments()[0].getPatch();
        assertTrue(patch.getProgram() == 0);
        assertTrue(patch.getBank() == 0);
    }
View Full Code Here

  }
   
  public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    Soundbank defsbk = synth.getDefaultSoundbank();
    if(defsbk != null)
    {
      synth.unloadAllInstruments(defsbk);
      SimpleSoundbank sbk = new SimpleSoundbank();
      SimpleInstrument ins = new SimpleInstrument();
View Full Code Here

    }

    public static void main(String[] args) throws Exception {
        File file = new File(System.getProperty("test.src", "."), "ding.sf2");
        URL url = file.toURI().toURL();
        Soundbank sf2 = new SF2SoundbankReader().getSoundbank(url);
        assertTrue(sf2.getInstruments().length == 1);
        Patch patch = sf2.getInstruments()[0].getPatch();
        assertTrue(patch.getProgram() == 0);
        assertTrue(patch.getBank() == 0);
    }
View Full Code Here

            throw new RuntimeException("assertTrue fails!");
    }

    public static void main(String[] args) throws Exception {
        File file = new File(System.getProperty("test.src", "."), "ding.dls");
        Soundbank dls = new DLSSoundbankReader().getSoundbank(file);
        assertTrue(dls.getInstruments().length == 1);
        Patch patch = dls.getInstruments()[0].getPatch();
        assertTrue(patch.getProgram() == 0);
        assertTrue(patch.getBank() == 0);
    }
View Full Code Here

        File file = new File(System.getProperty("test.src", "."), "ding.sf2");
        FileInputStream fis = new FileInputStream(file);
        BufferedInputStream bis = new BufferedInputStream(fis);
        try
        {
            Soundbank sf2 = new SF2SoundbankReader().getSoundbank(bis);
            assertTrue(sf2.getInstruments().length == 1);
            Patch patch = sf2.getInstruments()[0].getPatch();
            assertTrue(patch.getProgram() == 0);
            assertTrue(patch.getBank() == 0);
        }
        finally
        {
View Full Code Here

TOP

Related Classes of javax.sound.midi.Soundbank

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.