当前位置: 首页>>代码示例>>Java>>正文


Java FilterLowPass类代码示例

本文整理汇总了Java中com.jsyn.unitgen.FilterLowPass的典型用法代码示例。如果您正苦于以下问题:Java FilterLowPass类的具体用法?Java FilterLowPass怎么用?Java FilterLowPass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FilterLowPass类属于com.jsyn.unitgen包,在下文中一共展示了FilterLowPass类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SubtractiveSynthVoice

import com.jsyn.unitgen.FilterLowPass; //导入依赖的package包/类
public SubtractiveSynthVoice() {
    add(frequencyScaler = new Multiply());
    // Add a tone generator.
    add(osc = new SawtoothOscillatorBL());

    // Use an envelope to control the amplitude.
    add(ampEnv = new EnvelopeDAHDSR());

    // Use an envelope to control the filter cutoff.
    add(filterEnv = new EnvelopeDAHDSR());
    add(filter = new FilterLowPass());
    add(cutoffAdder = new Add());

    filterEnv.output.connect(cutoffAdder.inputA);
    cutoffAdder.output.connect(filter.frequency);
    frequencyScaler.output.connect(osc.frequency);
    osc.output.connect(filter.input);
    filter.output.connect(ampEnv.amplitude);

    addPort(amplitude = osc.amplitude, "Amplitude");
    addPort(frequency = frequencyScaler.inputA, "Frequency");
    addPort(pitchModulation = frequencyScaler.inputB, "PitchMod");
    addPort(cutoff = cutoffAdder.inputB, "Cutoff");
    addPort(cutoffRange = filterEnv.amplitude, "CutoffRange");
    addPort(Q = filter.Q);

    ampEnv.export(this, "Amp");
    filterEnv.export(this, "Filter");

    frequency.setup(osc.frequency);
    pitchModulation.setup(0.2, 1.0, 4.0);
    cutoff.setup(filter.frequency);
    cutoffRange.setup(filter.frequency);

    // Make the circuit turn off when the envelope finishes to reduce CPU load.
    ampEnv.setupAutoDisable(this);

    usePreset(0);
}
 
开发者ID:philburk,项目名称:jsyn,代码行数:40,代码来源:SubtractiveSynthVoice.java

示例2: init

import com.jsyn.unitgen.FilterLowPass; //导入依赖的package包/类
@Override
public void init() {
    synth = JSyn.createSynthesizer();
    synth.add(oscillator = new SawtoothOscillatorBL());
    synth.add(rampCutoff = new LinearRamp());
    synth.add(tieQ = new PassThrough());
    synth.add(tieCutoff = new PassThrough());
    synth.add(filterMoog = new FilterFourPoles());
    synth.add(filterBiquad = new FilterLowPass());
    synth.add(mixer = new PassThrough());
    synth.add(lineOut = new LineOut());

    oscillator.output.connect(filterMoog.input);
    oscillator.output.connect(filterBiquad.input);
    if (useCutoffRamp) {
        rampCutoff.output.connect(filterMoog.frequency);
        rampCutoff.output.connect(filterBiquad.frequency);
        rampCutoff.time.set(0.000);
    } else {
        tieCutoff.output.connect(filterMoog.frequency);
        tieCutoff.output.connect(filterBiquad.frequency);
    }
    tieQ.output.connect(filterMoog.Q);
    tieQ.output.connect(filterBiquad.Q);
    filterMoog.output.connect(mixer.input);
    mixer.output.connect(0, lineOut.input, 0);
    mixer.output.connect(0, lineOut.input, 1);

    filterBiquad.amplitude.set(0.1);
    oscillator.frequency.setup(50.0, 130.0, 3000.0);
    oscillator.amplitude.setup(0.0, 0.336, 1.0);
    rampCutoff.input.setup(filterMoog.frequency);
    tieCutoff.input.setup(filterMoog.frequency);
    tieQ.input.setup(0.1, 0.7, 10.0);
    setupGUI();
}
 
开发者ID:philburk,项目名称:jsyn,代码行数:37,代码来源:HearMoogFilter.java

示例3: SynthCircuitBlaster

import com.jsyn.unitgen.FilterLowPass; //导入依赖的package包/类
public SynthCircuitBlaster()
	{
		add( frequencyPin = new PassThrough() );
		add( modScaler = new Multiply() );
		add( sweepScaler = new Multiply() );
		add( edgeDetector = new EdgeDetector() );
		add( latch = new Latch() );
		add( samplee = new SineOscillator() );
		
//add( pulser = new PulseOscillator() );
		
		add( lfo = new SineOscillator() );
		add( osc = new SawtoothOscillatorDPW() );
		add( filter = new FilterLowPass() );
		// Use an envelope to control the amplitude.
		add( ampEnv = new EnvelopeDAHDSR() );

		samplee.output.connect( latch.input );
//pulser.output.connect( edgeDetector.input );
edgeDetector.input.set(1);
		
		edgeDetector.output.connect( latch.gate );
		latch.output.connect( osc.frequency );

		frequencyPin.output.connect( osc.frequency );

		frequencyPin.output.connect( modScaler.inputA );
		modScaler.output.connect( lfo.amplitude );

		frequencyPin.output.connect( sweepScaler.inputA );
		sweepScaler.output.connect( samplee.amplitude );

		lfo.output.connect( osc.frequency );
		osc.output.connect( filter.input );
		filter.output.connect( ampEnv.amplitude );
//pulser.output.connect( ampEnv.input );
ampEnv.input.set(1);

		//ampEnv.
		// Setup ports ---------------
		addPort( amplitude = osc.amplitude, "amplitude" );
		amplitude.set( 0.6 );

		addPort( frequency = frequencyPin.input, "frequency" );
		frequency.setup( 50.0, 800.0, 2000.0 );

		addPort( modRate = lfo.frequency, "modRate" );
		modRate.setup( 0.0, 12, 20.0 );

		addPort( modDepth = modScaler.inputB, "modDepth" );
		modDepth.setup( 0.0, 0.0, 0.5 );

		addPort( cutoff = filter.frequency, "cutoff" );
		cutoff.setup( 20.0, 2000.0, 5000.0 );
		addPort( resonance = filter.Q, "Q" );

		addPort( sweepDepth = sweepScaler.inputB, "sweepDepth" );
		sweepDepth.setup( 0.0, 0.6, 1.0 );
		addPort( sweepRate = samplee.frequency, "sweepRate" );
		sweepRate.setup( 0.2, 5.9271, 20.0 );

		/*addPort( pulseRate = pulser.frequency, "pulseRate" );
		pulseRate.setup( 0.2, 7.0, 20.0 );
		addPort( pulseWidth = pulser.width, "pulseWidth" );
		pulseWidth.setup( -0.9, 0.9, 0.9 );*/
		
		edgeDetector.input.setup( 0.2, 7.0, 20.0 );
		
		addPort( attack = ampEnv.attack, "attack" );
		attack.setup( 0.001, 0.001, 2.0 );
		addPort( decay = ampEnv.decay, "decay" );
		decay.setup( 0.001, 0.26, 2.0 );
		addPort( sustain = ampEnv.sustain, "sustain" );
		sustain.setup( 0.000, 0.24, 1.0 );
		addPort( release = ampEnv.release, "release" );
		release.setup( 0.001, 0.2, 2.0 );

		addPort( output = ampEnv.output );
	}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:80,代码来源:SynthCircuitBlaster.java

示例4: SampleHoldNoteBlaster

import com.jsyn.unitgen.FilterLowPass; //导入依赖的package包/类
public SampleHoldNoteBlaster()
{
	add( frequencyPin = new PassThrough() );
	add( modScaler = new Multiply() );
	add( sweepScaler = new Multiply() );
	add( edgeDetector = new EdgeDetector() );
	add( latch = new Latch() );
	add( samplee = new SineOscillator() );
	add( pulser = new PulseOscillator() );
	add( lfo = new SineOscillator() );
	add( osc = new SawtoothOscillatorDPW() );
	add( filter = new FilterLowPass() );
	// Use an envelope to control the amplitude.
	add( ampEnv = new EnvelopeDAHDSR() );

	samplee.output.connect( latch.input );
	pulser.output.connect( edgeDetector.input );
	edgeDetector.output.connect( latch.gate );
	latch.output.connect( osc.frequency );

	frequencyPin.output.connect( osc.frequency );

	frequencyPin.output.connect( modScaler.inputA );
	modScaler.output.connect( lfo.amplitude );

	frequencyPin.output.connect( sweepScaler.inputA );
	sweepScaler.output.connect( samplee.amplitude );

	lfo.output.connect( osc.frequency );
	osc.output.connect( filter.input );
	filter.output.connect( ampEnv.amplitude );
	pulser.output.connect( ampEnv.input );

	// Setup ports ---------------
	addPort( amplitude = osc.amplitude, "amplitude" );
	amplitude.set( 0.6 );

	addPort( frequency = frequencyPin.input, "frequency" );
	frequency.setup( 50.0, 800.0, 2000.0 );

	addPort( modRate = lfo.frequency, "modRate" );
	modRate.setup( 0.0, 12, 20.0 );

	addPort( modDepth = modScaler.inputB, "modDepth" );
	modDepth.setup( 0.0, 0.0, 0.5 );

	addPort( cutoff = filter.frequency, "cutoff" );
	cutoff.setup( 20.0, 2000.0, 5000.0 );
	addPort( resonance = filter.Q, "Q" );

	addPort( sweepDepth = sweepScaler.inputB, "sweepDepth" );
	sweepDepth.setup( 0.0, 0.6, 1.0 );
	addPort( sweepRate = samplee.frequency, "sweepRate" );
	sweepRate.setup( 0.2, 5.9271, 20.0 );

	addPort( pulseRate = pulser.frequency, "pulseRate" );
	pulseRate.setup( 0.2, 7.0, 20.0 );
	addPort( pulseWidth = pulser.width, "pulseWidth" );
	pulseWidth.setup( -0.9, 0.9, 0.9 );
	
	addPort( attack = ampEnv.attack, "attack" );
	attack.setup( 0.001, 0.001, 2.0 );
	addPort( decay = ampEnv.decay, "decay" );
	decay.setup( 0.001, 0.26, 2.0 );
	addPort( sustain = ampEnv.sustain, "sustain" );
	sustain.setup( 0.000, 0.24, 1.0 );
	addPort( release = ampEnv.release, "release" );
	release.setup( 0.001, 0.2, 2.0 );

	addPort( output = ampEnv.output );
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:72,代码来源:SampleHoldNoteBlaster.java

示例5: SampleHoldNoteBlaster

import com.jsyn.unitgen.FilterLowPass; //导入依赖的package包/类
public SampleHoldNoteBlaster() {
    add(frequencyPin = new PassThrough());
    add(modScaler = new Multiply());
    add(sweepScaler = new Multiply());
    add(edgeDetector = new EdgeDetector());
    add(latch = new Latch());
    add(samplee = new SineOscillator());
    add(pulser = new PulseOscillator());
    add(lfo = new SineOscillator());
    add(osc = new SawtoothOscillatorDPW());
    add(filter = new FilterLowPass());
    // Use an envelope to control the amplitude.
    add(ampEnv = new EnvelopeDAHDSR());

    samplee.output.connect(latch.input);
    pulser.output.connect(edgeDetector.input);
    edgeDetector.output.connect(latch.gate);
    latch.output.connect(osc.frequency);

    frequencyPin.output.connect(osc.frequency);

    frequencyPin.output.connect(modScaler.inputA);
    modScaler.output.connect(lfo.amplitude);

    frequencyPin.output.connect(sweepScaler.inputA);
    sweepScaler.output.connect(samplee.amplitude);

    lfo.output.connect(osc.frequency);
    osc.output.connect(filter.input);
    filter.output.connect(ampEnv.amplitude);
    pulser.output.connect(ampEnv.input);

    // Setup ports ---------------
    addPort(amplitude = osc.amplitude, "amplitude");
    amplitude.set(0.6);

    addPort(frequency = frequencyPin.input, "frequency");
    frequency.setup(50.0, 800.0, 2000.0);

    addPort(modRate = lfo.frequency, "modRate");
    modRate.setup(0.0, 12, 20.0);

    addPort(modDepth = modScaler.inputB, "modDepth");
    modDepth.setup(0.0, 0.0, 0.5);

    addPort(cutoff = filter.frequency, "cutoff");
    cutoff.setup(20.0, 2000.0, 5000.0);
    addPort(resonance = filter.Q, "Q");

    addPort(sweepDepth = sweepScaler.inputB, "sweepDepth");
    sweepDepth.setup(0.0, 0.6, 1.0);
    addPort(sweepRate = samplee.frequency, "sweepRate");
    sweepRate.setup(0.2, 5.9271, 20.0);

    addPort(pulseRate = pulser.frequency, "pulseRate");
    pulseRate.setup(0.2, 7.0, 20.0);
    addPort(pulseWidth = pulser.width, "pulseWidth");
    pulseWidth.setup(-0.9, 0.9, 0.9);

    addPort(attack = ampEnv.attack, "attack");
    attack.setup(0.001, 0.001, 2.0);
    addPort(decay = ampEnv.decay, "decay");
    decay.setup(0.001, 0.26, 2.0);
    addPort(sustain = ampEnv.sustain, "sustain");
    sustain.setup(0.000, 0.24, 1.0);
    addPort(release = ampEnv.release, "release");
    release.setup(0.001, 0.2, 2.0);

    addPort(output = ampEnv.output);
}
 
开发者ID:philburk,项目名称:jsyn,代码行数:71,代码来源:SampleHoldNoteBlaster.java

示例6: LowPassFilter

import com.jsyn.unitgen.FilterLowPass; //导入依赖的package包/类
/**
 * Instantiates a new Low pass filter adapter.
 * @param component
 */
public LowPassFilter(IComponent component) {
    super(component, new FilterLowPass());
}
 
开发者ID:StephaneMangin,项目名称:Synth,代码行数:8,代码来源:LowPassFilter.java


注:本文中的com.jsyn.unitgen.FilterLowPass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。