package com.domemusictechnologies.timestream;


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
//[/user-imports]


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

public TimeStream( long moduleID, VoltageObjects voltageObjects )
{
   super( moduleID, voltageObjects, "Time Stream Integrator", ModuleType.ModuleType_Utility, 2.0 );

   InitializeControls();


   canBeBypassed = false;
   SetSkin( "61f290b859e14eaba288d4d5a10cb113" );
}

void InitializeControls()
{

   textLabel1 = new VoltageLabel( "textLabel1", "textLabel1", this, "Time Stream Integrator" );
   AddComponent( textLabel1 );
   textLabel1.SetWantsMouseNotifications( false );
   textLabel1.SetPosition( 17, -1 );
   textLabel1.SetSize( 110, 30 );
   textLabel1.SetEditable( false, false );
   textLabel1.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel1.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel1.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel1.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel1.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel1.SetBorderSize( 1 );
   textLabel1.SetMultiLineEdit( true );
   textLabel1.SetIsNumberEditor( false );
   textLabel1.SetNumberEditorRange( 0, 100 );
   textLabel1.SetNumberEditorInterval( 1 );
   textLabel1.SetNumberEditorUsesMouseWheel( false );
   textLabel1.SetHasCustomTextHoverColor( false );
   textLabel1.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel1.SetFont( "Verdana", 14, false, false );

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

   inputAudio = new VoltageAudioJack( "Audio Input", "Audio Input", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio );
   inputAudio.SetWantsMouseNotifications( false );
   inputAudio.SetPosition( 36, 56 );
   inputAudio.SetSize( 25, 25 );
   inputAudio.SetSkin( "Jack Round Sky Ring" );

   textLabel5 = new VoltageLabel( "textLabel5", "textLabel5", this, "Blueshift/Up" );
   AddComponent( textLabel5 );
   textLabel5.SetWantsMouseNotifications( false );
   textLabel5.SetPosition( 61, 153 );
   textLabel5.SetSize( 63, 15 );
   textLabel5.SetEditable( false, false );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel5.SetColor( new Color( 60, 184, 248, 255 ) );
   textLabel5.SetBkColor( new Color( 0, 0, 0, 73 ) );
   textLabel5.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel5.SetBorderSize( 1 );
   textLabel5.SetMultiLineEdit( false );
   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 );

   textLabel6 = new VoltageLabel( "textLabel6", "textLabel6", this, "Redshift/Down" );
   AddComponent( textLabel6 );
   textLabel6.SetWantsMouseNotifications( false );
   textLabel6.SetPosition( 61, 167 );
   textLabel6.SetSize( 63, 15 );
   textLabel6.SetEditable( false, false );
   textLabel6.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel6.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel6.SetColor( new Color( 255, 33, 33, 255 ) );
   textLabel6.SetBkColor( new Color( 0, 0, 0, 73 ) );
   textLabel6.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel6.SetBorderSize( 1 );
   textLabel6.SetMultiLineEdit( false );
   textLabel6.SetIsNumberEditor( false );
   textLabel6.SetNumberEditorRange( 0, 100 );
   textLabel6.SetNumberEditorInterval( 1 );
   textLabel6.SetNumberEditorUsesMouseWheel( false );
   textLabel6.SetHasCustomTextHoverColor( false );
   textLabel6.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel6.SetFont( "Verdana", 10, false, false );

   textLabel7 = new VoltageLabel( "textLabel7", "textLabel7", this, "Reverse/-ve" );
   AddComponent( textLabel7 );
   textLabel7.SetWantsMouseNotifications( false );
   textLabel7.SetPosition( 61, 181 );
   textLabel7.SetSize( 63, 15 );
   textLabel7.SetEditable( false, false );
   textLabel7.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel7.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel7.SetColor( new Color( 219, 119, 248, 255 ) );
   textLabel7.SetBkColor( new Color( 0, 0, 0, 73 ) );
   textLabel7.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel7.SetBorderSize( 1 );
   textLabel7.SetMultiLineEdit( false );
   textLabel7.SetIsNumberEditor( false );
   textLabel7.SetNumberEditorRange( 0, 100 );
   textLabel7.SetNumberEditorInterval( 1 );
   textLabel7.SetNumberEditorUsesMouseWheel( false );
   textLabel7.SetHasCustomTextHoverColor( false );
   textLabel7.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel7.SetFont( "Verdana", 10, false, false );

   switchFastSlow = new VoltageSwitch( "Fast / Slow Switch", "Fast / Slow Switch", this, 1 );
   AddComponent( switchFastSlow );
   switchFastSlow.SetWantsMouseNotifications( false );
   switchFastSlow.SetPosition( 7, 157 );
   switchFastSlow.SetSize( 35, 35 );
   switchFastSlow.SetSkin( "2-State Bar Red" );

   textLabel8 = new VoltageLabel( "textLabel8", "textLabel8", this, "Fast" );
   AddComponent( textLabel8 );
   textLabel8.SetWantsMouseNotifications( false );
   textLabel8.SetPosition( 12, 144 );
   textLabel8.SetSize( 30, 17 );
   textLabel8.SetEditable( false, false );
   textLabel8.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel8.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel8.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel8.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel8.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel8.SetBorderSize( 1 );
   textLabel8.SetMultiLineEdit( false );
   textLabel8.SetIsNumberEditor( false );
   textLabel8.SetNumberEditorRange( 0, 100 );
   textLabel8.SetNumberEditorInterval( 1 );
   textLabel8.SetNumberEditorUsesMouseWheel( false );
   textLabel8.SetHasCustomTextHoverColor( false );
   textLabel8.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel8.SetFont( "Verdana", 12, false, false );

   textLabel12 = new VoltageLabel( "textLabel12", "textLabel12", this, "Mix" );
   AddComponent( textLabel12 );
   textLabel12.SetWantsMouseNotifications( false );
   textLabel12.SetPosition( 14, 83 );
   textLabel12.SetSize( 30, 17 );
   textLabel12.SetEditable( false, false );
   textLabel12.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel12.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel12.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel12.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel12.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel12.SetBorderSize( 1 );
   textLabel12.SetMultiLineEdit( false );
   textLabel12.SetIsNumberEditor( false );
   textLabel12.SetNumberEditorRange( 0, 100 );
   textLabel12.SetNumberEditorInterval( 1 );
   textLabel12.SetNumberEditorUsesMouseWheel( false );
   textLabel12.SetHasCustomTextHoverColor( false );
   textLabel12.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel12.SetFont( "Verdana", 12, false, false );

   textLabel13 = new VoltageLabel( "textLabel13", "textLabel13", this, "Shift" );
   AddComponent( textLabel13 );
   textLabel13.SetWantsMouseNotifications( false );
   textLabel13.SetPosition( 61, 83 );
   textLabel13.SetSize( 30, 17 );
   textLabel13.SetEditable( false, false );
   textLabel13.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel13.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel13.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel13.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel13.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel13.SetBorderSize( 1 );
   textLabel13.SetMultiLineEdit( false );
   textLabel13.SetIsNumberEditor( false );
   textLabel13.SetNumberEditorRange( 0, 100 );
   textLabel13.SetNumberEditorInterval( 1 );
   textLabel13.SetNumberEditorUsesMouseWheel( false );
   textLabel13.SetHasCustomTextHoverColor( false );
   textLabel13.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel13.SetFont( "Verdana", 12, false, false );

   textLabel14 = new VoltageLabel( "textLabel14", "textLabel14", this, "F/B" );
   AddComponent( textLabel14 );
   textLabel14.SetWantsMouseNotifications( false );
   textLabel14.SetPosition( 111, 82 );
   textLabel14.SetSize( 25, 19 );
   textLabel14.SetEditable( false, false );
   textLabel14.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel14.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel14.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel14.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel14.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel14.SetBorderSize( 1 );
   textLabel14.SetMultiLineEdit( false );
   textLabel14.SetIsNumberEditor( false );
   textLabel14.SetNumberEditorRange( 0, 100 );
   textLabel14.SetNumberEditorInterval( 1 );
   textLabel14.SetNumberEditorUsesMouseWheel( false );
   textLabel14.SetHasCustomTextHoverColor( false );
   textLabel14.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel14.SetFont( "Verdana", 12, false, false );

   textLabel20 = new VoltageLabel( "textLabel20", "textLabel20", this, "Dry" );
   AddComponent( textLabel20 );
   textLabel20.SetWantsMouseNotifications( false );
   textLabel20.SetPosition( 6, 129 );
   textLabel20.SetSize( 18, 13 );
   textLabel20.SetEditable( false, false );
   textLabel20.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel20.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel20.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel20.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel20.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel20.SetBorderSize( 1 );
   textLabel20.SetMultiLineEdit( false );
   textLabel20.SetIsNumberEditor( false );
   textLabel20.SetNumberEditorRange( 0, 100 );
   textLabel20.SetNumberEditorInterval( 1 );
   textLabel20.SetNumberEditorUsesMouseWheel( false );
   textLabel20.SetHasCustomTextHoverColor( false );
   textLabel20.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel20.SetFont( "Verdana", 8, false, false );

   textLabel21 = new VoltageLabel( "textLabel21", "textLabel21", this, "Wet" );
   AddComponent( textLabel21 );
   textLabel21.SetWantsMouseNotifications( false );
   textLabel21.SetPosition( 27, 129 );
   textLabel21.SetSize( 18, 13 );
   textLabel21.SetEditable( false, false );
   textLabel21.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel21.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel21.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel21.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel21.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel21.SetBorderSize( 1 );
   textLabel21.SetMultiLineEdit( false );
   textLabel21.SetIsNumberEditor( false );
   textLabel21.SetNumberEditorRange( 0, 100 );
   textLabel21.SetNumberEditorInterval( 1 );
   textLabel21.SetNumberEditorUsesMouseWheel( false );
   textLabel21.SetHasCustomTextHoverColor( false );
   textLabel21.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel21.SetFont( "Verdana", 8, false, false );

   textLabel22 = new VoltageLabel( "textLabel22", "textLabel22", this, "0" );
   AddComponent( textLabel22 );
   textLabel22.SetWantsMouseNotifications( false );
   textLabel22.SetPosition( 61, 129 );
   textLabel22.SetSize( 10, 13 );
   textLabel22.SetEditable( false, false );
   textLabel22.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel22.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel22.SetColor( new Color( 208, 255, 0, 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", 8, false, false );

   textLabel23 = new VoltageLabel( "textLabel23", "textLabel23", this, "Oct" );
   AddComponent( textLabel23 );
   textLabel23.SetWantsMouseNotifications( false );
   textLabel23.SetPosition( 77, 131 );
   textLabel23.SetSize( 14, 9 );
   textLabel23.SetEditable( false, false );
   textLabel23.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel23.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel23.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel23.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel23.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel23.SetBorderSize( 1 );
   textLabel23.SetMultiLineEdit( false );
   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", 8, false, false );

   switchMode = new VoltageSwitch( "Mode Switch", "Mode Switch", this, 2 );
   AddComponent( switchMode );
   switchMode.SetWantsMouseNotifications( false );
   switchMode.SetPosition( 34, 157 );
   switchMode.SetSize( 35, 35 );
   switchMode.SetSkin( "3-State Bar Red" );

   textLabel9 = new VoltageLabel( "textLabel9", "textLabel9", this, "Slow" );
   AddComponent( textLabel9 );
   textLabel9.SetWantsMouseNotifications( false );
   textLabel9.SetPosition( 12, 187 );
   textLabel9.SetSize( 30, 17 );
   textLabel9.SetEditable( false, false );
   textLabel9.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel9.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel9.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel9.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel9.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel9.SetBorderSize( 1 );
   textLabel9.SetMultiLineEdit( false );
   textLabel9.SetIsNumberEditor( false );
   textLabel9.SetNumberEditorRange( 0, 100 );
   textLabel9.SetNumberEditorInterval( 1 );
   textLabel9.SetNumberEditorUsesMouseWheel( false );
   textLabel9.SetHasCustomTextHoverColor( false );
   textLabel9.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel9.SetFont( "Verdana", 12, false, false );

   outputAudio = new VoltageAudioJack( "Audio Output", "Audio Output", this, JackType.JackType_AudioOutput );
   AddComponent( outputAudio );
   outputAudio.SetWantsMouseNotifications( false );
   outputAudio.SetPosition( 84, 56 );
   outputAudio.SetSize( 25, 25 );
   outputAudio.SetSkin( "Jack Round Sky Ring" );

   textLabel18 = new VoltageLabel( "textLabel18", "textLabel18", this, "Audio Return" );
   AddComponent( textLabel18 );
   textLabel18.SetWantsMouseNotifications( false );
   textLabel18.SetPosition( 32, 269 );
   textLabel18.SetSize( 78, 17 );
   textLabel18.SetEditable( false, false );
   textLabel18.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel18.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel18.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel18.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel18.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel18.SetBorderSize( 1 );
   textLabel18.SetMultiLineEdit( false );
   textLabel18.SetIsNumberEditor( false );
   textLabel18.SetNumberEditorRange( 0, 100 );
   textLabel18.SetNumberEditorInterval( 1 );
   textLabel18.SetNumberEditorUsesMouseWheel( false );
   textLabel18.SetHasCustomTextHoverColor( false );
   textLabel18.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel18.SetFont( "Verdana", 12, false, false );

   textLabel19 = new VoltageLabel( "textLabel19", "textLabel19", this, "Time Control" );
   AddComponent( textLabel19 );
   textLabel19.SetWantsMouseNotifications( false );
   textLabel19.SetPosition( 35, 308 );
   textLabel19.SetSize( 73, 17 );
   textLabel19.SetEditable( false, false );
   textLabel19.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel19.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel19.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel19.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel19.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel19.SetBorderSize( 1 );
   textLabel19.SetMultiLineEdit( false );
   textLabel19.SetIsNumberEditor( false );
   textLabel19.SetNumberEditorRange( 0, 100 );
   textLabel19.SetNumberEditorInterval( 1 );
   textLabel19.SetNumberEditorUsesMouseWheel( false );
   textLabel19.SetHasCustomTextHoverColor( false );
   textLabel19.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel19.SetFont( "Verdana", 12, false, false );

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

   textLabel15 = new VoltageLabel( "textLabel15", "textLabel15", this, "Zeit 1" );
   AddComponent( textLabel15 );
   textLabel15.SetWantsMouseNotifications( false );
   textLabel15.SetPosition( 5, 210 );
   textLabel15.SetSize( 39, 17 );
   textLabel15.SetEditable( false, false );
   textLabel15.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel15.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel15.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel15.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel15.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel15.SetBorderSize( 1 );
   textLabel15.SetMultiLineEdit( false );
   textLabel15.SetIsNumberEditor( false );
   textLabel15.SetNumberEditorRange( 0, 100 );
   textLabel15.SetNumberEditorInterval( 1 );
   textLabel15.SetNumberEditorUsesMouseWheel( false );
   textLabel15.SetHasCustomTextHoverColor( false );
   textLabel15.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel15.SetFont( "Verdana", 12, false, false );

   textLabel16 = new VoltageLabel( "textLabel16", "textLabel16", this, "Zeit 2" );
   AddComponent( textLabel16 );
   textLabel16.SetWantsMouseNotifications( false );
   textLabel16.SetPosition( 106, 210 );
   textLabel16.SetSize( 37, 17 );
   textLabel16.SetEditable( false, false );
   textLabel16.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel16.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel16.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel16.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel16.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel16.SetBorderSize( 1 );
   textLabel16.SetMultiLineEdit( false );
   textLabel16.SetIsNumberEditor( false );
   textLabel16.SetNumberEditorRange( 0, 100 );
   textLabel16.SetNumberEditorInterval( 1 );
   textLabel16.SetNumberEditorUsesMouseWheel( false );
   textLabel16.SetHasCustomTextHoverColor( false );
   textLabel16.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel16.SetFont( "Verdana", 12, false, false );

   textLabel17 = new VoltageLabel( "textLabel17", "textLabel17", this, "Audio Send" );
   AddComponent( textLabel17 );
   textLabel17.SetWantsMouseNotifications( false );
   textLabel17.SetPosition( 32, 233 );
   textLabel17.SetSize( 78, 17 );
   textLabel17.SetEditable( false, false );
   textLabel17.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel17.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel17.SetColor( new Color( 208, 255, 0, 255 ) );
   textLabel17.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel17.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel17.SetBorderSize( 1 );
   textLabel17.SetMultiLineEdit( false );
   textLabel17.SetIsNumberEditor( false );
   textLabel17.SetNumberEditorRange( 0, 100 );
   textLabel17.SetNumberEditorInterval( 1 );
   textLabel17.SetNumberEditorUsesMouseWheel( false );
   textLabel17.SetHasCustomTextHoverColor( false );
   textLabel17.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel17.SetFont( "Verdana", 12, false, false );

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

   mixKnob = new VoltageKnob( "Dry / Wet Mix", "Dry / Wet Mix", this, 0.0, 1.0, 0.5 );
   AddComponent( mixKnob );
   mixKnob.SetWantsMouseNotifications( false );
   mixKnob.SetPosition( 6, 99 );
   mixKnob.SetSize( 37, 37 );
   mixKnob.SetSkin( "Plastic Blue" );
   mixKnob.SetRingSkin( "Crescent Frost/White" );
   mixKnob.SetRange( 0.0, 1.0, 0.5, false, 0 );
   mixKnob.SetKnobParams( 215, 145 );
   mixKnob.DisplayValueInPercent( true );
   mixKnob.SetKnobAdjustsRing( true );

   shiftKnob = new VoltageKnob( "Pitch Shift", "Pitch Shift", this, 0.0, 1.0, 0 );
   AddComponent( shiftKnob );
   shiftKnob.SetWantsMouseNotifications( false );
   shiftKnob.SetPosition( 55, 99 );
   shiftKnob.SetSize( 37, 37 );
   shiftKnob.SetSkin( "Plastic Dark Blue" );
   shiftKnob.SetRingSkin( "Ramp White/Dark Blue" );
   shiftKnob.SetRange( 0.0, 1.0, 0, false, 0 );
   shiftKnob.SetKnobParams( 215, 145 );
   shiftKnob.DisplayValueInPercent( false );
   shiftKnob.SetKnobAdjustsRing( true );

   feedbackKnob = new VoltageKnob( "Feedback", "Feedback", this, 0.0, 1.0, 0 );
   AddComponent( feedbackKnob );
   feedbackKnob.SetWantsMouseNotifications( false );
   feedbackKnob.SetPosition( 103, 98 );
   feedbackKnob.SetSize( 37, 37 );
   feedbackKnob.SetSkin( "Plastic Maroon" );
   feedbackKnob.SetRingSkin( "Ramp White/Maroon" );
   feedbackKnob.SetRange( 0.0, 1.0, 0, false, 0 );
   feedbackKnob.SetKnobParams( 215, 145 );
   feedbackKnob.DisplayValueInPercent( true );
   feedbackKnob.SetKnobAdjustsRing( true );

   zeit2TimeControl = new VoltageAudioJack( "Zeit 2 Time Control", "Zeit 2 Time Control", this, JackType.JackType_AudioOutput );
   AddComponent( zeit2TimeControl );
   zeit2TimeControl.SetWantsMouseNotifications( false );
   zeit2TimeControl.SetPosition( 103, 299 );
   zeit2TimeControl.SetSize( 37, 37 );
   zeit2TimeControl.SetSkin( "Jack Round" );

   zeit1TimeControl = new VoltageAudioJack( "Zeit 1 Time Control", "Zeit 1 Time Control", this, JackType.JackType_AudioOutput );
   AddComponent( zeit1TimeControl );
   zeit1TimeControl.SetWantsMouseNotifications( false );
   zeit1TimeControl.SetPosition( 3, 298 );
   zeit1TimeControl.SetSize( 37, 37 );
   zeit1TimeControl.SetSkin( "Jack Round" );

   zeit2Return = new VoltageAudioJack( "Zeit 2 Return", "Zeit 2 Return", this, JackType.JackType_AudioInput );
   AddComponent( zeit2Return );
   zeit2Return.SetWantsMouseNotifications( false );
   zeit2Return.SetPosition( 109, 266 );
   zeit2Return.SetSize( 25, 25 );
   zeit2Return.SetSkin( "Jack Round Orange Ring" );

   zeit1Return = new VoltageAudioJack( "Zeit 1 Return", "Zeit 1 Return", this, JackType.JackType_AudioInput );
   AddComponent( zeit1Return );
   zeit1Return.SetWantsMouseNotifications( false );
   zeit1Return.SetPosition( 8, 265 );
   zeit1Return.SetSize( 25, 25 );
   zeit1Return.SetSkin( "Jack Round Orange Ring" );

   zeit1Send = new VoltageAudioJack( "Zeit 1 Send", "Zeit 1 Send", this, JackType.JackType_AudioOutput );
   AddComponent( zeit1Send );
   zeit1Send.SetWantsMouseNotifications( false );
   zeit1Send.SetPosition( 8, 230 );
   zeit1Send.SetSize( 25, 25 );
   zeit1Send.SetSkin( "Jack Round Yellow Ring" );

   zeit2Send = new VoltageAudioJack( "Zeit 2 Send", "Zeit 2 Send", this, JackType.JackType_AudioOutput );
   AddComponent( zeit2Send );
   zeit2Send.SetWantsMouseNotifications( false );
   zeit2Send.SetPosition( 109, 230 );
   zeit2Send.SetSize( 25, 25 );
   zeit2Send.SetSkin( "Jack Round Yellow 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

   ReadPanelKnobValues();
   CheckPanelSwitches();
   ResetLFOs();

   //[/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
      {
         ReadPanelKnobValues();
      }
      break;
   
      case Slider_Changed:   // doubleValue is the new slider value
      {
      }
      break;
   
      case Button_Changed:   // doubleValue is the new button/toggle button value
      {
      }
      break;
   
      case Switch_Changed:   // doubleValue is the new switch value
      {
         CheckPanelSwitches();
         ResetLFOs();
      }
      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


/*private double  mixedreturn; */

   double temp;
   double smoothedMixValue;
   double smoothedShiftValue;
   double smoothedFeedbackValue;
   double zeit1Gain;
   double zeit2Gain;
   double finalMixedOutput;
   
   // Read audio signals from input jacks
   
   drySignal = inputAudio.GetValue();
   zeit1return = zeit1Return.GetValue();
   zeit2return = zeit2Return.GetValue();
   
   // Read smoothed knob settings

   smoothedMixValue      = smoothMix.GetSmoothValue();
   smoothedShiftValue    = smoothShift.GetSmoothValue();
   smoothedFeedbackValue = smoothFeedback.GetSmoothValue();
   
   // Calculate LFO output levels
   
   AmplitudeLFO.AdvanceSample();
   Time1LFO.AdvanceSample();
   Time2LFO.AdvanceSample();
   
   // Get amplitude triangle wave output in range 0.0 to 1.0
   
   zeit1Gain = (AmplitudeLFO.GetTriangleValue() + 5.0) / 10.0;
   zeit2Gain = 1.0 - zeit1Gain;
   
   // Get Time 1 rising ramp wave output in range 0.0 to 1.0
   temp = (Time1LFO.GetRampValue() + 5.0) / 10.0;

   // Apply polarising and scaling
   switch (currentMode)
   {
      case SHIFT_UP:
      {
         // Convert to falling sawtooth for upwards pitch shift
         temp = 1.0 - temp;
         temp *= shiftScalingFactor * smoothedShiftValue;
      }
      break;
      
      case SHIFT_DOWN:
      {
         // Shift scaling factor reduced to 0.5 for down shift
         temp *= shiftScalingFactor * smoothedShiftValue * 0.5;
      }
      break;
      
      case REVERSE:
      {
         temp *= shiftScalingFactor;
      }
      break;
      
   }
   
   zeit1TimeControl.SetValue(temp);

   // Get Time 2 rising ramp wave output in range 0.0 to 1.0
   temp = (Time2LFO.GetRampValue() + 5.0) / 10.0;
   
   // Apply polarising and scaling
   switch (currentMode)
   {
      case SHIFT_UP:
      {
         // Convert to falling sawtooth for upwards pitch shift
         temp = 1.0 - temp;
         temp *= shiftScalingFactor * smoothedShiftValue;
      }
      break;
      
      case SHIFT_DOWN:
      {
         // Shift scaling factor reduced to 0.5 for down shift
         temp *= shiftScalingFactor * smoothedShiftValue * 0.5;
      }
      break;
      
      case REVERSE:
      {
         temp *= shiftScalingFactor;
      }
      break;
      
   }
   
   zeit2TimeControl.SetValue(temp);

   // Calculate signal to send to both Zeits
   sendSignal = drySignal +
                smoothedFeedbackValue * previousWetSignal;   
   zeit1Send.SetValue(sendSignal);
   zeit2Send.SetValue(sendSignal);
   
   // Perform crossfade mixing on both return signals and save
   // as wet feedback value for next iteration
   
   previousWetSignal = zeit1return * zeit1Gain +
                       zeit2return * zeit2Gain;
                       
   // Limit to +/- 10.0 V to prevent runaway feedback
   
   if (previousWetSignal > 10.0)
   {
      previousWetSignal = 10.0;
   }
   else if (previousWetSignal < -10.0)
   {
      previousWetSignal = -10.0;
   }
   
   // Now, perform the final output mix based on setting of the
   // Dry / Wet Mix knob.
   
   finalMixedOutput = (1.0 - smoothedMixValue) * drySignal +
                             smoothedMixValue  * previousWetSignal;
   outputAudio.SetValue(finalMixedOutput);   
   
   //[/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



   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 zeit2Send;
private VoltageAudioJack zeit1Send;
private VoltageAudioJack zeit1Return;
private VoltageAudioJack zeit2Return;
private VoltageAudioJack zeit1TimeControl;
private VoltageAudioJack zeit2TimeControl;
private VoltageKnob feedbackKnob;
private VoltageKnob shiftKnob;
private VoltageKnob mixKnob;
private VoltageLabel textLabel11;
private VoltageLabel textLabel17;
private VoltageLabel textLabel16;
private VoltageLabel textLabel15;
private VoltageLabel textLabel10;
private VoltageLabel textLabel19;
private VoltageLabel textLabel18;
private VoltageAudioJack outputAudio;
private VoltageLabel textLabel9;
private VoltageSwitch switchMode;
private VoltageLabel textLabel23;
private VoltageLabel textLabel22;
private VoltageLabel textLabel21;
private VoltageLabel textLabel20;
private VoltageLabel textLabel14;
private VoltageLabel textLabel13;
private VoltageLabel textLabel12;
private VoltageLabel textLabel8;
private VoltageSwitch switchFastSlow;
private VoltageLabel textLabel7;
private VoltageLabel textLabel6;
private VoltageLabel textLabel5;
private VoltageAudioJack inputAudio;
private VoltageLabel textLabel2;
private VoltageLabel textLabel1;


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

// Constants

private final double FAST_SHIFT_FREQ = 5.0;
private final double SLOW_SHIFT_FREQ = 2.0;
private final double FAST_REVERSE_FREQ = 2.0;
private final double SLOW_REVERSE_FREQ = 0.8;
private final double FAST_SHIFT_PEAK = 1.0 / FAST_SHIFT_FREQ;
private final double SLOW_SHIFT_PEAK = 1.0 / SLOW_SHIFT_FREQ;
private final double FAST_REVERSE_PEAK = 2.0 / FAST_REVERSE_FREQ;
private final double SLOW_REVERSE_PEAK = 2.0 / SLOW_REVERSE_FREQ;
private final double DEGREES_000 = 0.0;
private final double DEGREES_180 = 0.5;

// Types

private enum CycleSpeed
{
   SLOW,    // 2 Hz / 500ms for shift, 0.8 Hz / 1250ms for reverse
   FAST     // 5 Hz / 200ms for shift, 2.0 Hz / 500ms for reverse
}

private enum Mode
{
   SHIFT_UP,   // Upwards pitch shift
   SHIFT_DOWN, // Downwards pitch shift
   REVERSE     // Reversed - no pitch shift
}

// Variables

private boolean fastSelected;
private Mode    currentMode;
private double  shiftScalingFactor;
private double  drySignal;
private double  previousWetSignal;
private double  sendSignal;
private double  zeit1return;
private double  zeit2return;
private double  mixedreturn;


// Objects

protected DigitalOscillator Time1LFO      = new DigitalOscillator();
protected DigitalOscillator Time2LFO      = new DigitalOscillator();
protected DigitalOscillator AmplitudeLFO  = new DigitalOscillator();

private SmoothValue smoothMix = new SmoothValue();
private SmoothValue smoothShift = new SmoothValue();
private SmoothValue smoothFeedback = new SmoothValue();

private void CheckConnections()
{
}

private void CheckPanelSwitches()
{
   double temp;
   
   fastSelected = (switchFastSlow.GetValue() > 0.5);
   
   temp = switchMode.GetValue();
   if (temp < 0.5)
   {
      currentMode = Mode.REVERSE;
   }
   else if (temp < 1.5)
   {
      currentMode = Mode.SHIFT_DOWN;
   }
   else
   {
      currentMode = Mode.SHIFT_UP;
   }
   
   if (currentMode == Mode.REVERSE)
   {
      shiftKnob.SetEnabled(false);
   }
   else
   {
      shiftKnob.SetEnabled(true);
   }
   
}

private void ResetLFOs()
{
   // Reset phase offsets
   AmplitudeLFO.ResetCycle();
   Time1LFO.ResetCycle();
   Time2LFO.SetCycle(DEGREES_180);
   
   // Set Frequencies
   if (fastSelected)
   {
      // Fast settings
      switch (currentMode)
      {
         case SHIFT_UP:
         case SHIFT_DOWN:
         {
            Time1LFO.SetFrequency(FAST_SHIFT_FREQ);
            Time2LFO.SetFrequency(FAST_SHIFT_FREQ);
            AmplitudeLFO.SetFrequency(FAST_SHIFT_FREQ);
            
            shiftScalingFactor = FAST_SHIFT_PEAK;
         }
         break;
         
         case REVERSE:
         {
            Time1LFO.SetFrequency(FAST_REVERSE_FREQ);
            Time2LFO.SetFrequency(FAST_REVERSE_FREQ);
            AmplitudeLFO.SetFrequency(FAST_REVERSE_FREQ);
            
            shiftScalingFactor = FAST_REVERSE_PEAK;
         }
         break;
      }
   }
   else
   {
      // Slow settings
      switch (currentMode)
      {
         case SHIFT_UP:
         case SHIFT_DOWN:
         {
            Time1LFO.SetFrequency(SLOW_SHIFT_FREQ);
            Time2LFO.SetFrequency(SLOW_SHIFT_FREQ);
            AmplitudeLFO.SetFrequency(SLOW_SHIFT_FREQ);
            
            shiftScalingFactor = SLOW_SHIFT_PEAK;
         }
         break;
         
         case REVERSE:
         {
            Time1LFO.SetFrequency(SLOW_REVERSE_FREQ);
            Time2LFO.SetFrequency(SLOW_REVERSE_FREQ);
            AmplitudeLFO.SetFrequency(SLOW_REVERSE_FREQ);
            
            shiftScalingFactor = SLOW_REVERSE_PEAK;
         }
         break;
      }
   }
}

private void ReadPanelKnobValues()
{
   smoothMix.SetValue(mixKnob.GetValue());
   smoothShift.SetValue(shiftKnob.GetValue());
   smoothFeedback.SetValue(feedbackKnob.GetValue());
}


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

 