package com.domemusictechnologies.shepardmoon;


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 ShepardMoon extends VoltageModule
//[user-inheritance]
//[/user-inheritance]
{

public ShepardMoon( long moduleID, VoltageObjects voltageObjects )
{
   super( moduleID, voltageObjects, "Shepard Moon", ModuleType.ModuleType_CVProcessors, 3.0 );

   InitializeControls();


   canBeBypassed = true;
   SetSkin( "84c28718485b425ebda956861c724de0" );
}

void InitializeControls()
{

   outputCV0 = new VoltageAudioJack( "CV Out 0", "CV Out 0", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV0 );
   outputCV0.SetWantsMouseNotifications( false );
   outputCV0.SetPosition( 112, 66 );
   outputCV0.SetSize( 25, 25 );
   outputCV0.SetSkin( "Jack Round Sky Ring" );

   inputAudio0 = new VoltageAudioJack( "Audio In 0", "Audio In 0", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio0 );
   inputAudio0.SetWantsMouseNotifications( false );
   inputAudio0.SetPosition( 84, 66 );
   inputAudio0.SetSize( 25, 25 );
   inputAudio0.SetSkin( "Jack Round Cherry Ring" );

   outputCV60 = new VoltageAudioJack( "CV Out 60", "CV Out 60", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV60 );
   outputCV60.SetWantsMouseNotifications( false );
   outputCV60.SetPosition( 180, 103 );
   outputCV60.SetSize( 25, 25 );
   outputCV60.SetSkin( "Jack Round Sky Ring" );

   inputAudio60 = new VoltageAudioJack( "Audio In 60", "Audio In 60", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio60 );
   inputAudio60.SetWantsMouseNotifications( false );
   inputAudio60.SetPosition( 180, 74 );
   inputAudio60.SetSize( 25, 25 );
   inputAudio60.SetSkin( "Jack Round Cherry Ring" );

   outputCV120 = new VoltageAudioJack( "CV Out 120", "CV Out 120", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV120 );
   outputCV120.SetWantsMouseNotifications( false );
   outputCV120.SetPosition( 182, 286 );
   outputCV120.SetSize( 25, 25 );
   outputCV120.SetSkin( "Jack Round Sky Ring" );

   inputAudio120 = new VoltageAudioJack( "Audio In 120", "Audio In 120", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio120 );
   inputAudio120.SetWantsMouseNotifications( false );
   inputAudio120.SetPosition( 182, 257 );
   inputAudio120.SetSize( 25, 25 );
   inputAudio120.SetSkin( "Jack Round Cherry Ring" );

   outputCV180 = new VoltageAudioJack( "CV Out 180", "CV Out 180", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV180 );
   outputCV180.SetWantsMouseNotifications( false );
   outputCV180.SetPosition( 84, 288 );
   outputCV180.SetSize( 25, 25 );
   outputCV180.SetSkin( "Jack Round Sky Ring" );

   inputAudio180 = new VoltageAudioJack( "Audio In 180", "Audio In 180", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio180 );
   inputAudio180.SetWantsMouseNotifications( false );
   inputAudio180.SetPosition( 119, 288 );
   inputAudio180.SetSize( 25, 25 );
   inputAudio180.SetSkin( "Jack Round Cherry Ring" );

   outputCV240 = new VoltageAudioJack( "CV Out 240", "CV Out 240", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV240 );
   outputCV240.SetWantsMouseNotifications( false );
   outputCV240.SetPosition( 16, 257 );
   outputCV240.SetSize( 25, 25 );
   outputCV240.SetSkin( "Jack Round Sky Ring" );

   inputAudio240 = new VoltageAudioJack( "Audio In 240", "Audio In 240", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio240 );
   inputAudio240.SetWantsMouseNotifications( false );
   inputAudio240.SetPosition( 16, 286 );
   inputAudio240.SetSize( 25, 25 );
   inputAudio240.SetSkin( "Jack Round Cherry Ring" );

   outputCV300 = new VoltageAudioJack( "CV Out 300", "CV Out 300", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV300 );
   outputCV300.SetWantsMouseNotifications( false );
   outputCV300.SetPosition( 16, 74 );
   outputCV300.SetSize( 25, 25 );
   outputCV300.SetSkin( "Jack Round Sky Ring" );

   inputAudio300 = new VoltageAudioJack( "Audio In 300", "Audio In 300", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio300 );
   inputAudio300.SetWantsMouseNotifications( false );
   inputAudio300.SetPosition( 16, 103 );
   inputAudio300.SetSize( 25, 25 );
   inputAudio300.SetSkin( "Jack Round Cherry Ring" );

   LEDch0 = new VoltageLED( "LED 0", "LED 0", this );
   AddComponent( LEDch0 );
   LEDch0.SetWantsMouseNotifications( false );
   LEDch0.SetPosition( 105, 88 );
   LEDch0.SetSize( 11, 11 );
   LEDch0.SetSkin( "Red" );

   LEDch60 = new VoltageLED( "LED 60", "LED 60", this );
   AddComponent( LEDch60 );
   LEDch60.SetWantsMouseNotifications( false );
   LEDch60.SetPosition( 187, 129 );
   LEDch60.SetSize( 11, 11 );
   LEDch60.SetSkin( "Red" );

   LEDch120 = new VoltageLED( "LED 120", "LED 120", this );
   AddComponent( LEDch120 );
   LEDch120.SetWantsMouseNotifications( false );
   LEDch120.SetPosition( 188, 245 );
   LEDch120.SetSize( 11, 11 );
   LEDch120.SetSkin( "Red" );

   LEDch180 = new VoltageLED( "LED 180", "LED 180", this );
   AddComponent( LEDch180 );
   LEDch180.SetWantsMouseNotifications( false );
   LEDch180.SetPosition( 108, 289 );
   LEDch180.SetSize( 11, 11 );
   LEDch180.SetSkin( "Red" );

   LEDch240 = new VoltageLED( "LED 240", "LED 240", this );
   AddComponent( LEDch240 );
   LEDch240.SetWantsMouseNotifications( false );
   LEDch240.SetPosition( 23, 245 );
   LEDch240.SetSize( 11, 11 );
   LEDch240.SetSkin( "Red" );

   LEDch300 = new VoltageLED( "LED 300", "LED 300", this );
   AddComponent( LEDch300 );
   LEDch300.SetWantsMouseNotifications( false );
   LEDch300.SetPosition( 23, 129 );
   LEDch300.SetSize( 11, 11 );
   LEDch300.SetSkin( "Red" );

   textLabel1 = new VoltageLabel( "textLabel1", "textLabel1", this, "Shepard Moon" );
   AddComponent( textLabel1 );
   textLabel1.SetWantsMouseNotifications( false );
   textLabel1.SetPosition( 8, 0 );
   textLabel1.SetSize( 200, 18 );
   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( false );
   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( 7, 342 );
   textLabel2.SetSize( 200, 18 );
   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 );

   knobRate = new VoltageKnob( "Rate", "Rate", this, 0.001, 10, 0.1 );
   AddComponent( knobRate );
   knobRate.SetWantsMouseNotifications( false );
   knobRate.SetPosition( 155, 316 );
   knobRate.SetSize( 27, 27 );
   knobRate.SetSkin( "Plastic Black" );
   knobRate.SetRange( 0.001, 10, 0.1, false, 0 );
   knobRate.SetKnobParams( 215, 145 );
   knobRate.DisplayValueInPercent( false );
   knobRate.SetKnobAdjustsRing( true );
   knobRate.SetMidpointValue( 0.1 );

   knobSlope = new VoltageKnob( "Slope", "Slope", this, -12, 12, 6 );
   AddComponent( knobSlope );
   knobSlope.SetWantsMouseNotifications( false );
   knobSlope.SetPosition( 20, 23 );
   knobSlope.SetSize( 27, 27 );
   knobSlope.SetSkin( "Plastic Black" );
   knobSlope.SetRange( -12, 12, 6, false, 0 );
   knobSlope.SetKnobParams( 215, 145 );
   knobSlope.DisplayValueInPercent( false );
   knobSlope.SetKnobAdjustsRing( true );

   knobVolume = new VoltageKnob( "Mix Out Volume", "Mix Out Volume", this, 0, 1, 0.5 );
   AddComponent( knobVolume );
   knobVolume.SetWantsMouseNotifications( false );
   knobVolume.SetPosition( 131, 23 );
   knobVolume.SetSize( 27, 27 );
   knobVolume.SetSkin( "Plastic Black" );
   knobVolume.SetRange( 0, 1, 0.5, false, 0 );
   knobVolume.SetKnobParams( 215, 145 );
   knobVolume.DisplayValueInPercent( false );
   knobVolume.SetKnobAdjustsRing( true );

   textLabel3 = new VoltageLabel( "textLabel3", "textLabel3", this, "Rate" );
   AddComponent( textLabel3 );
   textLabel3.SetWantsMouseNotifications( false );
   textLabel3.SetPosition( 181, 320 );
   textLabel3.SetSize( 29, 15 );
   textLabel3.SetEditable( false, false );
   textLabel3.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel3.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel3.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel3.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel3.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel3.SetBorderSize( 1 );
   textLabel3.SetMultiLineEdit( false );
   textLabel3.SetIsNumberEditor( false );
   textLabel3.SetNumberEditorRange( 0, 100 );
   textLabel3.SetNumberEditorInterval( 1 );
   textLabel3.SetNumberEditorUsesMouseWheel( false );
   textLabel3.SetHasCustomTextHoverColor( false );
   textLabel3.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel3.SetFont( "Verdana", 10, false, false );

   textLabel17 = new VoltageLabel( "textLabel17", "textLabel17", this, "Reset" );
   AddComponent( textLabel17 );
   textLabel17.SetWantsMouseNotifications( false );
   textLabel17.SetPosition( 14, 320 );
   textLabel17.SetSize( 29, 15 );
   textLabel17.SetEditable( false, false );
   textLabel17.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel17.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel17.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   textLabel19 = new VoltageLabel( "textLabel19", "textLabel19", this, "Uni" );
   AddComponent( textLabel19 );
   textLabel19.SetWantsMouseNotifications( false );
   textLabel19.SetPosition( 91, 24 );
   textLabel19.SetSize( 21, 14 );
   textLabel19.SetEditable( false, false );
   textLabel19.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel19.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel19.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   textLabel20 = new VoltageLabel( "textLabel20", "textLabel20", this, "Bi" );
   AddComponent( textLabel20 );
   textLabel20.SetWantsMouseNotifications( false );
   textLabel20.SetPosition( 91, 36 );
   textLabel20.SetSize( 16, 14 );
   textLabel20.SetEditable( false, false );
   textLabel20.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel20.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel20.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   textLabel22 = new VoltageLabel( "textLabel22", "textLabel22", this, "1" );
   AddComponent( textLabel22 );
   textLabel22.SetWantsMouseNotifications( false );
   textLabel22.SetPosition( 79, 327 );
   textLabel22.SetSize( 12, 14 );
   textLabel22.SetEditable( false, false );
   textLabel22.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel22.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel22.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   textLabel23 = new VoltageLabel( "textLabel23", "textLabel23", this, "4" );
   AddComponent( textLabel23 );
   textLabel23.SetWantsMouseNotifications( false );
   textLabel23.SetPosition( 142, 327 );
   textLabel23.SetSize( 10, 14 );
   textLabel23.SetEditable( false, false );
   textLabel23.SetJustificationFlags( VoltageLabel.Justification.Left );
   textLabel23.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel23.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   textLabel4 = new VoltageLabel( "textLabel4", "textLabel4", this, "Slope" );
   AddComponent( textLabel4 );
   textLabel4.SetWantsMouseNotifications( false );
   textLabel4.SetPosition( 20, 48 );
   textLabel4.SetSize( 29, 15 );
   textLabel4.SetEditable( false, false );
   textLabel4.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel4.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel4.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel4.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel4.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel4.SetBorderSize( 1 );
   textLabel4.SetMultiLineEdit( false );
   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", 10, false, false );

   textLabel18 = new VoltageLabel( "textLabel18", "textLabel18", this, "Polarity" );
   AddComponent( textLabel18 );
   textLabel18.SetWantsMouseNotifications( false );
   textLabel18.SetPosition( 62, 48 );
   textLabel18.SetSize( 40, 15 );
   textLabel18.SetEditable( false, false );
   textLabel18.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel18.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel18.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   textLabel5 = new VoltageLabel( "textLabel5", "textLabel5", this, "Volume" );
   AddComponent( textLabel5 );
   textLabel5.SetWantsMouseNotifications( false );
   textLabel5.SetPosition( 127, 48 );
   textLabel5.SetSize( 35, 15 );
   textLabel5.SetEditable( false, false );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel5.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel5.SetBkColor( new Color( 65, 65, 65, 0 ) );
   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 );

   textLabel21 = new VoltageLabel( "textLabel21", "textLabel21", this, "Overlap Width" );
   AddComponent( textLabel21 );
   textLabel21.SetWantsMouseNotifications( false );
   textLabel21.SetPosition( 74, 314 );
   textLabel21.SetSize( 81, 15 );
   textLabel21.SetEditable( false, false );
   textLabel21.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel21.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel21.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   textLabel6 = new VoltageLabel( "textLabel6", "textLabel6", this, "0" );
   AddComponent( textLabel6 );
   textLabel6.SetWantsMouseNotifications( false );
   textLabel6.SetPosition( 105, 101 );
   textLabel6.SetSize( 12, 15 );
   textLabel6.SetEditable( false, false );
   textLabel6.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel6.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel6.SetColor( new Color( 0, 0, 0, 255 ) );
   textLabel6.SetBkColor( new Color( 65, 65, 65, 0 ) );
   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", 14, true, false );

   textLabel7 = new VoltageLabel( "textLabel7", "textLabel7", this, "60" );
   AddComponent( textLabel7 );
   textLabel7.SetWantsMouseNotifications( false );
   textLabel7.SetPosition( 167, 136 );
   textLabel7.SetSize( 20, 15 );
   textLabel7.SetEditable( false, false );
   textLabel7.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel7.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel7.SetColor( new Color( 0, 0, 0, 255 ) );
   textLabel7.SetBkColor( new Color( 65, 65, 65, 0 ) );
   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", 14, true, false );

   textLabel8 = new VoltageLabel( "textLabel8", "textLabel8", this, "120" );
   AddComponent( textLabel8 );
   textLabel8.SetWantsMouseNotifications( false );
   textLabel8.SetPosition( 158, 236 );
   textLabel8.SetSize( 28, 15 );
   textLabel8.SetEditable( false, false );
   textLabel8.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel8.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel8.SetColor( new Color( 0, 0, 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", 14, true, false );

   textLabel9 = new VoltageLabel( "textLabel9", "textLabel9", this, "240" );
   AddComponent( textLabel9 );
   textLabel9.SetWantsMouseNotifications( false );
   textLabel9.SetPosition( 38, 237 );
   textLabel9.SetSize( 29, 15 );
   textLabel9.SetEditable( false, false );
   textLabel9.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel9.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel9.SetColor( new Color( 189, 189, 189, 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", 14, true, false );

   textLabel10 = new VoltageLabel( "textLabel10", "textLabel10", this, "300" );
   AddComponent( textLabel10 );
   textLabel10.SetWantsMouseNotifications( false );
   textLabel10.SetPosition( 36, 136 );
   textLabel10.SetSize( 28, 15 );
   textLabel10.SetEditable( false, false );
   textLabel10.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel10.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel10.SetColor( new Color( 205, 202, 202, 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", 14, true, false );

   textLabel11 = new VoltageLabel( "textLabel11", "textLabel11", this, "180" );
   AddComponent( textLabel11 );
   textLabel11.SetWantsMouseNotifications( false );
   textLabel11.SetPosition( 99, 271 );
   textLabel11.SetSize( 28, 15 );
   textLabel11.SetEditable( false, false );
   textLabel11.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel11.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel11.SetColor( new Color( 31, 31, 31, 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", 14, true, false );

   textLabel12 = new VoltageLabel( "textLabel12", "textLabel12", this, "CV Out" );
   AddComponent( textLabel12 );
   textLabel12.SetWantsMouseNotifications( false );
   textLabel12.SetPosition( 135, 71 );
   textLabel12.SetSize( 37, 15 );
   textLabel12.SetEditable( false, false );
   textLabel12.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel12.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel12.SetColor( new Color( 237, 237, 237, 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", 10, false, false );

   textLabel13 = new VoltageLabel( "textLabel13", "textLabel13", this, "Aud In" );
   AddComponent( textLabel13 );
   textLabel13.SetWantsMouseNotifications( false );
   textLabel13.SetPosition( 49, 70 );
   textLabel13.SetSize( 37, 15 );
   textLabel13.SetEditable( false, false );
   textLabel13.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel13.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel13.SetColor( new Color( 237, 237, 237, 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", 10, false, false );

   outputMix = new VoltageAudioJack( "Mix Output", "Mix Output", this, JackType.JackType_AudioOutput );
   AddComponent( outputMix );
   outputMix.SetWantsMouseNotifications( false );
   outputMix.SetPosition( 180, 23 );
   outputMix.SetSize( 25, 25 );
   outputMix.SetSkin( "Jack Round 25px" );

   textLabel14 = new VoltageLabel( "textLabel14", "textLabel14", this, "Mix Out" );
   AddComponent( textLabel14 );
   textLabel14.SetWantsMouseNotifications( false );
   textLabel14.SetPosition( 171, 48 );
   textLabel14.SetSize( 41, 15 );
   textLabel14.SetEditable( false, false );
   textLabel14.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel14.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel14.SetColor( new Color( 255, 255, 255, 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", 10, false, false );

   outputCV90 = new VoltageAudioJack( "CV Out 90", "CV Out 90", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV90 );
   outputCV90.SetWantsMouseNotifications( false );
   outputCV90.SetPosition( 169, 196 );
   outputCV90.SetSize( 25, 25 );
   outputCV90.SetSkin( "Jack Round Sky Ring" );

   inputAudio90 = new VoltageAudioJack( "Audio In 90", "Audio In 90", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio90 );
   inputAudio90.SetWantsMouseNotifications( false );
   inputAudio90.SetPosition( 169, 167 );
   inputAudio90.SetSize( 25, 25 );
   inputAudio90.SetSkin( "Jack Round Cherry Ring" );

   outputCV270 = new VoltageAudioJack( "CV Out 270", "CV Out 270", this, JackType.JackType_AudioOutput );
   AddComponent( outputCV270 );
   outputCV270.SetWantsMouseNotifications( false );
   outputCV270.SetPosition( 31, 167 );
   outputCV270.SetSize( 25, 25 );
   outputCV270.SetSkin( "Jack Round Sky Ring" );

   inputAudio270 = new VoltageAudioJack( "Audio In 270", "Audio In 270", this, JackType.JackType_AudioInput );
   AddComponent( inputAudio270 );
   inputAudio270.SetWantsMouseNotifications( false );
   inputAudio270.SetPosition( 31, 196 );
   inputAudio270.SetSize( 25, 25 );
   inputAudio270.SetSkin( "Jack Round Cherry Ring" );

   LEDch90 = new VoltageLED( "LED 90", "LED 90", this );
   AddComponent( LEDch90 );
   LEDch90.SetWantsMouseNotifications( false );
   LEDch90.SetPosition( 205, 188 );
   LEDch90.SetSize( 11, 11 );
   LEDch90.SetSkin( "Red" );

   LEDch270 = new VoltageLED( "LED 270", "LED 270", this );
   AddComponent( LEDch270 );
   LEDch270.SetWantsMouseNotifications( false );
   LEDch270.SetPosition( 2, 188 );
   LEDch270.SetSize( 11, 11 );
   LEDch270.SetSkin( "Red" );

   textLabel15 = new VoltageLabel( "textLabel15", "textLabel15", this, "90" );
   AddComponent( textLabel15 );
   textLabel15.SetWantsMouseNotifications( false );
   textLabel15.SetPosition( 181, 183 );
   textLabel15.SetSize( 26, 20 );
   textLabel15.SetEditable( false, false );
   textLabel15.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel15.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel15.SetColor( new Color( 0, 0, 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, true, false );

   textLabel16 = new VoltageLabel( "textLabel16", "textLabel16", this, "270" );
   AddComponent( textLabel16 );
   textLabel16.SetWantsMouseNotifications( false );
   textLabel16.SetPosition( 11, 183 );
   textLabel16.SetSize( 27, 20 );
   textLabel16.SetEditable( false, false );
   textLabel16.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel16.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel16.SetColor( new Color( 190, 190, 190, 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, true, false );

   switchPolarity = new VoltageSwitch( "Polarity Switch", "Polarity Switch", this, 0 );
   AddComponent( switchPolarity );
   switchPolarity.SetWantsMouseNotifications( false );
   switchPolarity.SetPosition( 74, 23 );
   switchPolarity.SetSize( 16, 28 );
   switchPolarity.SetSkin( "2-State Slide Vertical" );

   inputReset = new VoltageAudioJack( "Reset Input", "Reset Input", this, JackType.JackType_AudioInput );
   AddComponent( inputReset );
   inputReset.SetWantsMouseNotifications( false );
   inputReset.SetPosition( 45, 315 );
   inputReset.SetSize( 25, 25 );
   inputReset.SetSkin( "Jack Round 25px" );

   switchOverlap = new VoltageSwitch( "Overlap Width", "Overlap Width", this, 0 );
   AddComponent( switchOverlap );
   switchOverlap.SetWantsMouseNotifications( false );
   switchOverlap.SetPosition( 89, 327 );
   switchOverlap.SetSize( 51, 15 );
   switchOverlap.SetSkin( "4-State Slide Horiz" );
}



//-------------------------------------------------------------------------------
//  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

   CheckConnections();

   ReadSlopeKnob(knobSlope.GetValue());

   ReadPolaritySwitch(switchPolarity.GetValue());
   
   ReadVolumeKnob(knobVolume.GetValue());
   
   ReadOverlapSwitch(switchOverlap.GetValue());
   
   previousReset = false;
   
   currentRate = knobRate.GetValue();
   previousRate = currentRate;
   ReadRateKnob (currentRate);
   
   SetAllOscillatorFreqs(currentRate);   
   ResetAllOscillators();
   
   StartGuiUpdateTimer();   

   //[/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
      {
         if (component == knobRate)
         {
            ReadRateKnob(doubleValue);
         }
         else if (component == knobSlope)
         {
            ReadSlopeKnob(doubleValue);
         }
         else if (component == knobVolume)
         {
            ReadVolumeKnob(doubleValue);
         }
      }
      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
      {
         if (component == switchPolarity)
         {
            ReadPolaritySwitch(doubleValue);
         }
         else if (component == switchOverlap)
         {
            ReadOverlapSwitch(doubleValue);
         } 
      }
      break;
   
      case Jack_Connected:   // longValue is the new cable ID
      {
         CheckConnections();
      }
      break;
   
      case Jack_Disconnected:   // All cables have been disconnected from this jack
      {
         CheckConnections();
      }
      break;
   
      case GUI_Update_Timer:   // Called every 50ms (by default) if turned on
      {
         LEDch0.SetValue(LEDBrightness (rawSine0));
         LEDch60.SetValue(LEDBrightness (rawSine60));
         LEDch90.SetValue(LEDBrightness (rawSine90));
         LEDch120.SetValue(LEDBrightness (rawSine120));
         LEDch180.SetValue(LEDBrightness (rawSine180));
         LEDch240.SetValue(LEDBrightness (rawSine240));
         LEDch270.SetValue(LEDBrightness (rawSine270));
         LEDch300.SetValue(LEDBrightness (rawSine300));
      }
      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 currentFrequency;
   boolean currentReset;
   double temp;
   double currentSlope;
   double currentVolume;
   double mixTotal;
   
   mixTotal = 0.0;
   
   currentSlope  = smoothSlope.GetSmoothValue() * polarityMulti * 0.1;
   currentVolume = smoothVolume.GetSmoothValue();
   currentRate   = smoothRate.GetSmoothValue();

   currentReset = (inputReset.GetValue() > 2.5);
   
   if (currentReset && !previousReset)
   {
      // Reset positive-going edge detected
      ResetAllOscillators();
   }
   
   previousReset = currentReset;
   
   // Read all amplitude oscillators to drive LEDs.
   // Add an offset of +5 V so value is unipolar 0V to 10V.
   rawSine0   = LFOphase0.GetTriangleValue() + 5.0;
   rawSine60  = LFOphase60.GetTriangleValue() + 5.0;
   rawSine90  = LFOphase90.GetTriangleValue() + 5.0;
   rawSine120 = LFOphase120.GetTriangleValue() + 5.0;
   rawSine180 = LFOphase180.GetTriangleValue() + 5.0;
   rawSine240 = LFOphase240.GetTriangleValue() + 5.0;
   rawSine270 = LFOphase270.GetTriangleValue() + 5.0;
   rawSine300 = LFOphase300.GetTriangleValue() + 5.0;
   
   if (audioIn0Connected)
   {
      mixTotal += inputAudio0.GetValue() * OverlapAttenuate (rawSine0)                                 ;
   }
   if (audioIn60Connected)
   {
      mixTotal += inputAudio60.GetValue() * OverlapAttenuate (rawSine60)                                 ;
   }
   if (audioIn90Connected)
   {
      mixTotal += inputAudio90.GetValue() * OverlapAttenuate (rawSine90)                                 ;
   }
   if (audioIn120Connected)
   {
      mixTotal += inputAudio120.GetValue() * OverlapAttenuate (rawSine120)                                 ;
   }
   if (audioIn180Connected)
   {
      mixTotal += inputAudio180.GetValue() * OverlapAttenuate (rawSine180)                                 ;
   }
   if (audioIn240Connected)
   {
      mixTotal += inputAudio240.GetValue() * OverlapAttenuate (rawSine240)                                 ;
   }
   if (audioIn270Connected)
   {
      mixTotal += inputAudio270.GetValue() * OverlapAttenuate (rawSine270)                                 ;
   }
   if (audioIn300Connected)
   {
      mixTotal += inputAudio300.GetValue() * OverlapAttenuate (rawSine300)                                 ;
   }
   
   mixTotal *= overlapMult * currentVolume;
   
   outputMix.SetValue(mixTotal);
   
   if (CVout0Connected)
   {
      temp = (LFOphase0.GetRampValue() + polarityOffset) * currentSlope;
      outputCV0.SetValue(temp);
   }
   if (CVout60Connected)
   {
      temp = (LFOphase60.GetRampValue() + polarityOffset) * currentSlope;
      outputCV60.SetValue(temp);
   }
   if (CVout90Connected)
   {
      temp = (LFOphase90.GetRampValue() + polarityOffset) * currentSlope;
      outputCV90.SetValue(temp);
   }
   if (CVout120Connected)
   {
      temp = (LFOphase120.GetRampValue() + polarityOffset) * currentSlope;
      outputCV120.SetValue(temp);
   }
   if (CVout180Connected)
   {
      temp = (LFOphase180.GetRampValue() + polarityOffset) * currentSlope;
      outputCV180.SetValue(temp);
   }
   if (CVout240Connected)
   {
      temp = (LFOphase240.GetRampValue() + polarityOffset) * currentSlope;;
      outputCV240.SetValue(temp);
   }
   if (CVout270Connected)
   {
      temp = (LFOphase270.GetRampValue() + polarityOffset) * currentSlope;
      outputCV270.SetValue(temp);
   }
   if (CVout300Connected)
   {
      temp = (LFOphase300.GetRampValue() + polarityOffset) * currentSlope;
      outputCV300.SetValue(temp);
   }
   
   if (currentRate != previousRate)
   {
      SetAllOscillatorFreqs(currentRate);
      previousRate = currentRate;
   }
   
   LFOphase0.AdvanceSample();
   LFOphase60.AdvanceSample();
   LFOphase90.AdvanceSample();
   LFOphase120.AdvanceSample();
   LFOphase180.AdvanceSample();
   LFOphase240.AdvanceSample();
   LFOphase270.AdvanceSample();
   LFOphase300.AdvanceSample();

   //[/user-ProcessSample]
}


//-------------------------------------------------------------------------------
//  public void ProcessBypassedSample()

//  ProcessBypassedSample gets called instead of ProcessSample when you've checked the "Can Be Bypassed" box
//  and a user has bypassed your module. If your module processes data from input jacks and then sends it to
//  output jack(s), make ProcessBypassedSample just send the data from the input jacks to the output jacks without
//  processing it.
//-------------------------------------------------------------------------------
@Override
public void ProcessBypassedSample()
{
   //[user-ProcessBypassedSample]   Add your own code here



   //[/user-ProcessBypassedSample]
}


//-------------------------------------------------------------------------------
//  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 VoltageSwitch switchOverlap;
private VoltageAudioJack inputReset;
private VoltageSwitch switchPolarity;
private VoltageLabel textLabel16;
private VoltageLabel textLabel15;
private VoltageLED LEDch270;
private VoltageLED LEDch90;
private VoltageAudioJack inputAudio270;
private VoltageAudioJack outputCV270;
private VoltageAudioJack inputAudio90;
private VoltageAudioJack outputCV90;
private VoltageLabel textLabel14;
private VoltageAudioJack outputMix;
private VoltageLabel textLabel13;
private VoltageLabel textLabel12;
private VoltageLabel textLabel11;
private VoltageLabel textLabel10;
private VoltageLabel textLabel9;
private VoltageLabel textLabel8;
private VoltageLabel textLabel7;
private VoltageLabel textLabel6;
private VoltageLabel textLabel21;
private VoltageLabel textLabel5;
private VoltageLabel textLabel18;
private VoltageLabel textLabel4;
private VoltageLabel textLabel23;
private VoltageLabel textLabel22;
private VoltageLabel textLabel20;
private VoltageLabel textLabel19;
private VoltageLabel textLabel17;
private VoltageLabel textLabel3;
private VoltageKnob knobVolume;
private VoltageKnob knobSlope;
private VoltageKnob knobRate;
private VoltageLabel textLabel2;
private VoltageLabel textLabel1;
private VoltageLED LEDch300;
private VoltageLED LEDch240;
private VoltageLED LEDch180;
private VoltageLED LEDch120;
private VoltageLED LEDch60;
private VoltageLED LEDch0;
private VoltageAudioJack inputAudio300;
private VoltageAudioJack outputCV300;
private VoltageAudioJack inputAudio240;
private VoltageAudioJack outputCV240;
private VoltageAudioJack inputAudio180;
private VoltageAudioJack outputCV180;
private VoltageAudioJack inputAudio120;
private VoltageAudioJack outputCV120;
private VoltageAudioJack inputAudio60;
private VoltageAudioJack outputCV60;
private VoltageAudioJack inputAudio0;
private VoltageAudioJack outputCV0;


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


// Constants

private final double BIPOLAR_OFFSET  = 0.0;
private final double BIPOLAR_MULT    = 1.0;
private final double UNIPOLAR_OFFSET = 5.0;
private final double UNIPOLAR_MULT   = 0.5;

private final double OVERLAP_ATTEN_2 = 0.01;
private final double OVERLAP_ATTEN_4 = 0.0001;
private final double OVERLAP_ATTEN_6 = 0.000001;
private final double OVERLAP_ATTEN_8 = 0.00000001;

// Variables

private boolean previousReset;      // Detect rising pulse on Reset input
private boolean unipolar;           // Ramp wave outputs unipolar

private double  polarityOffset;
private double  polarityMulti;

private double  currentRate;
private double  previousRate;

private int     overlapCount;
private double  overlapMult;

private boolean audioIn0Connected;
private boolean audioIn60Connected;
private boolean audioIn90Connected;
private boolean audioIn120Connected;
private boolean audioIn180Connected;
private boolean audioIn240Connected;
private boolean audioIn270Connected;
private boolean audioIn300Connected;

private boolean CVout0Connected;
private boolean CVout60Connected;
private boolean CVout90Connected;
private boolean CVout120Connected;
private boolean CVout180Connected;
private boolean CVout240Connected;
private boolean CVout270Connected;
private boolean CVout300Connected;

private double  rawSine0;
private double  rawSine60;
private double  rawSine90;
private double  rawSine120;
private double  rawSine180;
private double  rawSine240;
private double  rawSine270;
private double  rawSine300;

// Objects

protected DigitalOscillator LFOphase0 = new DigitalOscillator();
protected DigitalOscillator LFOphase60 = new DigitalOscillator();
protected DigitalOscillator LFOphase90 = new DigitalOscillator();
protected DigitalOscillator LFOphase120 = new DigitalOscillator();
protected DigitalOscillator LFOphase180 = new DigitalOscillator();
protected DigitalOscillator LFOphase240 = new DigitalOscillator();
protected DigitalOscillator LFOphase270 = new DigitalOscillator();
protected DigitalOscillator LFOphase300 = new DigitalOscillator();

private SmoothValue smoothSlope = new SmoothValue();
private SmoothValue smoothVolume = new SmoothValue();
private SmoothValue smoothRate = new SmoothValue();


private void CheckConnections ()
{
   audioIn0Connected = inputAudio0.IsConnected();
   audioIn60Connected = inputAudio60.IsConnected();
   audioIn90Connected = inputAudio90.IsConnected();
   audioIn120Connected = inputAudio120.IsConnected();
   audioIn180Connected = inputAudio180.IsConnected();
   audioIn240Connected = inputAudio240.IsConnected();
   audioIn270Connected = inputAudio270.IsConnected();
   audioIn300Connected = inputAudio300.IsConnected();

   CVout0Connected = outputCV0.IsConnected();
   CVout60Connected = outputCV60.IsConnected();
   CVout90Connected = outputCV90.IsConnected();
   CVout120Connected = outputCV120.IsConnected();
   CVout180Connected = outputCV180.IsConnected();
   CVout240Connected = outputCV240.IsConnected();
   CVout270Connected = outputCV270.IsConnected();
   CVout300Connected = outputCV300.IsConnected();
   
}

private void ResetAllOscillators ()
{
   LFOphase0.SetCycle (0.5);
   LFOphase60.SetCycle (0.333);
   LFOphase90.SetCycle (0.25);
   LFOphase120.SetCycle (0.167);
   LFOphase180.SetCycle (0.0);
   LFOphase240.SetCycle (0.833);
   LFOphase270.SetCycle (0.75);
   LFOphase300.SetCycle (0.667);
}

private void SetAllOscillatorFreqs (double freq)
{
   LFOphase0.SetFrequency (freq);
   LFOphase60.SetFrequency (freq);
   LFOphase90.SetFrequency (freq);
   LFOphase120.SetFrequency (freq);
   LFOphase180.SetFrequency (freq);
   LFOphase240.SetFrequency (freq);
   LFOphase270.SetFrequency (freq);
   LFOphase300.SetFrequency (freq);
}

private double LEDBrightness (double wave)
{
   if (wave < 5.0)
   {
      // Dark / Off
      return 0.0;
   }

   if (wave < 8.5)
   {
      // Medium
      return 0.5;
   }
   
   // Full intensity
   return 1.0;
   
}

private double Power2 (double value)
{
   return (value * value);    // Value ^ 2
}

private double Power4 (double value)
{
   double temp;
   
   temp = value * value;      // Value ^ 2
   
   return (temp * temp);      // Value ^ 4
}

private double Power6 (double value)
{
   double temp;
   
   temp = value * value * value; // Value ^ 3
   
   return (temp * temp);      // Value ^ 6
}

private double Power8 (double value)
{
   double temp;
   
   temp = value * value;      // Value ^ 2
   temp = temp * temp;        // Value ^ 4
   
   return (temp * temp);      // Value ^ 8
}

private double OverlapAttenuate (double value)
{
   switch (overlapCount)
   {
      case 2:
      {
         return Power2 (value);
      }
      
      case 4:
      {
         return Power4 (value);
      }
      
      case 6:
      {
         return Power6 (value);
      }
      
      default:
      {
         return Power8 (value);
      }
   }
}

private void ReadSlopeKnob (double slope)
{
   smoothSlope.SetValue(slope);
}

private void ReadPolaritySwitch (double polarity)
{
   unipolar = (polarity > 0.5);
   
   if (unipolar)
   {
      polarityOffset = UNIPOLAR_OFFSET;
      polarityMulti  = UNIPOLAR_MULT;
   }
   else
   {
      polarityOffset = BIPOLAR_OFFSET;
      polarityMulti  = BIPOLAR_MULT;
   }
}

private void ReadOverlapSwitch (double overlap)
{
   
   if (overlap > 2.5)
   {
      overlapCount = 2;
      overlapMult = OVERLAP_ATTEN_2;
   }
   else if (overlap > 1.5)
   {
      overlapCount = 4;
      overlapMult = OVERLAP_ATTEN_4;
   }
   else if (overlap > 0.5)
   {
      overlapCount = 6;
      overlapMult = OVERLAP_ATTEN_6;
   }
   else
   {
      overlapCount = 8;
      overlapMult = OVERLAP_ATTEN_8;
   }
}

private void ReadVolumeKnob (double volume)
{
   smoothVolume.SetValue(volume);
}

private void ReadRateKnob (double rate)
{
   smoothRate.SetValue(rate);
}


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

 