waveTypeAsEnum=(WaveType)EditorGUILayout.EnumPopup(newGUIContent("Wave Type","Shape of the wave"),waveTypeAsEnum,waveTypeStyle);
parameters.waveType=(uint)waveTypeAsEnum;
GUILayout.Space(12);
//RenderPopup(waveTypeOptions, ((int)(parameters.waveType)), (value => parameters.waveType = ((uint)(value))), new GUIContent("Wave Type", "Shape of the wave"));
boolisSquareWaveType=(parameters.waveType==0);
RenderSlider(+0,+1,parameters.masterVolume,(value=>parameters.masterVolume=value),newGUIContent("Volume","Overall volume of the sound (0 to 1)"));
RenderHeading("Wave Envelope");
RenderSlider(+0,+1,parameters.attackTime,(value=>parameters.attackTime=value),newGUIContent("Attack Time","Length of the volume envelope attack (0 to 1)"));
RenderSlider(+0,+1,parameters.sustainTime,(value=>parameters.sustainTime=value),newGUIContent("Sustain Time","Length of the volume envelope sustain (0 to 1)"));
RenderSlider(+0,+1,parameters.sustainPunch,(value=>parameters.sustainPunch=value),newGUIContent("Sustain Punch","Tilts the sustain envelope for more 'pop' (0 to 1)"));
RenderSlider(+0,+1,parameters.decayTime,(value=>parameters.decayTime=value),newGUIContent("Decay Time","Length of the volume envelope decay (yes, I know it's called release) (0 to 1)"));
// BFXR
RenderSlider(+0,+1,parameters.compressionAmount,(value=>parameters.compressionAmount=value),newGUIContent("Compression","Pushes amplitudes together into a narrower range to make them stand out more. Very good for sound effects, where you want them to stick out against background music (0 to 1)"));
RenderHeading("Frequency");
RenderSlider(+0,+1,parameters.startFrequency,(value=>parameters.startFrequency=value),newGUIContent("Start Frequency","Base note of the sound (0 to 1)"));
RenderSlider(+0,+1,parameters.minFrequency,(value=>parameters.minFrequency=value),newGUIContent("Minimum Frequency","If sliding, the sound will stop at this frequency, to prevent really low notes (0 to 1)"));
RenderSlider(-1,+1,parameters.slide,(value=>parameters.slide=value),newGUIContent("Slide","Slides the note up or down (-1 to 1)"));
RenderSlider(-1,+1,parameters.deltaSlide,(value=>parameters.deltaSlide=value),newGUIContent("Delta Slide","Accelerates the slide (-1 to 1)"));
RenderSlider(+0,+1,parameters.vibratoDepth,(value=>parameters.vibratoDepth=value),newGUIContent("Vibrato Depth","Strength of the vibrato effect (0 to 1)"));
RenderSlider(+0,+1,parameters.vibratoSpeed,(value=>parameters.vibratoSpeed=value),newGUIContent("Vibrato Speed","Speed of the vibrato effect (i.e. frequency) (0 to 1)"));
// BFXR
RenderSlider(+0,+1,parameters.overtones,(value=>parameters.overtones=value),newGUIContent("Harmonics","Overlays copies of the waveform with copies and multiples of its frequency. Good for bulking out or otherwise enriching the texture of the sounds (warning: this is the number 1 cause of usfxr slowdown!) (0 to 1)"));
RenderSlider(+0,+1,parameters.overtoneFalloff,(value=>parameters.overtoneFalloff=value),newGUIContent("Harmonics falloff","The rate at which higher overtones should decay (0 to 1)"));
RenderHeading("Tone Change/Pitch Jump");
// BFXR
RenderSlider(+0,+1,parameters.changeRepeat,(value=>parameters.changeRepeat=value),newGUIContent("Change Repeat Speed","Larger Values means more pitch jumps, which can be useful for arpeggiation (0 to 1)"));
RenderSlider(-1,+1,parameters.changeAmount,(value=>parameters.changeAmount=value),newGUIContent("Change Amount 1","Shift in note, either up or down (-1 to 1)"));
RenderSlider(+0,+1,parameters.changeSpeed,(value=>parameters.changeSpeed=value),newGUIContent("Change Speed 1","How fast the note shift happens (only happens once) (0 to 1)"));
// BFXR
RenderSlider(-1,+1,parameters.changeAmount2,(value=>parameters.changeAmount2=value),newGUIContent("Change Amount 2","Shift in note, either up or down (-1 to 1)"));
RenderSlider(+0,+1,parameters.changeSpeed2,(value=>parameters.changeSpeed2=value),newGUIContent("Change Speed 2","How fast the note shift happens (only happens once) (0 to 1)"));
RenderHeading("Square Waves");
RenderSlider(+0,+1,parameters.squareDuty,(value=>parameters.squareDuty=value),newGUIContent("Square Duty","Controls the ratio between the up and down states of the square wave, changing the tibre (0 to 1)"),isSquareWaveType);
RenderSlider(-1,+1,parameters.dutySweep,(value=>parameters.dutySweep=value),newGUIContent("Duty Sweep","Sweeps the duty up or down (-1 to 1)"),isSquareWaveType);
RenderHeading("Repeats");
RenderSlider(+0,+1,parameters.repeatSpeed,(value=>parameters.repeatSpeed=value),newGUIContent("Repeat Speed","Speed of the note repeating - certain variables are reset each time (0 to 1)"));
RenderHeading("Phaser");
RenderSlider(-1,+1,parameters.phaserOffset,(value=>parameters.phaserOffset=value),newGUIContent("Phaser Offset","Offsets a second copy of the wave by a small phase, changing the tibre (-1 to 1)"));
RenderSlider(-1,+1,parameters.phaserSweep,(value=>parameters.phaserSweep=value),newGUIContent("Phaser Sweep","Sweeps the phase up or down (-1 to 1)"));
RenderHeading("Filters");
RenderSlider(+0,+1,parameters.lpFilterCutoff,(value=>parameters.lpFilterCutoff=value),newGUIContent("Low-Pass Cutoff","Frequency at which the low-pass filter starts attenuating higher frequencies (0 to 1)"));
RenderSlider(-1,+1,parameters.lpFilterCutoffSweep,(value=>parameters.lpFilterCutoffSweep=value),newGUIContent("Low-Pass Cutoff Sweep","Sweeps the low-pass cutoff up or down (-1 to 1)"));
RenderSlider(+0,+1,parameters.lpFilterResonance,(value=>parameters.lpFilterResonance=value),newGUIContent("Low-Pass Resonance","Changes the attenuation rate for the low-pass filter, changing the timbre (0 to 1)"));
RenderSlider(+0,+1,parameters.hpFilterCutoff,(value=>parameters.hpFilterCutoff=value),newGUIContent("High-Pass Cutoff","Frequency at which the high-pass filter starts attenuating lower frequencies (0 to 1)"));
RenderSlider(-1,+1,parameters.hpFilterCutoffSweep,(value=>parameters.hpFilterCutoffSweep=value),newGUIContent("High-Pass Cutoff Sweep","Sweeps the high-pass cutoff up or down (-1 to 1)"));
RenderHeading("Bit Crushing");
// BFXR
RenderSlider(+0,+1,parameters.bitCrush,(value=>parameters.bitCrush=value),newGUIContent("Bit Crush","Resamples the audio at a lower frequency (0 to 1)"));
RenderSlider(-1,+1,parameters.bitCrushSweep,(value=>parameters.bitCrushSweep=value),newGUIContent("Bit Crush Sweep","Sweeps the Bit Crush filter up or down (-1 to 1)"));