public SynthParameters(Synthesizer synth) { Synth = synth; Pan = new CCValue(0); Volume = new CCValue(0); Expression = new CCValue(0); ModRange = new CCValue(0); PitchBend = new CCValue(0); MasterFineTune = new CCValue(0); Rpn = new CCValue(0); CurrentPan = new PanComponent(); ResetControllers(); }
public void Load(Sf2Region region, AssetManager assets) { ExclusiveGroup = region.Generators[(int)GeneratorEnum.ExclusiveClass]; ExclusiveGroupTarget = ExclusiveGroup; iniFilterFc = region.Generators[(int)GeneratorEnum.InitialFilterCutoffFrequency]; filterQ = SynthHelper.DBtoLinear(region.Generators[(int)GeneratorEnum.InitialFilterQ] / 10.0); initialAttn = -region.Generators[(int)GeneratorEnum.InitialAttenuation] / 10f; keyOverride = region.Generators[(int)GeneratorEnum.KeyNumber]; velOverride = region.Generators[(int)GeneratorEnum.Velocity]; keynumToModEnvHold = region.Generators[(int)GeneratorEnum.KeyNumberToModulationEnvelopeHold]; keynumToModEnvDecay = region.Generators[(int)GeneratorEnum.KeyNumberToModulationEnvelopeDecay]; keynumToVolEnvHold = region.Generators[(int)GeneratorEnum.KeyNumberToVolumeEnvelopeHold]; keynumToVolEnvDecay = region.Generators[(int)GeneratorEnum.KeyNumberToVolumeEnvelopeDecay]; pan = new PanComponent(); pan.SetValue(region.Generators[(int)GeneratorEnum.Pan] / 500f, PanFormulaEnum.Neg3dBCenter); modLfoToPitch = region.Generators[(int)GeneratorEnum.ModulationLFOToPitch]; vibLfoToPitch = region.Generators[(int)GeneratorEnum.VibratoLFOToPitch]; modEnvToPitch = region.Generators[(int)GeneratorEnum.ModulationEnvelopeToPitch]; modLfoToFilterFc = region.Generators[(int)GeneratorEnum.ModulationLFOToFilterCutoffFrequency]; modEnvToFilterFc = region.Generators[(int)GeneratorEnum.ModulationEnvelopeToFilterCutoffFrequency]; modLfoToVolume = region.Generators[(int)GeneratorEnum.ModulationLFOToVolume] / 10f; LoadGen(region, assets); LoadEnvelopes(region); LoadLfos(region); LoadFilter(region); }