public Synthesizer CreateSynthesizer(int deviceId, int bufferSize, int sampleRate) { synth = new Synthesizer( "Lite Wave", deviceId, bufferSize, sampleRate, new VoiceFactory(delegate(SampleRate sr, StereoBuffer buffer, string name) { return new SynthVoice(sr, buffer, name); }), 8, delegate(SampleRate sr, StereoBuffer inputBuffer) { List<EffectComponent> myEffects = new List<EffectComponent>(); myEffects.Add(new Sanford.Multimedia.Synth.Chorus(sr, inputBuffer)); myEffects.Add(new Sanford.Multimedia.Synth.Echo(sr, inputBuffer)); return myEffects; }); if (File.Exists("LiteWaveDefaultBank.bnk")) { try { // Load default bank into Lite Wave synthesizer. synth.LoadBank("LiteWaveDefaultBank.bnk"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Stop); } } else { MessageBox.Show("No Soundbank Found", "Error", MessageBoxButton.OK, MessageBoxImage.Stop); } synth.SetParameterValue(11, (float)1.0); //Set to organ synth.SetSelectedProgramIndex(2); return synth; }