# Set up event duration based on next event start

**URL:** <https://mne.discourse.group/t/set-up-event-duration-based-on-next-event-start/7153>\
**Category:** Support & Discussions\
**Tags:** fnirs, event-codes\
**Created:** [June 28, 2023, 1:45pm UTC](https://mne.discourse.group/t/set-up-event-duration-based-on-next-event-start/7153 "2023-06-28T13:45:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YaeletK](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/yaeletk/32/2802_2.png) [@YaeletK](https://mne.discourse.group/u/YaeletK)\
**Post date:** [June 28, 2023, 1:45pm UTC](https://mne.discourse.group/t/set-up-event-duration-based-on-next-event-start/7153/1 "2023-06-28T13:45:12Z")

</div>

Hello  
I have a block design NIRx recording, with manual annotations, where the annotations marks the beginning and end of a condition, but they are not continious (e.g the just mark the start and end, so I believe that in my design matrix in-between annotations in mark as 0 - no event). durations of events is not constant, so I do not want to use the set duration function, in addition, using it makes me throw away much of my control data (all the in-between)  
Comparing to the tapping scenario, it will be marks for start left tap, stop left tap, start right tap, stop right tap. I want Left condition to be any times between the start and stop for left, same for right condition and right tapping, and have the rest of the time as Control.  
I am unable to figure out how to set the duration of the event based on the annotations. Does this functionallity exists?

Thank you
