private static NoteEvent GenerateNoteOnEvent(Channel channel, ChannelEvent channelEvent,int tick) { int volume = channelEvent.HasVolume ? channelEvent.Volume : channel.DefaultVolume; channel.Instrument = channelEvent.HasInstrument ? channelEvent.Instrument : channel.Instrument; NoteEvent noteOnEvent = new NoteEvent(tick, NoteEvent.EventType.NoteOn, channelEvent.Instrument, channelEvent.Note, volume); channel.CurrentNote = noteOnEvent; return noteOnEvent; }
private static NoteEvent GenerateNoteOffEvent(Channel channel, int tick) { NoteEvent offEvent = channel.CurrentNote.Clone(tick); offEvent.Type = NoteEvent.EventType.NoteOff; channel.CurrentNote = null; return offEvent; }