New: FILTER-EVENTS
The function FILTER-EVENTS internally brakes-up an omn sequence into single-events (l p v a) and checks whether an event contains the given element. When an element is found the event is returned. All other events are transformed into rests. The option remain will invert the process.
(filter-events 'd4 '(e c4 mp -e fermata e. d4 -h e. c4 e e4))
=> (-q e. d4 mp -h.s)
(filter-events 'd4 '(e c4 mp -e fermata e. d4 -h e. c4 e e4) :remain t)
=> (e c4 mp -e fe