Exemplo n.º 1
0
 private void SetChordOff(int channel, List <byte> midiPitches)
 {
     for (int i = 0; i < midiPitches.Count; i++)
     {
         NoteOff noteOff = new NoteOff(channel, midiPitches[i], 64);
         ChordOff.AddNote(noteOff);
     }
 }
Exemplo n.º 2
0
        public override ChordOff CloneChordOff()
        {
            ChordOff chordOff = new ChordOff(this.BasicMidiChord);

            foreach (NoteOff noteOff in this.Notes)
            {
                chordOff.AddNote(noteOff.CloneNoteOff());
            }

            return(chordOff);
        }
Exemplo n.º 3
0
        public BasicMidiChord(int channel, MidiChord midiChord, BasicMidiChordDef bmcd, int realMsDuration)
        {
            MidiChord = midiChord;
            //MsPosition = bmcd.MsPosition;
            MsDuration = realMsDuration;

            if(bmcd.BankIndex != null)
            {
                BankControl = new BankControl(channel, (byte)bmcd.BankIndex);
            }
            if(bmcd.PatchIndex != null)
            {
                PatchControl = new PatchControl(channel, (byte)bmcd.PatchIndex);
            }

            ChordOn = new ChordOn(this);
            SetChordOn(channel, bmcd.Pitches, bmcd.Velocities);
            if(bmcd.HasChordOff)
            {
                ChordOff = new ChordOff(this);
                SetChordOff(channel, bmcd.Pitches);
            }
        }
Exemplo n.º 4
0
        public BasicMidiChord(int channel, MidiChord midiChord, BasicMidiChordDef bmcd, int realMsDuration)
        {
            MidiChord = midiChord;
            //MsPosition = bmcd.MsPosition;
            MsDuration = realMsDuration;

            if (bmcd.BankIndex != null)
            {
                BankControl = new BankControl(channel, (byte)bmcd.BankIndex);
            }
            if (bmcd.PatchIndex != null)
            {
                PatchControl = new PatchControl(channel, (byte)bmcd.PatchIndex);
            }

            ChordOn = new ChordOn(this);
            SetChordOn(channel, bmcd.Pitches, bmcd.Velocities);
            if (bmcd.HasChordOff)
            {
                ChordOff = new ChordOff(this);
                SetChordOff(channel, bmcd.Pitches);
            }
        }
Exemplo n.º 5
0
        public override ChordOff CloneChordOff()
        {
            ChordOff chordOff = new ChordOff(this.BasicMidiChord);

            foreach(NoteOn noteOn in this.Notes)
                chordOff.AddNote(noteOn.CloneNoteOff());

            return chordOff;
        }
Exemplo n.º 6
0
 public void AddNote(int channel, int pitch, int velocity)
 {
     ChordOn.AddNote(new NoteOn(channel, pitch, velocity));
     ChordOff.AddNote(new NoteOff(channel, pitch, 64));
 }