Package de.sciss.jcollider

Examples of de.sciss.jcollider.GraphElem


  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;
    }
View Full Code Here


    }
   
    defs = new SynthDef[ numDefs ];
    for( int i = 0; i < numDefs; i++ ) {
      final Control    ctrlI  = Control.ir( new String[] { "i_aInBf", "i_aOtBs", "i_aPhBs", "i_intrp" }, new float[] { 0f, 0f, 0f, 1f });
      final GraphElem    graph;
     
      if( numInCh[ i ] > 0 ) {
        final GraphElem  phase  = UGen.ar( "In", ctrlI.getChannel( "i_aPhBs" ));
        final GraphElem  bufRd  = UGen.ar( "BufRd", numInCh[ i ], ctrlI.getChannel( "i_aInBf" ), phase, UGen.ir( 0f ), ctrlI.getChannel( "i_intrp" ));
//        final GraphElem  out    = UGen.ar( "OffsetOut", ctrlI.getChannel( "i_aOtBs" ), bufRd );
        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 );
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 );
View Full Code Here

  throws IOException
  {
    if( UGenInfo.infos == null ) UGenInfo.readBinaryDefinitions();
   
    final Control    i_aInBs  = Control.ir( "i_aInBs", new float[ numChannels ]);
    final GraphElem    i_kOtBs  = Control.ir( "i_kOtBs" );
    final GraphElem    t_trig  = TrigControl.kr( "t_trig" );
    final GraphElem    in    = UGen.ar( "In", i_aInBs );
    GraphElem      rms    = UGen.ar( "Lag", UGen.ar( "squared", in ), UGen.ir( 0.1f ));
//    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
View Full Code Here

TOP

Related Classes of de.sciss.jcollider.GraphElem

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.