Public Sub TransposeTrack2(TTrack As MidiTrack,Semitones As Int, ExcludeChannels As List)
Dim Msg() As Byte
For i = 0 To TTrack.Size - 1
Dim E As MidiEvent = TTrack.Get(i)
If E.GetMessage.IsShortMessage Then
If e.Message.IsShortMessage And e.Message.ShortMessageCommand = MidiMessage_Static.STATUS_NOTE_ON Or _
e.Message.IsShortMessage And e.Message.ShortMessageCommand = MidiMessage_Static.STATUS_NOTE_OFF Then
Dim Chnl As Int = E.Message.ShortMessageChannel
Msg = E.GetMessage.GetMessage
Msg(1) = Bit.And(Msg(1),0xFF) + Semitones
e.Message.SetShortMessage_Message3(Msg(0),Msg(1),Msg(2))
End If
End If
Next
End Sub
Public Sub OffNotes
Dim t As Int
Dim Msg() As Byte = MidiMessage_Static.ALLNOTESOFF
For t = 0 To Seq.GetTracks.Length - 1
SendMessage(Array As Byte(Bit.Or(Msg(0),i),Msg(1),Msg(2)),-1)
Next
End Sub