CSharpSynth.Sequencer.MidiSequencer.Play C# (CSharp) Method

Play() public method

public Play ( ) : void
return void
        public void Play()
        {
            if (playing == true)
                return;
            //Clear the current programs for the channels.
            Array.Clear(currentPrograms, 0, currentPrograms.Length);
            //Clear vol, pan, and tune
            ResetControllers();
            //set bpm
            _MidiFile.BeatsPerMinute = 120;
            //Let the synth know that the sequencer is ready.
            playing = true;
        }

Usage Example

Beispiel #1
0
        public Sound(string bank,string midifile)
        {
            midiStreamSynthesizer = new StreamSynthesizer(StreamSynthesizer.SampleRateType.High);
            sampleBuffer = new float[midiStreamSynthesizer.BufferSize];
            midiStreamSynthesizer.LoadBank(bank);

            midiSequencer = new MidiSequencer(midiStreamSynthesizer);
            midiSequencer.LoadMidi(midifile, false);
            midiSequencer.Play();
        }
All Usage Examples Of CSharpSynth.Sequencer.MidiSequencer::Play