def each_event(cycle=0)
      return enum_for(__method__, cycle) unless block_given?
      EventEnumerator.new(self, cycle).each { |v, s, d, i| yield v, s, d, i }
    end
def each_event(cycle=0)
      return enum_for(__method__, cycle) unless block_given?
      EventEnumerator.new(self, cycle).each { |v, s, d, i| yield v, s, d, i }
    end
Calls the given block once for each event, passing its value, start
 position, duration and iteration as parameters.

 +cycle+ can be any number, even if there is no event that starts exactly
 at that moment.  It will start from the next event.

 If no block is given, an enumerator is returned instead.

 Enumeration loops forever, and starts yielding events based on pattern's
 delta and from the +cycle+ position, which is by default 0.

 @example block yields value, start, duration and iteration
   Pattern.new([1, 2], delta: 0.25).each_event.take(4)
   # => [[1, 0.0,  0.25, 0],
   #     [2, 0.25, 0.25, 0],
   #     [1, 0.5,  0.25, 1],
   #     [2, 0.75, 0.25, 1]]

 @example +cycle+ is used to start iterating from that moment in time
   Pattern.new([:a, :b, :c], delta: 1/2).each_event(42).take(4)
   # => [[:a, (42/1), (1/2), 28],
   #     [:b, (85/2), (1/2), 28],
   #     [:c, (43/1), (1/2), 28],
   #     [:a, (87/2), (1/2), 29]]

 @example +cycle+ can also be a fractional number
   Pattern.new([:a, :b, :c]).each_event(0.97).take(3)
   # => [[:b, 1, 1, 0],
   #     [:c, 2, 1, 0],
   #     [:a, 3, 1, 1]]

 @param cycle [Numeric]
 @yield [v, s, d, i] value, start, duration and iteration
 @return [Enumerator]