Package de.sciss.jcollider

Examples of de.sciss.jcollider.SynthDef


  private boolean createDefs( int numInputChannels )
  throws IOException
  {
    final Control    ctrlI  = Control.ir( new String[] { "i_aInBs", "i_aOtBf" }, new float[] { 0f, 0f });
    final GraphElem    graph;
    final SynthDef    def;
   
    if( numInputChannels > 0 ) {
      final GraphElem  in    = UGen.ar( "In", numInputChannels, ctrlI.getChannel( "i_aInBs" ));
      final GraphElem  out    = UGen.ar( "DiskOut", ctrlI.getChannel( "i_aOtBf" ), in );
      graph = out;
//System.out.println( "DiskOut has " + out.getNumOutputs() + " outputs!" );
    } else {
      graph = ctrlI;
    }
    def  = new SynthDef( "eisk-rec" + numInputChannels, graph );
    def.send( server );
//    def.writeDefFile( new File( "/Users/rutz/Desktop/test.scsyndef" ));
    return true;
  }
View Full Code Here


        final GraphElem  out    = UGen.ar( "Out", ctrlI.getChannel( "i_aOtBs" ), bufRd );
        graph  = out;
      } else {
        graph  = ctrlI;
      }
      defs[ i = new SynthDef( "eisk-input" + numInCh[ i ], graph );
    }
    return defs;
  }
View Full Code Here

  private SynthDef[] createOutputDefs( int numOutputChannels )
  {
    final Control    ctrlI  = Control.ir( new String[] { "i_aInBs", "i_aOtBs" }, new float[] { 0f, 0f });
    final Control    ctrlK  = Control.kr( new String[] { "pos", "width", "orient", "volume" }, new float[] { 0f, 2f, 0f, 1f });
    final GraphElem    graph;
    final SynthDef    def;
   
    if( numOutputChannels > 0 ) {
      final GraphElem  in    = UGen.ar( "In", ctrlI.getChannel( "i_aInBs" ));
      final GraphElem  pan;
      if( numOutputChannels > 1 ) {
        pan          = UGen.ar( "PanAz", numOutputChannels, in, ctrlK.getChannel( "pos" ), ctrlK.getChannel( "volume" ),
                                         ctrlK.getChannel( "width" ), ctrlK.getChannel( "orient" ));
      } else {
        pan          = UGen.ar( "*", in, ctrlK.getChannel( "volume" ));
      }
//      final GraphElem  out    = UGen.ar( "OffsetOut", ctrlI.getChannel( "i_aOtBs" ), pan );
      final GraphElem  out    = UGen.ar( "Out", ctrlI.getChannel( "i_aOtBs" ), pan );
      graph = out;
    } else {
      graph = UGen.array( ctrlI, ctrlK );
    }
    def  = new SynthDef( "eisk-pan" + numOutputChannels, graph );

//try { def.writeDefFile( new File( "/Users/rutz/Desktop/eisk-pan" + numOutputChannels + ".scsyndef" )); } catch( IOException e1 ) {}
//    def.send( server );
//    return true;
    return new SynthDef[] { def };
View Full Code Here

//    GraphElem      peak  = UGen.ar( "Peak", in, t_trig );
    GraphElem      trigA  = UGen.ar( "Trig1", t_trig, UGen.ir( "SampleDur" ));
//    GraphElem      peak  = UGen.ar( "Peak", in, trigA );
    GraphElem      peak  = UGen.kr( "Peak", in, trigA );
    final GraphElem    out;
    final SynthDef    def;
    GraphElem      temp;

    if( numChannels > 1 ) {
      temp = peak;
      peak = temp.getOutput( 0 );
      for( int i = 1; i < numChannels; i++ ) {
//        peak = UGen.ar( "max", peak, temp.getOutput( i ));
        peak = UGen.kr( "max", peak, temp.getOutput( i ));
      }
      temp = rms;
      rms  = temp.getOutput( 0 );
      for( int i = 1; i < numChannels; i++ ) {
        rms = UGen.ar( "+", rms, temp.getOutput( i ));
      }
      rms = UGen.ar( "*", rms, UGen.ir( 1.0f / numChannels ));
    }

    // we are reading the values asynchronously through
    // a /c_getn on the meter bus. each request is followed
    // by a /n_set to re-trigger the latch so that we are
    // not missing any peak values.
//    out = UGen.kr( "Out", i_kOtBs, UGen.array( UGen.kr( "Latch", peak, t_trig ), rms ));
    out = UGen.kr( "Out", i_kOtBs, UGen.array( peak, rms ));
   
    def = new SynthDef( "swing-peak" + numChannels, out );
//    def.writeDefFile( new java.io.File( "/Users/rutz/Desktop/meters.scsyndef" ));
    return def;
  }
View Full Code Here

TOP

Related Classes of de.sciss.jcollider.SynthDef

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.