package com.domemusictechnologies.domefilter;


import voltage.controllers.*;
import voltage.core.*;
import voltage.core.Jack.JackType;
import voltage.sources.*;
import voltage.utility.*;
import voltage.processors.*;
import voltage.effects.*;
import java.awt.*;

//[user-imports]   Add your own imports here

import java.math.*;
//[/user-imports]


public class DomeFilter extends VoltageModule
//[user-inheritance]
//[/user-inheritance]
{

@SuppressWarnings("this-escape") 
public DomeFilter( long moduleID, VoltageObjects voltageObjects )
{
   super( moduleID, voltageObjects, "Dome Filter & Frequency Shifter", ModuleType.ModuleType_Effect, 2.0 );

   InitializeControls();


   canBeBypassed = false;
   SetSkin( "8b30b758f97249b7a6d3a195f8d19f25" );
}

void InitializeControls()
{

   textLabel24 = new VoltageLabel( "textLabel24", "textLabel24", this, "Quadrature Outputs +/- 45°" );
   AddComponent( textLabel24 );
   textLabel24.SetWantsMouseNotifications( false );
   textLabel24.SetPosition( 42, 135 );
   textLabel24.SetSize( 61, 42 );
   textLabel24.SetEditable( false, false );
   textLabel24.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel24.SetJustificationFlags( VoltageLabel.Justification.Top );
   textLabel24.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel24.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel24.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel24.SetBorderSize( 1 );
   textLabel24.SetMultiLineEdit( true );
   textLabel24.SetIsNumberEditor( false );
   textLabel24.SetNumberEditorRange( 0, 100 );
   textLabel24.SetNumberEditorInterval( 1 );
   textLabel24.SetNumberEditorUsesMouseWheel( false );
   textLabel24.SetHasCustomTextHoverColor( false );
   textLabel24.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel24.SetFont( "Verdana", 12, false, false );

   textLabel4 = new VoltageLabel( "textLabel4", "textLabel4", this, "Dome Filter and Freq Shifter" );
   AddComponent( textLabel4 );
   textLabel4.SetWantsMouseNotifications( false );
   textLabel4.SetPosition( 22, 0 );
   textLabel4.SetSize( 101, 30 );
   textLabel4.SetEditable( false, false );
   textLabel4.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel4.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel4.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel4.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel4.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel4.SetBorderSize( 1 );
   textLabel4.SetMultiLineEdit( true );
   textLabel4.SetIsNumberEditor( false );
   textLabel4.SetNumberEditorRange( 0, 100 );
   textLabel4.SetNumberEditorInterval( 1 );
   textLabel4.SetNumberEditorUsesMouseWheel( false );
   textLabel4.SetHasCustomTextHoverColor( false );
   textLabel4.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel4.SetFont( "Verdana", 13, false, false );

   textLabel5 = new VoltageLabel( "textLabel5", "textLabel5", this, "Dome Music Technologies" );
   AddComponent( textLabel5 );
   textLabel5.SetWantsMouseNotifications( false );
   textLabel5.SetPosition( 9, 341 );
   textLabel5.SetSize( 128, 19 );
   textLabel5.SetEditable( false, false );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel5.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel5.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel5.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel5.SetBorderSize( 1 );
   textLabel5.SetMultiLineEdit( true );
   textLabel5.SetIsNumberEditor( false );
   textLabel5.SetNumberEditorRange( 0, 100 );
   textLabel5.SetNumberEditorInterval( 1 );
   textLabel5.SetNumberEditorUsesMouseWheel( false );
   textLabel5.SetHasCustomTextHoverColor( false );
   textLabel5.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel5.SetFont( "Verdana", 10, false, false );

   inputJackBroadband = new VoltageAudioJack( "Broadband Input", "Broadband Input", this, JackType.JackType_AudioInput );
   AddComponent( inputJackBroadband );
   inputJackBroadband.SetWantsMouseNotifications( false );
   inputJackBroadband.SetPosition( 13, 36 );
   inputJackBroadband.SetSize( 25, 25 );
   inputJackBroadband.SetSkin( "Jack Round Mint Ring" );

   textLabel22 = new VoltageLabel( "textLabel22", "textLabel22", this, "Broadband In" );
   AddComponent( textLabel22 );
   textLabel22.SetWantsMouseNotifications( false );
   textLabel22.SetPosition( 42, 41 );
   textLabel22.SetSize( 75, 14 );
   textLabel22.SetEditable( false, false );
   textLabel22.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel22.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel22.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel22.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel22.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel22.SetBorderSize( 1 );
   textLabel22.SetMultiLineEdit( false );
   textLabel22.SetIsNumberEditor( false );
   textLabel22.SetNumberEditorRange( 0, 100 );
   textLabel22.SetNumberEditorInterval( 1 );
   textLabel22.SetNumberEditorUsesMouseWheel( false );
   textLabel22.SetHasCustomTextHoverColor( false );
   textLabel22.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel22.SetFont( "Verdana", 12, false, false );

   textLabel33 = new VoltageLabel( "textLabel33", "textLabel33", this, "Frequency Shifter" );
   AddComponent( textLabel33 );
   textLabel33.SetWantsMouseNotifications( false );
   textLabel33.SetPosition( 7, 190 );
   textLabel33.SetSize( 130, 14 );
   textLabel33.SetEditable( false, false );
   textLabel33.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel33.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel33.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel33.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel33.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel33.SetBorderSize( 1 );
   textLabel33.SetMultiLineEdit( false );
   textLabel33.SetIsNumberEditor( false );
   textLabel33.SetNumberEditorRange( 0, 100 );
   textLabel33.SetNumberEditorInterval( 1 );
   textLabel33.SetNumberEditorUsesMouseWheel( false );
   textLabel33.SetHasCustomTextHoverColor( false );
   textLabel33.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel33.SetFont( "Verdana", 12, false, false );

   textLabel23 = new VoltageLabel( "textLabel23", "textLabel23", this, "Two-Channel Multi-Stage All-Pass Filter Chains" );
   AddComponent( textLabel23 );
   textLabel23.SetWantsMouseNotifications( false );
   textLabel23.SetPosition( 15, 79 );
   textLabel23.SetSize( 115, 40 );
   textLabel23.SetEditable( false, false );
   textLabel23.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel23.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel23.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel23.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel23.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel23.SetBorderSize( 1 );
   textLabel23.SetMultiLineEdit( true );
   textLabel23.SetIsNumberEditor( false );
   textLabel23.SetNumberEditorRange( 0, 100 );
   textLabel23.SetNumberEditorInterval( 1 );
   textLabel23.SetNumberEditorUsesMouseWheel( false );
   textLabel23.SetHasCustomTextHoverColor( false );
   textLabel23.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel23.SetFont( "Verdana", 12, false, false );

   outputJackCosine = new VoltageAudioJack( "Cosine Output", "Cosine Output", this, JackType.JackType_AudioOutput );
   AddComponent( outputJackCosine );
   outputJackCosine.SetWantsMouseNotifications( false );
   outputJackCosine.SetPosition( 13, 143 );
   outputJackCosine.SetSize( 25, 25 );
   outputJackCosine.SetSkin( "Jack Round Teal Ring" );

   outputJackSine = new VoltageAudioJack( "Sine Output", "Sine Output", this, JackType.JackType_AudioOutput );
   AddComponent( outputJackSine );
   outputJackSine.SetWantsMouseNotifications( false );
   outputJackSine.SetPosition( 107, 143 );
   outputJackSine.SetSize( 25, 25 );
   outputJackSine.SetSkin( "Jack Round Teal Ring" );

   textLabel25 = new VoltageLabel( "textLabel25", "textLabel25", this, "Cosine" );
   AddComponent( textLabel25 );
   textLabel25.SetWantsMouseNotifications( false );
   textLabel25.SetPosition( 8, 166 );
   textLabel25.SetSize( 40, 22 );
   textLabel25.SetEditable( false, false );
   textLabel25.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel25.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel25.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel25.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel25.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel25.SetBorderSize( 1 );
   textLabel25.SetMultiLineEdit( false );
   textLabel25.SetIsNumberEditor( false );
   textLabel25.SetNumberEditorRange( 0, 100 );
   textLabel25.SetNumberEditorInterval( 1 );
   textLabel25.SetNumberEditorUsesMouseWheel( false );
   textLabel25.SetHasCustomTextHoverColor( false );
   textLabel25.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel25.SetFont( "Verdana", 12, false, false );

   textLabel26 = new VoltageLabel( "textLabel26", "textLabel26", this, "Sine" );
   AddComponent( textLabel26 );
   textLabel26.SetWantsMouseNotifications( false );
   textLabel26.SetPosition( 107, 166 );
   textLabel26.SetSize( 35, 22 );
   textLabel26.SetEditable( false, false );
   textLabel26.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel26.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel26.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel26.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel26.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel26.SetBorderSize( 1 );
   textLabel26.SetMultiLineEdit( false );
   textLabel26.SetIsNumberEditor( false );
   textLabel26.SetNumberEditorRange( 0, 100 );
   textLabel26.SetNumberEditorInterval( 1 );
   textLabel26.SetNumberEditorUsesMouseWheel( false );
   textLabel26.SetHasCustomTextHoverColor( false );
   textLabel26.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel26.SetFont( "Verdana", 12, false, false );

   inputJackShiftCosine = new VoltageAudioJack( "Shift Cosine In", "Shift Cosine In", this, JackType.JackType_AudioInput );
   AddComponent( inputJackShiftCosine );
   inputJackShiftCosine.SetWantsMouseNotifications( false );
   inputJackShiftCosine.SetPosition( 21, 299 );
   inputJackShiftCosine.SetSize( 25, 25 );
   inputJackShiftCosine.SetSkin( "Jack Round Teal Ring" );

   inputJackShiftSine = new VoltageAudioJack( "Shift Sine In", "Shift Sine In", this, JackType.JackType_AudioInput );
   AddComponent( inputJackShiftSine );
   inputJackShiftSine.SetWantsMouseNotifications( false );
   inputJackShiftSine.SetPosition( 97, 299 );
   inputJackShiftSine.SetSize( 25, 25 );
   inputJackShiftSine.SetSkin( "Jack Round Teal Ring" );

   textLabel27 = new VoltageLabel( "textLabel27", "textLabel27", this, "Shift Osc In" );
   AddComponent( textLabel27 );
   textLabel27.SetWantsMouseNotifications( false );
   textLabel27.SetPosition( 32, 280 );
   textLabel27.SetSize( 80, 23 );
   textLabel27.SetEditable( false, false );
   textLabel27.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel27.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel27.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel27.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel27.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel27.SetBorderSize( 1 );
   textLabel27.SetMultiLineEdit( false );
   textLabel27.SetIsNumberEditor( false );
   textLabel27.SetNumberEditorRange( 0, 100 );
   textLabel27.SetNumberEditorInterval( 1 );
   textLabel27.SetNumberEditorUsesMouseWheel( false );
   textLabel27.SetHasCustomTextHoverColor( false );
   textLabel27.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel27.SetFont( "Verdana", 12, false, false );

   textLabel28 = new VoltageLabel( "textLabel28", "textLabel28", this, "Cosine" );
   AddComponent( textLabel28 );
   textLabel28.SetWantsMouseNotifications( false );
   textLabel28.SetPosition( 17, 322 );
   textLabel28.SetSize( 40, 20 );
   textLabel28.SetEditable( false, false );
   textLabel28.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel28.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel28.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel28.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel28.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel28.SetBorderSize( 1 );
   textLabel28.SetMultiLineEdit( false );
   textLabel28.SetIsNumberEditor( false );
   textLabel28.SetNumberEditorRange( 0, 100 );
   textLabel28.SetNumberEditorInterval( 1 );
   textLabel28.SetNumberEditorUsesMouseWheel( false );
   textLabel28.SetHasCustomTextHoverColor( false );
   textLabel28.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel28.SetFont( "Verdana", 12, false, false );

   textLabel29 = new VoltageLabel( "textLabel29", "textLabel29", this, "Sine" );
   AddComponent( textLabel29 );
   textLabel29.SetWantsMouseNotifications( false );
   textLabel29.SetPosition( 98, 324 );
   textLabel29.SetSize( 35, 17 );
   textLabel29.SetEditable( false, false );
   textLabel29.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel29.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel29.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel29.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel29.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel29.SetBorderSize( 1 );
   textLabel29.SetMultiLineEdit( false );
   textLabel29.SetIsNumberEditor( false );
   textLabel29.SetNumberEditorRange( 0, 100 );
   textLabel29.SetNumberEditorInterval( 1 );
   textLabel29.SetNumberEditorUsesMouseWheel( false );
   textLabel29.SetHasCustomTextHoverColor( false );
   textLabel29.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel29.SetFont( "Verdana", 12, false, false );

   outputJackUp = new VoltageAudioJack( "Up Shift", "Up Shift", this, JackType.JackType_AudioOutput );
   AddComponent( outputJackUp );
   outputJackUp.SetWantsMouseNotifications( false );
   outputJackUp.SetPosition( 107, 209 );
   outputJackUp.SetSize( 25, 25 );
   outputJackUp.SetSkin( "Jack Round Mint Ring" );

   outputJackDown = new VoltageAudioJack( "Down Shift", "Down Shift", this, JackType.JackType_AudioOutput );
   AddComponent( outputJackDown );
   outputJackDown.SetWantsMouseNotifications( false );
   outputJackDown.SetPosition( 13, 209 );
   outputJackDown.SetSize( 25, 25 );
   outputJackDown.SetSkin( "Jack Round Mint Ring" );

   sliderMix = new VoltageSlider( "Mix Balance", "Mix Balance", this, false, -1.0, 1.0, 0.0, 0 );
   AddComponent( sliderMix );
   sliderMix.SetWantsMouseNotifications( false );
   sliderMix.SetPosition( 14, 265 );
   sliderMix.SetSize( 116, 13 );
   sliderMix.SetSkin( "Straight Black Plain Horizontal" );
   sliderMix.DisplayValueInPercent( false );

   textLabel32 = new VoltageLabel( "textLabel32", "textLabel32", this, "Up" );
   AddComponent( textLabel32 );
   textLabel32.SetWantsMouseNotifications( false );
   textLabel32.SetPosition( 112, 233 );
   textLabel32.SetSize( 19, 18 );
   textLabel32.SetEditable( false, false );
   textLabel32.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel32.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel32.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel32.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel32.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel32.SetBorderSize( 1 );
   textLabel32.SetMultiLineEdit( false );
   textLabel32.SetIsNumberEditor( false );
   textLabel32.SetNumberEditorRange( 0, 100 );
   textLabel32.SetNumberEditorInterval( 1 );
   textLabel32.SetNumberEditorUsesMouseWheel( false );
   textLabel32.SetHasCustomTextHoverColor( false );
   textLabel32.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel32.SetFont( "Verdana", 12, false, false );

   textLabel30 = new VoltageLabel( "textLabel30", "textLabel30", this, "Down" );
   AddComponent( textLabel30 );
   textLabel30.SetWantsMouseNotifications( false );
   textLabel30.SetPosition( 10, 233 );
   textLabel30.SetSize( 33, 18 );
   textLabel30.SetEditable( false, false );
   textLabel30.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel30.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel30.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel30.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel30.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel30.SetBorderSize( 1 );
   textLabel30.SetMultiLineEdit( false );
   textLabel30.SetIsNumberEditor( false );
   textLabel30.SetNumberEditorRange( 0, 100 );
   textLabel30.SetNumberEditorInterval( 1 );
   textLabel30.SetNumberEditorUsesMouseWheel( false );
   textLabel30.SetHasCustomTextHoverColor( false );
   textLabel30.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel30.SetFont( "Verdana", 12, false, false );

   textLabel31 = new VoltageLabel( "textLabel31", "textLabel31", this, "Mix" );
   AddComponent( textLabel31 );
   textLabel31.SetWantsMouseNotifications( false );
   textLabel31.SetPosition( 62, 233 );
   textLabel31.SetSize( 23, 18 );
   textLabel31.SetEditable( false, false );
   textLabel31.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel31.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel31.SetColor( new Color( 214, 214, 214, 255 ) );
   textLabel31.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel31.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel31.SetBorderSize( 1 );
   textLabel31.SetMultiLineEdit( false );
   textLabel31.SetIsNumberEditor( false );
   textLabel31.SetNumberEditorRange( 0, 100 );
   textLabel31.SetNumberEditorInterval( 1 );
   textLabel31.SetNumberEditorUsesMouseWheel( false );
   textLabel31.SetHasCustomTextHoverColor( false );
   textLabel31.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel31.SetFont( "Verdana", 12, false, false );

   outputJackMix = new VoltageAudioJack( "Mix Shift", "Mix Shift", this, JackType.JackType_AudioOutput );
   AddComponent( outputJackMix );
   outputJackMix.SetWantsMouseNotifications( false );
   outputJackMix.SetPosition( 60, 209 );
   outputJackMix.SetSize( 25, 25 );
   outputJackMix.SetSkin( "Jack Round Mint Ring" );
}



//-------------------------------------------------------------------------------
//  public void Initialize()

//  Initialize will get called shortly after your module's constructor runs. You can use it to
//  do any initialization that the auto-generated code doesn't handle.
//-------------------------------------------------------------------------------
@Override
public void Initialize()
{
   //[user-Initialize]   Add your own initialization code here

   SetMixVolumes(sliderMix.GetValue());

   //[/user-Initialize]
}


//-------------------------------------------------------------------------------
//  public void Destroy()

//  Destroy will get called just before your module gets deleted. You can use it to perform any
//  cleanup that's not handled automatically by Java.
//-------------------------------------------------------------------------------
@Override
public void Destroy()
{
   super.Destroy();
   //[user-Destroy]   Add your own module-getting-deleted code here



   //[/user-Destroy]
}


//-------------------------------------------------------------------------------
//  public boolean Notify( VoltageComponent component, ModuleNotifications notification, double doubleValue, long longValue, int x, int y, Object object )

//  Notify will get called when various events occur - control values changing, timers firing, etc.
//-------------------------------------------------------------------------------
@Override
public boolean Notify( VoltageComponent component, ModuleNotifications notification, double doubleValue, long longValue, int x, int y, Object object )
{
   //[user-Notify]   Add your own notification handling code between this line and the notify-close comment
   switch( notification )
   {
      case Knob_Changed:   // doubleValue is the new VoltageKnob value
      {
      }
      break;
   
      case Slider_Changed:   // doubleValue is the new slider value
      {
         if (component == sliderMix)
         {
            SetMixVolumes(doubleValue);
         }
      }
      break;
   
      case Button_Changed:   // doubleValue is the new button/toggle button value
      {
      }
      break;
   
      case Switch_Changed:   // doubleValue is the new switch value
      {
      }
      break;
   
      case Jack_Connected:   // longValue is the new cable ID
      {
      }
      break;
   
      case Jack_Disconnected:   // All cables have been disconnected from this jack
      {
      }
      break;
   
      case GUI_Update_Timer:   // Called every 50ms (by default) if turned on
      {
      }
      break;
   
      case Object_MouseMove:   // called when mouse is over an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_MouseLeave:  // called when mouse leaves an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_LeftButtonDown:   // called when user left-clicks on an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_LeftButtonUp:   // called when user releases left mouse button on an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_RightButtonDown:   // called when user releases right mouse button on an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_RightButtonUp:   // called when user right-clicks on an object that receives mouse notifications
      {
      }
      break;
   
      case Object_LeftButtonDoubleClick: // called when user left-button double-clicks on an object that receives mouse notifications
      {
      }
      break;
   
      // Less common notifications:
   
      case Named_Timer:   // object contains a String with the name of the timer that has fired
      {
      }
      break;
   
      case Canvas_Painting:   // About to paint canvas.  object is a java.awt.Rectangle with painting boundaries
      {
      }
      break;
   
      case Canvas_Painted:   // Canvas painting is complete
      {
      }
      break;
   
      case Control_DragStart:    // A user has started dragging on a control that has been marked as draggable
      {
      }
      break;
   
      case Control_DragOn:       // This control has been dragged over during a drag operation. object contains the dragged object
      {
      }
      break;
   
      case Control_DragOff:      // This control has been dragged over during a drag operation. object contains the dragged object
      {
      }
      break;
   
      case Control_DragEnd:      // A user has ended their drag on a control that has been marked as draggable
      {
      }
      break;
   
      case Label_Changed:        // The text of an editable text control has changed
      {
      }
      break;
   
      case SoundPlayback_Start:   // A sound has begun playback
      {
      }
      break;
   
      case SoundPlayback_End:     // A sound has ended playback
      {
      }
      break;
   
      case Scrollbar_Position:    // longValue is the new scrollbar position
      {
      }
      break;
   
      case PolyVoices_Changed:    // longValue is the new number of poly voices
      {
      }
      break;
   
      case File_Dropped:     // 'object' is a String containing the file path
      {
      }
      break;
   
      case Preset_Loading_Start:   // called when preset loading begins
      {
      }
      break;
   
      case Preset_Loading_Finish:  // called when preset loading finishes
      {
      }
      break;
   
      case Variation_Loading_Start:    // sent when a variation is about to load
      {
      }
      break;
   
      case Variation_Loading_Finish:   // sent when a variation has just finished loading
      {
      }
      break;
   
      case Tempo_Changed:     // doubleValue is the new tempo
      {
      }
      break;
   
      case Randomized:     // called when the module's controls get randomized
      {
      }
      break;
   
      case VariationListChanged:   // sent when a variation gets added, deleted, or renamed, or the variations list gets reordered
      {
      }
      break;
   
      case Key_Press:     // sent when module has keyboard focus and a key is pressed; object is a VoltageKeyPressInfo object
      {
      }
      break;
   
      case Reset:    // sent when the module has been reset to default settings
      {
      }
      break;
   
      case Keyboard_NoteOn:   // sent when a note has been pressed on a VoltageKeyboard object. longValue is the note value ( 0-127 )
      {
      }
      break;
   
      case Keyboard_NoteOff:   // sent when a note has been released on a VoltageKeyboard object. longValue is the note value ( 0-127 )
      {
      }
      break;
   
      case Curve_Changed:   // sent when user has edited a curve's value. 'object' will be a VoltageCurve.CurveChangeNotification object.
      {
      }
      break;
   }



   return false;
   //[/user-Notify]
}


//-------------------------------------------------------------------------------
//  public void ProcessSample()

//  ProcessSample is called once per sample. Usually it's where you read
//  from input jacks, process audio, and write it to your output jacks.
//  Since ProcesssSample gets called 48,000 times per second, offload CPU-intensive operations
//  to other threads when possible and avoid calling native functions.
//-------------------------------------------------------------------------------
@Override
public void ProcessSample()
{
   //[user-ProcessSample]   Add your own process-sampling code here

   double broadbandIn;
   double cosineDomeOut;
   double sineDomeOut;
   double ringMod1Output;
   double ringMod2Output;
   double upShiftOutput;
   double downShiftOutput;
   double mixShiftOutput;
   double mix;
   double dryValue;
   double upValue;
   double downValue;
   
   broadbandIn = inputJackBroadband.GetValue();
   
   // Calculate Channel A all-pass filter chain

   // Stage A1
   xa1_n_1 = xa1_n;
   ya1_n_1 = ya1_n;
   
   xa1_n = broadbandIn;
   
   ya1_n = (-gain_a1 * xa1_n) + xa1_n_1 + (gain_a1 * ya1_n_1);
   
   // Stage A2
   xa2_n_1 = xa2_n;
   ya2_n_1 = ya2_n;
   
   xa2_n = ya1_n;
   
   ya2_n = (-gain_a2 * xa2_n) + xa2_n_1 + (gain_a2 * ya2_n_1);
   
   // Stage A3
   xa3_n_1 = xa3_n;
   ya3_n_1 = ya3_n;
   
   xa3_n = ya2_n;
   
   ya3_n = (-gain_a3 * xa3_n) + xa3_n_1 + (gain_a3 * ya3_n_1);
   
   // Stage A4
   xa4_n_1 = xa4_n;
   ya4_n_1 = ya4_n;
   
   xa4_n = ya3_n;
   
   ya4_n = (-gain_a4 * xa4_n) + xa4_n_1 + (gain_a4 * ya4_n_1);

   // Stage A5
   xa5_n_1 = xa5_n;
   ya5_n_1 = ya5_n;
   
   xa5_n = ya4_n;
   
   ya5_n = (-gain_a5 * xa5_n) + xa5_n_1 + (gain_a5 * ya5_n_1);
   
   // Stage A6
   xa6_n_1 = xa6_n;
   ya6_n_1 = ya6_n;
   
   xa6_n = ya5_n;
   
   ya6_n = (-gain_a6 * xa6_n) + xa6_n_1 + (gain_a6 * ya6_n_1);
   
   // Output to Sine socket, and retain value for use in Frequency Shifter
   sineDomeOut = ya6_n;
   outputJackSine.SetValue(sineDomeOut);


   // Calculate Channel B all-pass filter chain

   // Stage B1
   xb1_n_1 = xb1_n;
   yb1_n_1 = yb1_n;
   
   xb1_n = broadbandIn;
   
   yb1_n = (-gain_b1 * xb1_n) + xb1_n_1 + (gain_b1 * yb1_n_1);
   
   // Stage B2
   xb2_n_1 = xb2_n;
   yb2_n_1 = yb2_n;
   
   xb2_n = yb1_n;
   
   yb2_n = (-gain_b2 * xb2_n) + xb2_n_1 + (gain_b2 * yb2_n_1);
   
   // Stage B3
   xb3_n_1 = xb3_n;
   yb3_n_1 = yb3_n;
   
   xb3_n = yb2_n;
   
   yb3_n = (-gain_b3 * xb3_n) + xb3_n_1 + (gain_b3 * yb3_n_1);
   
   // Stage B4
   xb4_n_1 = xb4_n;
   yb4_n_1 = yb4_n;
   
   xb4_n = yb3_n;
   
   yb4_n = (-gain_b4 * xb4_n) + xb4_n_1 + (gain_b4 * yb4_n_1);

   // Stage B5
   xb5_n_1 = xb5_n;
   yb5_n_1 = yb5_n;
   
   xb5_n = yb4_n;
   
   yb5_n = (-gain_b5 * xb5_n) + xb5_n_1 + (gain_b5 * yb5_n_1);
   
   // Stage B6
   xb6_n_1 = xb6_n;
   yb6_n_1 = yb6_n;
   
   xb6_n = yb5_n;
   
   yb6_n = (-gain_b6 * xb6_n) + xb6_n_1 + (gain_b6 * yb6_n_1);
   
   // Output to Cosine socket, and retain value for use in Frequency Shifter
   cosineDomeOut = yb6_n;
   outputJackCosine.SetValue(cosineDomeOut);
   
   
   // Frequency Shifter Processing
   ringMod1Output = sineDomeOut * inputJackShiftCosine.GetValue() * 0.2;
   ringMod2Output = cosineDomeOut * inputJackShiftSine.GetValue() * 0.2;
   
   upShiftOutput   = ringMod1Output + ringMod2Output;
   downShiftOutput = ringMod2Output - ringMod1Output;
   
   outputJackUp.SetValue(upShiftOutput);
   outputJackDown.SetValue(downShiftOutput);
   
   // Read Mix slider smooth value on every iteration
   mix = smoothMix.GetSmoothValue();
   
   if (outputJackMix.IsConnected())
   {
      // Only calculate mix output if socket is connected
      if (mix >= 0.0)
      {
         // Dry / Up Mix
         upValue = mix;
         dryValue = 1.0 - upValue;
         mixShiftOutput = (upValue * upShiftOutput) + (dryValue * broadbandIn);
      }
      else
      {
         // Dry / Down Mix
         downValue = -mix;
         dryValue = 1.0 - downValue;
         mixShiftOutput = (downValue * downShiftOutput) + (dryValue * broadbandIn);
      }
   
      outputJackMix.SetValue(mixShiftOutput);
   }

   //[/user-ProcessSample]
}


//-------------------------------------------------------------------------------
//  public String GetTooltipText( VoltageComponent component )

//  Gets called when a tooltip is about to display for a control. Override it if
//  you want to change what the tooltip displays - if you want a knob to work in logarithmic fashion,
//  for instance, you can translate the knob's current value to a log-based string and display it here.
//-------------------------------------------------------------------------------
@Override
public String GetTooltipText( VoltageComponent component )
{
   //[user-GetTooltipText]   Add your own code here

   if (component == sliderMix)
   {
      return mixToolTip;
   }

   return super.GetTooltipText( component );
   //[/user-GetTooltipText]
}


//-------------------------------------------------------------------------------
//  public void EditComponentValue( VoltageComponent component, double newValue, String newText )

//  Gets called after a user clicks on a tooltip and types in a new value for a control. Override this if
//  you've changed the default tooltip display (translating a linear value to logarithmic, for instance)
//  in GetTooltipText().
//-------------------------------------------------------------------------------
@Override
public void EditComponentValue( VoltageComponent component, double newValue, String newText )
{
   //[user-EditComponentValue]   Add your own code here



   //[/user-EditComponentValue]
   super.EditComponentValue( component, newValue, newText );
}


//-------------------------------------------------------------------------------
//  public void OnUndoRedo( String undoType, double newValue, Object optionalObject )

//  If you've created custom undo events via calls to CreateUndoEvent, you'll need to
//  process them in this function when they get triggered by undo/redo actions.
//-------------------------------------------------------------------------------
@Override
public void OnUndoRedo( String undoType, double newValue, Object optionalObject )
{
   //[user-OnUndoRedo]   Add your own code here



   //[/user-OnUndoRedo]
}


//-------------------------------------------------------------------------------
//  public byte[] GetStateInformation()

//  Gets called when the module's state gets saved, typically when the user saves a preset with
//  this module in it. Voltage Modular will automatically save the states of knobs, sliders, etc.,
//  but if you have any custom state information you need to save, return it from this function.
//-------------------------------------------------------------------------------
@Override
public byte[] GetStateInformation()
{
   //[user-GetStateInformation]   Add your own code here



   return null;
   //[/user-GetStateInformation]
}


//-------------------------------------------------------------------------------
//  public void SetStateInformation(byte[] stateInfo)

//  Gets called when this module's state is getting restored, typically when a user opens a preset with
//  this module in it. The stateInfo parameter will contain whatever custom data you stored in GetStateInformation().
//-------------------------------------------------------------------------------
@Override
public void SetStateInformation(byte[] stateInfo)
{
   //[user-SetStateInformation]   Add your own code here



   //[/user-SetStateInformation]
}


//-------------------------------------------------------------------------------
//  public byte[] GetStateInformationForVariations()

//  Gets called when a user saves a variation with this module in it.
//  Voltage Modular will automatically save the states of knobs, sliders, etc.,
//  but if you have any custom state information you need to save, return it from this function.
//-------------------------------------------------------------------------------
@Override
public byte[] GetStateInformationForVariations()
{
   //[user-GetStateInformationForVariations]   Add your own code here



   return GetStateInformation();
   //[/user-GetStateInformationForVariations]
}


//-------------------------------------------------------------------------------
//  public void SetStateInformationForVariations(byte[] stateInfo)

//  Gets called when a user loads a variation with this module in it.
//  The stateInfo parameter will contain whatever custom data you stored in GetStateInformationForVariations().
//-------------------------------------------------------------------------------
@Override
public void SetStateInformationForVariations(byte[] stateInfo)
{
   //[user-SetStateInformationForVariations]   Add your own code here
   SetStateInformation(stateInfo);



   //[/user-SetStateInformationForVariations]
}


// Auto-generated variables
private VoltageAudioJack outputJackMix;
private VoltageLabel textLabel31;
private VoltageLabel textLabel30;
private VoltageLabel textLabel32;
private VoltageSlider sliderMix;
private VoltageAudioJack outputJackDown;
private VoltageAudioJack outputJackUp;
private VoltageLabel textLabel29;
private VoltageLabel textLabel28;
private VoltageLabel textLabel27;
private VoltageAudioJack inputJackShiftSine;
private VoltageAudioJack inputJackShiftCosine;
private VoltageLabel textLabel26;
private VoltageLabel textLabel25;
private VoltageAudioJack outputJackSine;
private VoltageAudioJack outputJackCosine;
private VoltageLabel textLabel23;
private VoltageLabel textLabel33;
private VoltageLabel textLabel22;
private VoltageAudioJack inputJackBroadband;
private VoltageLabel textLabel5;
private VoltageLabel textLabel4;
private VoltageLabel textLabel24;


//[user-code-and-variables]    Add your own variables and functions here


// All-Pass Filter Chain Coefficients

// A1 - 5.413 Hz
private double xa1_n   = 0.0;
private double xa1_n_1 = 0.0;
private double ya1_n   = 0.0;
private double ya1_n_1 = 0.0;
private final double gain_a1  = 0.99929169093;

// A2 - 41.124 Hz
private double xa2_n   = 0.0;
private double xa2_n_1 = 0.0;
private double ya2_n   = 0.0;
private double ya2_n_1 = 0.0;
private final double gain_a2  = 0.99463134401;

// A3 - 167.35 Hz
private double xa3_n   = 0.0;
private double xa3_n_1 = 0.0;
private double ya3_n   = 0.0;
private double ya3_n_1 = 0.0;
private final double gain_a3  = 0.97833213156;

// A4 - 671.54 Hz
private double xa4_n   = 0.0;
private double xa4_n_1 = 0.0;
private double ya4_n   = 0.0;
private double ya4_n_1 = 0.0;
private final double gain_a4  = 0.91584844556;

// A5 - 2692.9 Hz
private double xa5_n   = 0.0;
private double xa5_n_1 = 0.0;
private double ya5_n   = 0.0;
private double ya5_n_1 = 0.0;
private final double gain_a5  = 0.70292872045;

// A6 - 7285.0 Hz
private double xa6_n   = 0.0;
private double xa6_n_1 = 0.0;
private double ya6_n   = 0.0;
private double ya6_n_1 = 0.0;
private final double gain_a6  = 0.38534997626;




// B1 - 18.790 Hz
private double xb1_n   = 0.0;
private double xb1_n_1 = 0.0;
private double yb1_n   = 0.0;
private double yb1_n_1 = 0.0;
private final double gain_b1  = 0.99754341710;

// B2 - 83.327 Hz
private double xb2_n   = 0.0;
private double xb2_n_1 = 0.0;
private double yb2_n   = 0.0;
private double yb2_n_1 = 0.0;
private final double gain_b2  = 0.98915179206;

// B3 - 335.06 Hz
private double xb3_n   = 0.0;
private double xb3_n_1 = 0.0;
private double yb3_n   = 0.0;
private double yb3_n_1 = 0.0;
private final double gain_b3  = 0.95708865685;

// B4 - 1348.8 Hz
private double xb4_n   = 0.0;
private double xb4_n_1 = 0.0;
private double yb4_n   = 0.0;
private double yb4_n_1 = 0.0;
private final double gain_b4  = 0.83815057813;

// B5 - 5469.2 Hz
private double xb5_n   = 0.0;
private double xb5_n_1 = 0.0;
private double yb5_n   = 0.0;
private double yb5_n_1 = 0.0;
private final double gain_b5  = 0.48874392087;

// B6 - 31371.0 Hz
private double xb6_n   = 0.0;
private double xb6_n_1 = 0.0;
private double yb6_n   = 0.0;
private double yb6_n_1 = 0.0;
private final double gain_b6  = 0.01646590882;

private SmoothValue smoothMix = new SmoothValue();

private String mixToolTip;


private void SetMixVolumes (double mix)
{
   double dryValue;
   double downValue;
   double upValue;
   
   if (mix > 0.0)
   {
      // Dry / Up Mix
      downValue = 0.0;
      upValue = mix;
      dryValue = 1.0 - upValue;
      mixToolTip = String.format("%4.1f%% Dry, %4.1f%% Up", dryValue * 100.0, upValue * 100.0);
   }
   else
   {
      // Dry / Down Mix
      upValue = 0.0;
      downValue = -mix;
      dryValue = 1.0 - downValue;
      mixToolTip = String.format("%4.1f%% Dry, %4.1f%% Down", dryValue * 100.0, downValue * 100.0);
   }
   
   smoothMix.SetValue(mix);

}


//[/user-code-and-variables]
}

 