private MIDIMessageType BuildFilter() { // to filter out midi clock signals MIDIMessageType filter = MIDIMessageType.Unknown; filter |= MIDIMessageType.SystemRealtime; return(filter); }
/// <summary> /// Initializes a new MIDINoteMessage instance. /// </summary> /// <param name="type">The MIDI message type. Must be either NoteOn, NoteOff or NoteAftertouch.</param> /// <param name="channel">The channel associated with this message (0-15).</param> /// <param name="key">The key or note in question. Middle C (C-3) is 60, and each octave is separated by 12.</param> /// <param name="velocity">The velocity of the note (0-127), if NoteOn/NoteOff, or the pressure value (0-127) if NoteAftertouch.</param> public MIDINoteMessage(MIDIMessageType type, int channel, int key, int velocity) : base(type, channel) { if (type != MIDIMessageType.NoteOn && type != MIDIMessageType.NoteOff && type != MIDIMessageType.NoteAftertouch) { throw new ArgumentException("Invalid message type for MIDINoteMessage"); } if (channel < 0 || channel > 15) { throw new ArgumentException("MIDINoteMessage must be associated with a channel 0-15"); } Key = key; Velocity = velocity; }
private MIDIMessageType BuildFilter() { MIDIMessageType filter = MIDIMessageType.Unknown; if (!this.checkBoxChannel.Checked) { filter |= MIDIMessageType.Channel; } if (!this.checkBoxSystemCommon.Checked) { filter |= MIDIMessageType.SystemCommon; } if (!this.checkBoxSystemRealtime.Checked) { filter |= MIDIMessageType.SystemRealtime; } if (!this.checkBoxSystemExclusive.Checked) { filter |= MIDIMessageType.SystemExclusive; } return(filter); }
/// <summary> /// Initializes a new MIDIMessage instance. /// </summary> /// <param name="type">The MIDI message type.</param> /// <param name="channel">The channel associated with this message (0-15), or -1 if not applicable.</param> protected MIDIMessage(MIDIMessageType type, int channel) { Type = type; Channel = channel; }
/// <summary> /// Initializes a new MIDIMetaMessage instance. /// </summary> /// <param name="type">The MIDI message type. Should be one of the Meta types.</param> /// <param name="channel">The channel associated with this message (0-15), or -1 if not applicable.</param> /// <param name="data">The data associated with this meta event.</param> public MIDIMetaMessage(MIDIMessageType type, int channel, byte[] data) : base(type, channel) { Data = data; }