{"id":15675039,"url":"https://github.com/kaczmarj/psychopy-lsl","last_synced_at":"2025-07-19T00:36:45.375Z","repository":{"id":47629113,"uuid":"70703030","full_name":"kaczmarj/psychopy-lsl","owner":"kaczmarj","description":"Use LabStreamingLayer to handle triggers with PsychoPy.","archived":false,"fork":false,"pushed_at":"2021-08-20T18:41:20.000Z","size":217,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T23:46:18.658Z","etag":null,"topics":["eeg","labstreaminglayer","psychopy","python","research"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaczmarj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-12T13:33:32.000Z","updated_at":"2025-04-23T22:42:56.000Z","dependencies_parsed_at":"2022-09-06T15:10:34.737Z","dependency_job_id":null,"html_url":"https://github.com/kaczmarj/psychopy-lsl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kaczmarj/psychopy-lsl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fpsychopy-lsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fpsychopy-lsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fpsychopy-lsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fpsychopy-lsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaczmarj","download_url":"https://codeload.github.com/kaczmarj/psychopy-lsl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fpsychopy-lsl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265863793,"owners_count":23840888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eeg","labstreaminglayer","psychopy","python","research"],"created_at":"2024-10-03T15:55:13.024Z","updated_at":"2025-07-19T00:36:45.353Z","avatar_url":"https://github.com/kaczmarj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PsychoPy event markers with LabStreamingLayer\r\n\r\nThis repository demonstrates how to send event markers in PsychoPy with [LabStreamingLayer](https://github.com/sccn/labstreaminglayer) (LSL).\r\n\r\nSee [coregui.md](/coregui.md) to learn how to receive markers in Coregui with LSL.\r\n\r\nExample scripts\r\n---------------\r\n\r\n- [`example_coder.py`](/example_coder.py) is a minimal PsychoPy \"experiment\". Two words alternate on the screen, and a marker is sent whenever a word appears. This was coded manually.\r\n- [`example_builder.py`](/example_builder.py) behaves in the same way as `example_coder.py`, but it was created in the builder and uses stimuli and markers defined in `example_builder.csv`\r\n\r\n\r\nGeneral steps\r\n-------------\r\n\r\n1. Install `pylsl` (the Python interface of LSL).\r\n1. Include code in your Python script to send markers.\r\n\r\n\r\nInstall LabStreamingLayer\r\n-------------------------\r\n\r\nSee the [PyPI page](https://pypi.python.org/pypi/pylsl).\r\n\r\n```\r\npip install pylsl\r\n```\r\n\r\n\r\nIn your PsychoPy code\r\n---------------------\r\n\r\nRefer to [pylsl.py](https://github.com/labstreaminglayer/liblsl-Python/blob/master/pylsl/pylsl.py) for documentation on `pylsl` functions.\r\n\r\n```python\r\n# ...\r\nfrom pylsl import StreamInfo, StreamOutlet\r\ninfo = StreamInfo(name='my_stream_name', type='Markers', channel_count=1,\r\n                  channel_format='int32', source_id='uniqueid12345')\r\n# Initialize the stream.\r\noutlet = StreamOutlet(info)\r\n# ...\r\n```\r\n- Include markers wherever you need them.\r\n```python\r\n# ...\r\noutlet.push_sample(x=[100])\r\n# ...\r\n```\r\n- The example above sends a marker 100. `x` must be a list with a length equal to `channel_count` (specified in `StreamInfo`). It is easiest to use integers as markers.\r\n- You can also include dynamic marker names (see [example script](/example_builder.py)). If you are using a trial loop in PsychoPy, include marker values in a column in the spreadsheet used for the loop. If the column header is \"marker\", the code would be `outlet.push_sample(x=[marker])`.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaczmarj%2Fpsychopy-lsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaczmarj%2Fpsychopy-lsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaczmarj%2Fpsychopy-lsl/lists"}