public void StopChord(MidiChord chord)
 {
     for (int i = 12; i < 128; i++)
     {
         MidiModule.StopNote(i);
     }
 }
        public void PlayChord(MidiChord chord)
        {
            List <int> notes = new List <int>();
            int        minInterval;
            int        maxInterval;

            for (int i = 0; i < chord.interval.Count; i++)
            {
                int thisNote = (int)chord.rootNote + chord.interval[i];

                for (int j = 0; j < 5; j++)
                {
                    minInterval = 36 + j * 12;
                    maxInterval = 47 + j * 12;

                    if (reeds.Contains(j))
                    {
                        if ((thisNote + (j + 1) * 12 <= maxInterval && thisNote + (j + 1) * 12 >= minInterval))
                        {
                            if (!(notes.Contains((int)chord.rootNote + chord.interval[i] + (j + 1) * 12)))
                            {
                                notes.Add((int)chord.rootNote + chord.interval[i] + (j + 1) * 12);
                            }
                        }
                        if (thisNote + j * 12 <= maxInterval && thisNote + j * 12 >= minInterval)
                        {
                            if (!(notes.Contains((int)chord.rootNote + chord.interval[i] + j * 12)))
                            {
                                notes.Add((int)chord.rootNote + chord.interval[i] + j * 12);
                            }
                        }
                        if (thisNote + (j - 1) * 12 <= maxInterval && thisNote + (j - 1) * 12 >= minInterval)
                        {
                            if (!(notes.Contains((int)chord.rootNote + chord.interval[i] + (j - 1) * 12)))
                            {
                                notes.Add((int)chord.rootNote + chord.interval[i] + (j - 1) * 12);
                            }
                        }
                    }
                }
            }

            if (!(reeds.Count == 0))
            {
                int min = reeds.Min();
                notes.Add((int)chord.rootNote + (min - 1) * 12);
            }

            for (int i = 0; i < notes.Count; i++)
            {
                MidiModule.PlayNote(notes[i], velocity);
            }
        }
 private void SetPressure()
 {
     MidiModule.SetPressure(pressure);
 }
 private void SetModulation()
 {
     MidiModule.SetModulation(Modulation);
 }
 public void CloseMIDI()
 {
     mm.InClose();
     mm.OutClose();
     mm = null;
 }
 public MIDIConnections(MidiModule mod)
 {
     InitializeComponent();
     mm = mod;
     OpenMIDI();
 }