/// <summary>
        /// Метод устанавливает инструмент для указанного канала
        /// </summary>
        /// <param name="Channel">Канал</param>
        /// <param name="Instrument">Инструмент</param>
        /// <returns>Возвращает true в случае успеха</returns>
        public bool SetInstrument(uint Channel, MIDIInstruments Instrument)
        {
            // Контроль
            if (!isInited || ((Channel & 0xFu) == beatsChannel))
            {
                return(false);
            }

            // Назначение
            midiOutShortMsg(midiHandle, AssembleCommand(MIDICommands.ИзменениеЗвуковойПрограммы, Channel) | ((uint)Instrument << 8));
            return(true);
        }
Exemple #2
0
 public static void setinstrument(MIDIInstruments instrument)
 {
     OpenMidi();
     MidiPlayer.Play(new ProgramChange(0, 1, (GeneralMidiInstruments)instrument));
 }