-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVstMidiEvent.cs
More file actions
32 lines (30 loc) · 948 Bytes
/
VstMidiEvent.cs
File metadata and controls
32 lines (30 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace VST.NET
{
public struct VstMidiEvent
{
public int SampleIndex;
public VstMidiEventFlags Flags;
public int NoteLength;
public int NoteOffset;
public byte MidiCommand;
public byte MidiData0;
public byte MidiData1;
public byte Detune;
public byte NoteOffVelocity;
public VstEvent ToEvent()
{
return (new VstEvent()
{
Type = VstEventType.Midi,
ByteSize = 32,
SampleIndex = this.SampleIndex,
Flags = (int)this.Flags,
Data_0_3 = NoteLength,
Data_4_7 = NoteOffset,
Data_8_11 = (int)MidiCommand | ((int)MidiData0 << 8) | ((int)MidiData1 << 16),
Data_12_15 = (int)Detune | ((int)NoteOffVelocity << 8)
});
}
public static implicit operator VstEvent(VstMidiEvent midi) { return (midi.ToEvent()); }
}
}