Beispiel #1
0
        /// <summary>
        /// Gets an instance of the <see cref="NoteOffEvent"/> corresponding to the specified
        /// General Sound 'CM-64/CM-32L' percussion.
        /// </summary>
        /// <param name="percussion"><see cref="GeneralSoundCm6432LPercussion"/> to get an event for.</param>
        /// <param name="velocity">Velocity of the <see cref="NoteOffEvent"/>.</param>
        /// <param name="channel">Channel an event should be created for.</param>
        /// <returns>An instance of the <see cref="NoteOffEvent"/> corresponding to the specified
        /// <paramref name="percussion"/>.</returns>
        /// <exception cref="InvalidEnumArgumentException"><paramref name="percussion"/> specified an invalid value.</exception>
        public static NoteOffEvent GetNoteOffEvent(this GeneralSoundCm6432LPercussion percussion, SevenBitNumber velocity, FourBitNumber channel)
        {
            ThrowIfArgument.IsInvalidEnumValue(nameof(percussion), percussion);

            return(new NoteOffEvent(percussion.AsSevenBitNumber(), velocity)
            {
                Channel = channel
            });
        }