// Path: dev/java/vocobox-api/src/main/java/org/vocobox/events/On.java
// public interface On {
//     public void finish();
// }
// 
// Path: dev/java/vocobox-api/src/main/java/org/vocobox/model/synth/VocoSynth.java
// public interface VocoSynth {
//     // enable
//     public void wire();
//     public void on() throws Exception;
//     public void off();
//     
//     // play
//     public void sendAmplitude(float amplitude);
//     public void sendFrequency(float frequency);
//     public void sendConfidence(float confidence);
//     public void sendOnset(float salience);
//     public void sendOffset();
//     
//     // monitor
//     public SynthMonitor getMonitor();
//     public void setMonitor(SynthMonitor monitor);
//     public SynthMonitorCharts getDefaultMonitor(MonitorSettings settings);
//     
//     // UI controller
//     public JPanel newControlPanel();
// }


import java.util.List;
import org.vocobox.events.On;
import org.vocobox.events.SoundEvent;
import org.vocobox.model.synth.VocoSynth;
package org.vocobox.events.policies;



public class DefaultSoundEventPolicy extends AbstractSoundEventPolicy {

    public DefaultSoundEventPolicy() {
        super();
    }

    public DefaultSoundEventPolicy(VocoSynth synth) {
        super(synth);
    }

    @Override
    public void onPitch(SoundEvent e) {
        synth.sendFrequency(e.value);
    }

    @Override
    public void onAmplitude(SoundEvent e) {
        float a = e.value;//getNormalizeAmplitude(e);
       // System.out.println(a);
        synth.sendAmplitude(a);
    }

    public float getNormalizeAmplitude(SoundEvent e) {
        //System.out.println("normalized amplitude : " + e.value + " max : " + amplitudeEventConsumer.getStatistics().max);
        return e.value / amplitudeEventConsumer.getStatistics().max;
    }

    /* */

    @Override
    public void play() {
        amplitudeEventConsumer.runnerStart();
        pitchEventConsumer.runnerStart();
    }

    @Override
// Path: dev/java/vocobox-api/src/main/java/org/vocobox/events/On.java
// public interface On {
//     public void finish();
// }
// 
// Path: dev/java/vocobox-api/src/main/java/org/vocobox/model/synth/VocoSynth.java
// public interface VocoSynth {
//     // enable
//     public void wire();
//     public void on() throws Exception;
//     public void off();
//     
//     // play
//     public void sendAmplitude(float amplitude);
//     public void sendFrequency(float frequency);
//     public void sendConfidence(float confidence);
//     public void sendOnset(float salience);
//     public void sendOffset();
//     
//     // monitor
//     public SynthMonitor getMonitor();
//     public void setMonitor(SynthMonitor monitor);
//     public SynthMonitorCharts getDefaultMonitor(MonitorSettings settings);
//     
//     // UI controller
//     public JPanel newControlPanel();
// }


// Path: dev/java/vocobox-api/src/main/java/org/vocobox/events/policies/DefaultSoundEventPolicy.java
import java.util.List;
import org.vocobox.events.On;
import org.vocobox.events.SoundEvent;
import org.vocobox.model.synth.VocoSynth;

package org.vocobox.events.policies;



public class DefaultSoundEventPolicy extends AbstractSoundEventPolicy {

    public DefaultSoundEventPolicy() {
        super();
    }

    public DefaultSoundEventPolicy(VocoSynth synth) {
        super(synth);
    }

    @Override
    public void onPitch(SoundEvent e) {
        synth.sendFrequency(e.value);
    }

    @Override
    public void onAmplitude(SoundEvent e) {
        float a = e.value;//getNormalizeAmplitude(e);
       // System.out.println(a);
        synth.sendAmplitude(a);
    }

    public float getNormalizeAmplitude(SoundEvent e) {
        //System.out.println("normalized amplitude : " + e.value + " max : " + amplitudeEventConsumer.getStatistics().max);
        return e.value / amplitudeEventConsumer.getStatistics().max;
    }

    /* */

    @Override
    public void play() {
        amplitudeEventConsumer.runnerStart();
        pitchEventConsumer.runnerStart();
    }

    @Override
    public void play(On finish) {