SilenceAllNotes() public méthode

Silences all notes on this output device.
The device is not open. The message cannot be sent.
public SilenceAllNotes ( ) : void
Résultat void
Exemple #1
0
        public void Connect()
        {
            if (_inputDevice == null)
            {
                _inputDevice = (from device in InputDevice.InstalledDevices
                                where device.Name == _deviceName
                                select device).FirstOrDefault();
                if (_inputDevice != null)
                {
                    _inputDevice.Open();

                    _inputDevice.NoteOn += OnInputDeviceNoteOn;
                    _inputDevice.NoteOff += OnInputDeviceNoteOff;
                    _inputDevice.ControlChange += OnInputDeviewControlChange;

                    _inputDevice.StartReceiving(null);
                }
            }

            if (_outputDevice == null)
            {
                _outputDevice = (from device in OutputDevice.InstalledDevices
                                 where device.Name == _deviceName
                                 select device).FirstOrDefault();
                if (_outputDevice != null)
                {
                    _outputDevice.Open();
                    _outputDevice.SilenceAllNotes();
                }
            }
        }
Exemple #2
0
 public MidiDevice()
 {
     timeOuts     = new List <NoteTimeOut>();
     outputDevice = Midi.OutputDevice.InstalledDevices[0];
     outputDevice.Open();
     outputDevice.SilenceAllNotes();
     System.Threading.Thread.Sleep(200); // fixes delay during initial playing, possibly due to midi device initialization
 }
Exemple #3
0
 public MidiDevice()
 {
     timeOuts = new List<NoteTimeOut>();
     outputDevice = Midi.OutputDevice.InstalledDevices[0];
     outputDevice.Open();
     outputDevice.SilenceAllNotes();
     System.Threading.Thread.Sleep(200); // fixes delay during initial playing, possibly due to midi device initialization
 }
Exemple #4
0
        public void NoteOn(NoteOnMessage msg, OutputDevice output)
        {
            output.SilenceAllNotes();

            if (!currentNote.Equals(Pitch.A0))
            {
                total++;
                if (msg.Pitch.PositionInOctave().Equals(currentNote.PositionInOctave()))
                {
                    score++;
                    currentNote = availableNotes[random.Next(availableNotes.Count)];
                    clock.Schedule(new NoteOnOffMessage(output,msg.Channel,Pitch.G5,127,clock.Time,clock,1));
                    clock.Schedule(new NoteOnOffMessage(output,msg.Channel,Pitch.C6,127,clock.Time+1,clock,1));
                }
            }
            else
            {
                currentNote = availableNotes[random.Next(availableNotes.Count)];
            }
        }
Exemple #5
0
 public void StopNotes()
 {
     timeOuts = new List <NoteTimeOut>();
     outputDevice.SilenceAllNotes();
 }