Beispiel #1
0
 public static IEnumerable <MidiEvent> GetEvents(this MidiFile midiFile)
 {
     return(midiFile.GetTrackChunks().SelectMany(c => c.Events));
 }
Beispiel #2
0
        /// <summary>
        /// Gets all channel numbers presented in the specified <see cref="MidiFile"/>.
        /// </summary>
        /// <param name="midiFile"><see cref="MidiFile"/> to get channels of.</param>
        /// <returns>Collection of channel numbers presented in the <paramref name="midiFile"/>.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="midiFile"/> is null.</exception>
        public static IEnumerable <FourBitNumber> GetChannels(this MidiFile midiFile)
        {
            ThrowIfArgument.IsNull(nameof(midiFile), midiFile);

            return(midiFile.GetTrackChunks().GetChannels());
        }