diff --git a/S3mToMidi/MidiWriter2.cs b/S3mToMidi/MidiWriter2.cs index bc34a9f..c217219 100644 --- a/S3mToMidi/MidiWriter2.cs +++ b/S3mToMidi/MidiWriter2.cs @@ -60,7 +60,7 @@ public static void Save(Dictionary> allEvents, string path, Mid //Console.Out.WriteLine("Channel {0} NoteOff Pitch {1}", note.Channel, note.Pitch); yield return new NoteOffEvent((SevenBitNumber)ChannelNoteToMidiPitch(note.Pitch), (SevenBitNumber)ChannelVelocityToMidiVolume(note.Velocity)) { - Channel = (FourBitNumber)note.Channel, + Channel = (FourBitNumber)(note.Channel - 1), DeltaTime = GetDeltaTimeForChannelTick(note.Channel, note.Tick, channelLastTicks) }; } @@ -70,7 +70,7 @@ public static void Save(Dictionary> allEvents, string path, Mid { initializedChannels.Add(note.Channel); yield return new ProgramChangeEvent(){ - Channel = (FourBitNumber)note.Channel, + Channel = (FourBitNumber)(note.Channel - 1), ProgramNumber = (SevenBitNumber)0, DeltaTime = GetDeltaTimeForChannelTick(note.Channel, note.Tick, channelLastTicks) }; @@ -78,7 +78,7 @@ public static void Save(Dictionary> allEvents, string path, Mid //Console.Out.WriteLine("Channel {0} NoteOn Pitch {1}", note.Channel, note.Pitch); yield return new NoteOnEvent((SevenBitNumber)ChannelNoteToMidiPitch(note.Pitch), (SevenBitNumber)ChannelVelocityToMidiVolume(note.Velocity)) { - Channel = (FourBitNumber)note.Channel, + Channel = (FourBitNumber)(note.Channel - 1), DeltaTime = GetDeltaTimeForChannelTick(note.Channel, note.Tick, channelLastTicks) }; }