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