# "manually" add events from timestamps and trigger names arrays

**URL:** <https://mne.discourse.group/t/manually-add-events-from-timestamps-and-trigger-names-arrays/4357>\
**Category:** Support & Discussions\
**Tags:** epochs\
**Created:** [February 3, 2022, 1:39pm UTC](https://mne.discourse.group/t/manually-add-events-from-timestamps-and-trigger-names-arrays/4357 "2022-02-03T13:39:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Merle](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Merle](https://mne.discourse.group/u/Merle)\
**Post date:** [February 3, 2022, 1:39pm UTC](https://mne.discourse.group/t/manually-add-events-from-timestamps-and-trigger-names-arrays/4357/1 "2022-02-03T13:39:38Z")

</div>

Hi everyone,

I’m currently building an epochs object from scratch. I created an info object and nested arrays containing my data, so that should work I guess, but now I’d like to add triggers, too. My trigger names are in one array, my trigger timestamps are in another one. Does anyone know how I can create events using the two arrays?

Thanks in advance for your help!

Merle

---

<div class="post-metadata">

**Author:** ![sappelhoff](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/sappelhoff/32/3276_2.png) [@sappelhoff](https://mne.discourse.group/u/sappelhoff)\
**Post date:** [February 4, 2022, 9:00am UTC](https://mne.discourse.group/t/manually-add-events-from-timestamps-and-trigger-names-arrays/4357/2 "2022-02-04T09:00:37Z")

</div>

Hi Merle,

you can use your two arrays for the `onset` and `description` entries of a new [Annotation object](https://mne.tools/stable/generated/mne.Annotations.html?highlight=annotatios#mne-annotations). You would keep the duration at `0`, if you want to “simulate” TTL triggers.

See this example: [Annotating continuous data — MNE 0.24.1 documentation](https://mne.tools/stable/auto_tutorials/raw/30_annotate_raw.html#creating-annotations-programmatically)

Then, once you have your annotations object, you can get the events through this function: [mne.events\_from\_annotations — MNE 0.24.1 documentation](https://mne.tools/stable/generated/mne.events_from_annotations.html?highlight=events_from_annotation)
