Exemplo n.º 1
0
        //private bool ToBeRecorded(int chan) {
        //  if (MidiDevName != MidiPlay.MidiOutKB.MidiDevName) return false;
        //  if (MidiDevName != MidiPlay.MidiOutStream.MidiDevName) return true;
        //  if (chan == P.F.FileStreamMM.Re
        //}

        //public void SendShortMsgAndRecord(int status, int msg, int data) {
        //  if (MidiPlay.MidiInKB != null && MidiPlay.MidiInKB.Ticks.HasValue) {
        //    SendShortMsg(status, msg, data);
        //    if (P.F != null && P.F.FSTrackMap != null) {
        //      P.F.FSTrackMap.RecordEv(MidiPlay.MidiInKB.Ticks.Value, (byte)status, (byte)msg, (byte)data);
        //      //Debug.WriteLine("{0,-10} {1:X2} {2:X2} {3:X2}", "RecordEv: ", status, msg, data);
        //    }
        //  }
        //}

        public void SendShortMsg(int status, int msg, int data)
        {
            //* not from QIPlay
            //* send midiout without channel change (2 or 3 bytes)
            if (Handle == IntPtr.Zero)
            {
                return;
            }
            MidiMon.MidiOutShortMsg(status, msg, data);
            int xword = (((data << 8) | msg) << 8) | status;

            midiOutShortMsg(Handle, xword);
            if (P.F.FSTrackMap != null && MidiPlay.Sync.indPlayActive == clsSync.ePlay.MidiStream)
            {
                int  chan  = status & 0x0f;
                long?ticks = clsPlay.GetTicks();
                if (ticks.HasValue && chan == P.F.FSTrackMap.RecChan)
                {
                    P.F.FSTrackMap.RecordEvNM(ticks.Value, (byte)status, (byte)msg, (byte)data);
                }
            }
#if DebugMidiOut
            Trace(zmsg, zpitch, zvel);
#endif
        }
Exemplo n.º 2
0
 public void AllNotesOff()
 {
     MidiMon.Reset();
     for (int ch = 0; ch <= 15; ch++)
     {
         SendShortMsg(0xb0 | ch, 123, 0); //allnotesoff
         SendShortMsg(0xb0 | ch, 64, 0);  //sustain off
     }
 }
Exemplo n.º 3
0
 public void AllNotesOff()
 {
     MidiMon.Reset();
     for (int ch = 0; ch < 16; ch++)
     {
         //for (int n = 0; n < 128; n++) {
         //  BassMidi.BASS_MIDI_StreamEvent(MidiStream, ch, BASSMIDIEvent.MIDI_EVENT_NOTE, n);
         //}
         BassMidi.StreamEvent(MidiStream, ch, MidiEventType.NotesOff, 0);
         BassMidi.StreamEvent(MidiStream, ch, MidiEventType.Sustain, 0);
     }
 }
Exemplo n.º 4
0
 public void SendEvents(byte[] b)
 {
     BassMidi.StreamEvents(MidiStream,
                           MidiEventsMode.Raw | MidiEventsMode.NoRunningStatus,
                           0, b);
     if (OutType == eOutType.KB)
     {
         int status = b[0] & 0xf0;
         if (status == 0x80 || status == 0x90)
         {
             MidiMon.MidiOutShortMsg(b[0], b[1], b[2]);
         }
     }
 }