本文整理汇总了Java中com.jsyn.JSyn类的典型用法代码示例。如果您正苦于以下问题:Java JSyn类的具体用法?Java JSyn怎么用?Java JSyn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JSyn类属于com.jsyn包,在下文中一共展示了JSyn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.jsyn.JSyn; //导入依赖的package包/类
public void setUp() throws Exception {
// Create a synthesizer
synth = JSyn.createSynthesizer();
passThrough = new PassThrough();
// Prepare a SineOscillator (its amplitude will be modulated by the envelope)
sineOsc = new SineOscillator();
sineOsc.amplitude.set(1.0);
sineOsc.frequency.set(320.0);
// LineOut
out1 = new LineOut();
out2 = new LineOut();
out3 = new LineOut();
synth.add(out1);
synth.add(out2);
synth.add(out3);
synth.add(passThrough);
synth.add(sineOsc);
}
示例2: SimpleTest
import com.jsyn.JSyn; //导入依赖的package包/类
public void SimpleTest() throws InterruptedException {
// Create a synthesizer
synth = JSyn.createSynthesizer();
// Prepare a SineOscillator (its amplitude will be modulated by the envelope)
sineOsc = new SineOscillator();
sineOsc.amplitude.set(1.0);
sineOsc.frequency.set(320.0);
synth.add(sineOsc);
synth.start();
sineOsc.start();
int n = 30;
while (n > 0){
n--;
System.out.println(sineOsc.output.getValue());
synth.sleepFor(0.1);
}
}
示例3: setUp
import com.jsyn.JSyn; //导入依赖的package包/类
public void setUp() throws Exception {
// Create a synthesizer
synth = JSyn.createSynthesizer();
// Prepare a squareOscillator (it produce a binary signal !)
// Needed for an envelope generator
squareOsc = new SquareOscillator();
squareOsc.amplitude.set(1.0);
squareOsc.frequency.set(80.0);
// Prepare a SineOscillator (its amplitude will be modulated by the envelope)
sineOsc = new SineOscillator();
sineOsc.amplitude.set(1.0);
sineOsc.frequency.set(320.0);
// LineOut
out = new LineOut();
synth.add(squareOsc);
synth.add(out);
synth.add(sineOsc);
}
示例4: setUp
import com.jsyn.JSyn; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
sineOscillator = new SineOscillator();
squareOscillator = new SquareOscillator();
sawtoothOscillator = new SawtoothOscillator();
triangleOscillator = new TriangleOscillator();
lineOut = new LineOut();
add = new Add();
mixerStereo = new MixerStereo(2);
synth = JSyn.createSynthesizer();
vcoa = new Vcoa("VCOA");
vcoa1 = new Vcoa("v");
vcoa.activate();
out = new Out("OUT");
out.activate();
}
示例5: JSynSynchronizeTesting
import com.jsyn.JSyn; //导入依赖的package包/类
public JSynSynchronizeTesting() throws InterruptedException {
synth = JSyn.createSynthesizer();
sin = new SineOscillator();
sin.amplitude.set(1.0);
sin.frequency.set(320.0);
synth.add(sin);
out = new LineOut();
synth.add(out);
sin.output.connect(out.getInput());
synth.start();
out.start();
ThreadUpdater tu = new ThreadUpdater(sin);
Thread t = new Thread(tu);
t.start();
synth.sleepFor(10000.0);
}
示例6: JsynMultiply
import com.jsyn.JSyn; //导入依赖的package包/类
public JsynMultiply() throws InterruptedException {
synth = JSyn.createSynthesizer();
lineOut = new LineOut();
sine = new SineOscillator();
multiply = new Multiply();
synth.add(lineOut);
synth.add(sine);
synth.add(multiply);
sine.frequency.set(320.0);
sine.amplitude.set(1.0);
sine.output.connect(multiply.inputA);
multiply.inputB.set(0.0);
multiply.output.connect(lineOut.input);
lineOut.start();
multiply.start();
synth.start();
synth.sleepFor(5.0);
}
示例7: init
import com.jsyn.JSyn; //导入依赖的package包/类
public void init()
{
setLayout( new BorderLayout() );
synth = JSyn.createSynthesizer();
synth.add( lineOut = new LineOut() );
unitSource = createUnitSource();
synth.add( unitSource.getUnitGenerator() );
// Connect the source to both left and right speakers.
unitSource.getOutput().connect( 0, lineOut.input, 0 );
unitSource.getOutput().connect( 0, lineOut.input, 1 );
tweaker = new SoundTweaker( synth, unitSource.getUnitGenerator().getClass().getName(), unitSource );
add( tweaker, BorderLayout.CENTER );
// Use a scope to see the output.
scope = new AudioScope( synth );
scope.addProbe( unitSource.getOutput() );
scope.setTriggerMode( AudioScope.TriggerMode.NORMAL );
scope.getView().setControlsVisible( false );
add( BorderLayout.SOUTH, scope.getView() );
validate();
}
示例8: init
import com.jsyn.JSyn; //导入依赖的package包/类
public void init()
{
synth = JSyn.createSynthesizer();
// Add a tone generator.
synth.add( modulator = new SineOscillator() );
// Add a trigger.
synth.add( carrier = new SineOscillatorPhaseModulated() );
// Add an output mixer.
synth.add( lineOut = new LineOut() );
modulator.output.connect( carrier.modulation );
carrier.output.connect( 0, lineOut.input, 0 );
carrier.output.connect( 0, lineOut.input, 1 );
modulator.amplitude.setup( 0.0, 1.0, 10.0 );
carrier.amplitude.setup( 0.0, 1.0, 1.0 );
setupGUI();
}
示例9: wire
import com.jsyn.JSyn; //导入依赖的package包/类
@Override
public void wire() {
source = createCircuit();
whiteNoise = new WhiteNoise();
synth = JSyn.createSynthesizer();
synth.add(lineOut = new LineOut());
synth.add(whiteNoise.getUnitGenerator());
synth.add(source.getUnitGenerator());
// circuit
wireToLineOut(whiteNoise);
wireToLineOut(source);
synth.add(frequencyRamp = makeFrequencyRamp(getCircuit().frequency()));
synth.add(amplitudeRamp = makeAmplitudeRamp(getCircuit().amplitude()));
}
示例10: init
import com.jsyn.JSyn; //导入依赖的package包/类
@Override
public void init()
{
synth = JSyn.createSynthesizer();
// Add a tone generator.
synth.add( modulator = new SineOscillator() );
// Add a trigger.
synth.add( carrier = new SineOscillatorPhaseModulated() );
// Add an output mixer.
synth.add( lineOut = new LineOut() );
modulator.output.connect( carrier.modulation );
carrier.output.connect( 0, lineOut.input, 0 );
carrier.output.connect( 0, lineOut.input, 1 );
modulator.amplitude.setup( 0.0, 1.0, 10.0 );
carrier.amplitude.setup( 0.0, 1.0, 1.0 );
setupGUI();
}
示例11: start
import com.jsyn.JSyn; //导入依赖的package包/类
@Override
public void start() {
synth = JSyn.createSynthesizer();
synth.add(googleWaveUnit = new GoogleWaveOscillator());
googleWaveUnit.amplitude.setup(0.02, 0.5, 1.0);
googleWaveUnit.variance.setup(0.0, 0.0, 1.0);
googleWaveUnit.frequency.setup(40.0, 200.0, 1000.0);
// Add an output so we can hear it.
synth.add(lineOut = new LineOut());
googleWaveUnit.output.connect(0, lineOut.input, 0);
googleWaveUnit.output.connect(0, lineOut.input, 1);
setupGUI();
// Start synthesizer using default stereo output at 44100 Hz.
synth.start();
// Start lineOut so it can pull data from other units.
lineOut.start();
// We only need to start the LineOut. It will pull data from the
// oscillator.
lineOut.start();
}
示例12: setupSynth
import com.jsyn.JSyn; //导入依赖的package包/类
private void setupSynth(VoiceDescription description) {
synth = JSyn.createSynthesizer();
// Add an output.
synth.add(lineOut = new LineOut());
voiceDescription = description;
multiSynth = new MultiChannelSynthesizer();
final int startChannel = 0;
multiSynth.setup(synth, startChannel, NUM_CHANNELS, VOICES_PER_CHANNEL, voiceDescription);
midiSynthesizer = new MidiSynthesizer(multiSynth);
multiSynth.getOutput().connect(0,lineOut.input, 0);
multiSynth.getOutput().connect(1,lineOut.input, 1);
// Start synthesizer using default stereo output at 44100 Hz.
synth.start();
lineOut.start();
}
示例13: init
import com.jsyn.JSyn; //导入依赖的package包/类
@Override
public void init() {
synth = JSyn.createSynthesizer();
// Add a tone generator.
synth.add(modulator = new SineOscillator());
// Add a trigger.
synth.add(carrier = new SineOscillatorPhaseModulated());
// Add an output mixer.
synth.add(lineOut = new LineOut());
modulator.output.connect(carrier.modulation);
carrier.output.connect(0, lineOut.input, 0);
carrier.output.connect(0, lineOut.input, 1);
modulator.amplitude.setup(0.0, 1.0, 10.0);
carrier.amplitude.setup(0.0, 0.25, 1.0);
setupGUI();
}
示例14: setupSynth
import com.jsyn.JSyn; //导入依赖的package包/类
private void setupSynth() {
synth = JSyn.createSynthesizer();
voiceDescription = DualOscillatorSynthVoice.getVoiceDescription();
// voiceDescription = SubtractiveSynthVoice.getVoiceDescription();
multiSynth = new MultiChannelSynthesizer();
final int startChannel = 0;
multiSynth.setup(synth, startChannel, NUM_CHANNELS, VOICES_PER_CHANNEL, voiceDescription);
midiSynthesizer = new MidiSynthesizer(multiSynth);
// Create a LineOut for the entire synthesizer.
synth.add(lineOut = new LineOut());
multiSynth.getOutput().connect(0,lineOut.input, 0);
multiSynth.getOutput().connect(1,lineOut.input, 1);
// Start synthesizer using default stereo output at 44100 Hz.
synth.start();
lineOut.start();
}
示例15: setUp
import com.jsyn.JSyn; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
synth = JSyn.createSynthesizer();
synth.add(add1 = new Add());
synth.add(add2 = new Add());
synth.add(add3 = new Add());
add1.start();
add2.start();
add3.start();
add1.inputA.set(0.1);
add1.inputB.set(0.2);
add2.inputA.set(0.4);
add2.inputB.set(0.8);
add3.inputA.set(1.6);
add3.inputB.set(3.2);
}