@Test public void amplitudeGain(){ final int expectedAmplitude = 1; SynthMonitor monitor = newAssertAmplitudeMonitor(expectedAmplitude); MonitoredSynth ms = new MonitoredSynth(monitor); ms.settings.amplitudeGain = 2; ms.sendAmplitude(0.5f); }
@Override public void sendAmplitude(float amplitude) { amplitude = Math.min(amplitude, 1) * settings.amplitudeGain; doSetAmplitude(amplitude); if(monitor!=null) monitor.amplitudeChanged(amplitude); }
MonitoredSynth implements VocoSynth { @Override public void sendAmplitude(float amplitude) { amplitude = Math.min(amplitude, 1) * settings.amplitudeGain; doSetAmplitude(amplitude); if(monitor!=null) monitor.amplitudeChanged(amplitude); } }
MonitoredSynth implements VocoSynth { @Override public void sendAmplitude(float amplitude) { amplitude = Math.min(amplitude, 1) * settings.amplitudeGain; doSetAmplitude(amplitude); if(monitor!=null) monitor.amplitudeChanged(amplitude); } MonitoredSynth();  MonitoredSynth(SynthMonitor monitor); }
MonitoredSynth implements VocoSynth { @Override public void sendAmplitude(float amplitude) { amplitude = Math.min(amplitude, 1) * settings.amplitudeGain; doSetAmplitude(amplitude); if(monitor!=null) monitor.amplitudeChanged(amplitude); } MonitoredSynth();  MonitoredSynth(SynthMonitor monitor); @Override void wire(); @Override void on(); @Override void off(); @Override JPanel newControlPanel(); @Override SynthMonitor getMonitor(); @Override void setMonitor(SynthMonitor controlLog); @Override SynthMonitorCharts getDefaultMonitor(MonitorSettings settings); @Override void sendAmplitude(float amplitude); @Override void sendFrequency(float frequency); @Override void sendConfidence(float confidence); @Override void sendOnset(float salience); @Override void sendOffset(); }
MonitoredSynth implements VocoSynth { @Override public void sendAmplitude(float amplitude) { amplitude = Math.min(amplitude, 1) * settings.amplitudeGain; doSetAmplitude(amplitude); if(monitor!=null) monitor.amplitudeChanged(amplitude); } MonitoredSynth();  MonitoredSynth(SynthMonitor monitor); @Override void wire(); @Override void on(); @Override void off(); @Override JPanel newControlPanel(); @Override SynthMonitor getMonitor(); @Override void setMonitor(SynthMonitor controlLog); @Override SynthMonitorCharts getDefaultMonitor(MonitorSettings settings); @Override void sendAmplitude(float amplitude); @Override void sendFrequency(float frequency); @Override void sendConfidence(float confidence); @Override void sendOnset(float salience); @Override void sendOffset(); public SynthSettings settings; }