-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseVoice.cs
More file actions
32 lines (29 loc) · 915 Bytes
/
Copy pathBaseVoice.cs
File metadata and controls
32 lines (29 loc) · 915 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
using NAudio.Midi;
namespace PianoEnhancer
{
internal struct BaseVoice
{
public string DisplayName { get; set; }
public byte BankMsb { get; set; }
public byte BankLsb { get; set; }
public byte ProgramChangeNumber { get; set; }
public BaseVoice(string dp, byte msb, byte lsb, byte pc)
{
DisplayName = dp;
BankMsb = msb;
BankLsb = lsb;
ProgramChangeNumber = pc;
}
public MidiEvent[] GetEventsForChannel(int channel)
{
channel += 1;
return new MidiEvent[]
{
new ControlChangeEvent(0,channel,MidiController.BankSelect,BankMsb),
new ControlChangeEvent(0,channel,MidiController.BankSelectLsb,BankLsb),
new PatchChangeEvent(0,channel,ProgramChangeNumber),
}
;
}
}
}