示例#1
0
        public ControlHost(double height, double width)
        {
            HostHeight = (int)height;
            HostWidth  = (int)width;
            synth      = new CLISynth();
            midi       = new Midi(synth);
            if (Midi.InputCount > 0)
            {
                midi.Open(0);
                midi.Start();
            }

            synth.SetMasterVolume(0.09);

            synth.SetAttackTime(0.05);
            synth.SetStartAmplitude(1.0);
            synth.SetDecayTime(0.7);
            synth.SetSusatainAmplitude(0.7);
            synth.SetReleaseTime(0.7);

            synth.SetWaveAmplitude(0.9, 1);
            synth.SetWaveAmplitude(0.8, 2);
            synth.SetWaveAmplitude(1.0, 3);

            synth.SetWaveType((uint)Wave.Saw, 0, 1);
            synth.SetWaveType((uint)Wave.Square, 0, 2);
            synth.SetWaveType((uint)Wave.Triange, 0, 3);

            synth.SetTune(-12, 1);
            synth.SetTune(0, 2);
            synth.SetTune(12, 3);

            synth.SetFineTune(0.0, 1);
            synth.SetFineTune(0.1, 2);
            synth.SetFineTune(-0.1, 3);

            synth.SetTremoloAmplitude(0.03, 1);
            synth.SetTremoloFrequency(5.0, 1);
            synth.SetTremoloAmplitude(0.03, 2);
            synth.SetTremoloFrequency(5.0, 2);
            synth.SetTremoloAmplitude(0.03, 3);
            synth.SetTremoloFrequency(5.0, 3);

            synth.SetVibratoAmplitude(0.003, 1);
            synth.SetVibratoFrequency(5.0, 1);
            synth.SetVibratoAmplitude(0.003, 2);
            synth.SetVibratoFrequency(5.0, 2);
            synth.SetVibratoAmplitude(0.003, 3);
            synth.SetVibratoFrequency(5.0, 3);
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Start");
            CLISynth synth = new CLISynth();

            synth.SetMasterVolume(0.1);
            synth.SetAttackTime(0.0);
            synth.SetDecayTime(0.0);
            synth.SetReleaseTime(1.0);
            synth.SetStartAmplitude(1.0);
            synth.SetSusatainAmplitude(1.0);

            synth.SetWaveAmplitude(0.3, 1);
            synth.SetWaveAmplitude(0.4, 2);
            synth.SetWaveAmplitude(0.5, 3);

            synth.SetWaveType(2, 0, 1);
            synth.SetWaveType(1, 0, 2);
            synth.SetWaveType(3, 0, 3);

            synth.SetTune(-12, 1);
            synth.SetTune(0, 2);
            synth.SetTune(12, 3);

            synth.SetFineTune(0.0, 1);
            synth.SetFineTune(-0.1, 2);
            synth.SetFineTune(0.1, 3);

            synth.SetTremoloAmplitude(0.003, 1);
            synth.SetTremoloFrequency(5.0, 1);
            synth.SetTremoloAmplitude(0.003, 2);
            synth.SetTremoloFrequency(5.0, 2);
            synth.SetTremoloAmplitude(0.003, 3);
            synth.SetTremoloFrequency(5.0, 3);

            synth.SetVibratoAmplitude(0.003, 1);
            synth.SetVibratoFrequency(5.0, 1);
            synth.SetVibratoAmplitude(0.003, 2);
            synth.SetVibratoFrequency(5.0, 2);
            synth.SetVibratoAmplitude(0.003, 3);
            synth.SetVibratoFrequency(5.0, 3);

            Console.ReadLine();

            synth.SetWaveType(2, 0, 1);
            synth.SetWaveType(2, 0, 2);
            synth.SetWaveType(2, 0, 3);

            Console.ReadLine();
        }
示例#3
0
 public Midi(CLISynth s)
 {
     synth      = s;
     midiInProc = new NativeMethods.MidiInProc(MidiProc);
     handle     = IntPtr.Zero;
 }