com.sun.media.sound.ModelPerformer Java Examples

The following examples show how to use com.sun.media.sound.ModelPerformer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #2
Source File: ModelStandardIndexedDirectorTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #3
Source File: ModelStandardIndexedDirectorTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
Example #4
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #5
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #6
Source File: ModelStandardIndexedDirectorTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #7
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #8
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
Example #9
Source File: ModelStandardIndexedDirectorTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #10
Source File: ModelStandardIndexedDirectorTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #11
Source File: ModelStandardIndexedDirectorTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
Example #12
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #13
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #14
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
Example #15
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #16
Source File: ModelStandardIndexedDirectorTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #17
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
Example #18
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #19
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #20
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
Example #21
Source File: SimpleInstrument.java    From tuxguitar with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void add(ModelPerformer[] performers, int keyFrom, int keyTo,
        int velFrom, int velTo, int exclusiveClass) {
    SimpleInstrumentPart part = new SimpleInstrumentPart();
    part.performers = performers;
    part.keyFrom = keyFrom;
    part.keyTo = keyTo;
    part.velFrom = velFrom;
    part.velTo = velTo;
    part.exclusiveClass = exclusiveClass;
    parts.add(part);
}
 
Example #22
Source File: SF2Instrument.java    From tuxguitar with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void convertModulator(ModelPerformer performer,
        SF2Modulator modulator) {
    ModelSource src1 = convertSource(modulator.getSourceOperator());
    ModelSource src2 = convertSource(modulator.getAmountSourceOperator());
    if (src1 == null && modulator.getSourceOperator() != 0)
        return;
    if (src2 == null && modulator.getAmountSourceOperator() != 0)
        return;
    double amount = modulator.getAmount();
    double[] amountcorrection = new double[1];
    ModelSource[] extrasrc = new ModelSource[1];
    amountcorrection[0] = 1;
    ModelDestination dst = convertDestination(
            modulator.getDestinationOperator(), amountcorrection, extrasrc);
    amount *= amountcorrection[0];
    if (dst == null)
        return;
    if (modulator.getTransportOperator() == SF2Modulator.TRANSFORM_ABSOLUTE) {
        ((ModelStandardTransform)dst.getTransform()).setTransform(
                ModelStandardTransform.TRANSFORM_ABSOLUTE);
    }
    ModelConnectionBlock conn = new ModelConnectionBlock(src1, src2, amount, dst);
    if (extrasrc[0] != null)
        conn.addSource(extrasrc[0]);
    performer.getConnectionBlocks().add(conn);

}
 
Example #23
Source File: SF2Instrument.java    From tuxguitar with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void addTimecentValue(ModelPerformer performer,
        ModelIdentifier dest, short value) {
    double fvalue;
    if (value == -12000)
        fvalue = Double.NEGATIVE_INFINITY;
    else
        fvalue = value;
    performer.getConnectionBlocks().add(
            new ModelConnectionBlock(fvalue, new ModelDestination(dest)));
}
 
Example #24
Source File: SoftInstrument.java    From tuxguitar with GNU Lesser General Public License v2.1 5 votes vote down vote up
public SoftInstrument(ModelInstrument ins,
        ModelPerformer[] overrideperformers) {
    super(ins.getSoundbank(), ins.getPatch(), ins.getName(),
            ins.getDataClass());
    data = ins.getData();
    this.ins = ins;
    initPerformers(overrideperformers);
}
 
Example #25
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #26
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #27
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
Example #28
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #29
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
Example #30
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}