def select
      return enum_for(__method__) unless block_given?

      Pattern.new(self) do |y, d|
        each_event do |v, s, ed, i|
          y << v if yield(v, s, ed, i)
        end
      end
    end
def select
      return enum_for(__method__) unless block_given?

      Pattern.new(self) do |y, d|
        each_event do |v, s, ed, i|
          y << v if yield(v, s, ed, i)
        end
      end
    end
Returns a Pattern containing all events of +self+ for which +block+ is
 true.

 If no block is given, an Enumerator is returned.

 @see Pattern#reject

 @yield [v, s, d, i] value, start, duration and iteration
 @yieldreturn [Boolean] whether value is selected
 @return [Pattern]