{ "info": { "author": "Alexandre Barachant", "author_email": "alexandre.barachant@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Software Development" ], "description": "# Muse LSL\n\nA Python package for streaming, visualizing, and recording EEG data from the Muse 2016 headband.\n\n![Blinks](blinks.png)\n\n## Requirements\n\nThe code relies on [pygatt](https://github.com/peplin/pygatt) or [BlueMuse](https://github.com/kowalej/BlueMuse/tree/master/Dist) for BLE communication and works differently on different operating systems.\n\n- Windows: On Windows 10, we recommend installing [BlueMuse](https://github.com/kowalej/BlueMuse/tree/master/Dist) and using its GUI to discover and connect to Muse devices. Alternatively, if you have a BLED112 dongle you can try Muse LSL's bgapi backend (`muselsl stream --backend bgapi`).\n- Mac: On Mac, a **BLED112 dongle is required**. The bgapi backend is required and will be used by default when running Muse LSL from the command line\n- Linux: No dongle required. However, you may need to run a command to enable root-level access to bluetooth hardware (see [Common Issues](#linux)). The pygatt backend is required and will be used by default from the command line. and make sure to read the \n\n**Compatible with Python 2.7 and Python 3.x**\n\n**Only compatible with Muse 2 and Muse 2016**\n\n_Note: if you run into any issues, first check out out [Common Issues](#common-issues) and then the [Issues](https://github.com/alexandrebarachant/muse-lsl/issues) section of this repository_\n\n## Getting Started\n\n### Installation\n\nInstall Muse LSL with pip\n\n pip install muselsl\n\n### Setting Up a Stream\n\nOn Windows 10, we recommend using the [BlueMuse](https://github.com/kowalej/BlueMuse/tree/master/Dist) GUI to set up an LSL stream. On Mac and Linux, the easiest way to get Muse data is to use Muse LSL directly from the command line. Use the `-h` flag to get a comprehensive list of all commands and options.\n\nTo print a list of available muses:\n\n $ muselsl list\n\nTo begin an LSL stream from the first available Muse:\n\n $ muselsl stream \n\nTo connect to a specific Muse you can pass the name of the device as an argument. Device names can be found on the inside of the left earpiece (e.g. Muse-41D2):\n\n $ muselsl stream --name YOUR_DEVICE_NAME\n\nYou can also directly pass the MAC address of your Muse. This provides the benefit of bypassing the device discovery step and can make connecting to devices quicker and more reliable:\n\n $ muselsl stream --address YOUR_DEVICE_ADDRESS\n\n### Working with Streaming Data\n\nOnce an LSL stream is created, you have access to the following commands.\n\n*Note: the process running the `stream` command must be kept alive in order to maintain the LSL stream. These following commands should be run in another terminal or second process*\n\nTo view data:\n\n $ muselsl view\n\nIf the visualization freezes or is laggy, you can also try the alternate version 2 of the viewer. *Note: this will require the additional [vispy](https://github.com/vispy/vispy) and [mne](https://github.com/mne-tools/mne-python) dependencies*\n\n $ muselsl view --version 2\n\nTo record EEG data into a CSV:\n\n $ muselsl record --duration 60 \n\n*Note: this command will also save data from any LSL stream containing 'Markers' data, such as from the stimulus presentation scripts in [EEG Notebooks](https://github.com/neurotechx/eeg-notebooks)*\n\nAlternatively, you can record data directly without using LSL through the following command:\n\n $ muselsl record_direct --duration 60\n\n_Note: direct recording does not allow 'Markers' data to be recorded_\n\n## Running Experiments\n\nMuse LSL was designed so that the Muse could be used to run a number of classic EEG experiments, including the [P300 event-related potential](http://alexandre.barachant.org/blog/2017/02/05/P300-with-muse.html) and the SSVEP and SSAEP evoked potentials.\n\nThe code to perform these experiments is still available, but is now maintained in the [EEG Notebooks](https://github.com/neurotechx/eeg-notebooks) repository by the [NeuroTechX](https://neurotechx.com) community.\n\n## Usage as a Library\n\nIf you want to integrate Muse LSL into your own Python project, you can import and use its functions as you would any Python library. Examples are available in the `examples` folder:\n\n```Python\nfrom muselsl import stream, list_muses\n\nmuses = list_muses()\nstream(muses[0]['address'])\n\n# Note: Streaming is synchronous, so code here will not execute until after the stream has been closed\nprint('Stream has ended')\n```\n\n## Alternate Data Types\n\nIn addition to EEG, the Muse also provides data from an accelerometer, gyroscope, and, in the case of the Muse 2, a photoplethysmography (PPG) sensor. These data types can be enabled via command line arguments or by passing the correct parameters to the `stream` function. Once enabled, PPG, accelerometer, and gyroscope data will streamed in their own separate LSL streams named \"PPG\", \"ACC\", and \"GYRO\", respectively.\n\nTo stream data from all sensors in a Muse 2 from the command line:\n\n muselsl stream --ppg --acc --gyro\n\nAs a library function:\n\n```Python\nfrom muselsl import stream, list_muses\n\nmuses = list_muses()\nstream(muses[0]['address'], ppg_enabled=True, acc_enabled=True, gyro_enabled=True)\n```\n\nTo record data from an alternate data source:\n\n muselsl record --type ACC\n\n*Note: The record process will only record from one data type at a time. However, multiple terminals or processes can be used to record from multiple data types simultaneously*\n\n## What is LSL?\n\nLab Streaming Layer or LSL is a system designed to unify the collection of time series data for research experiments. It has become standard in the field of EEG-based brain-computer interfaces for its ability to make seperate streams of data available on a network with time synchronization and near real-time access. For more information, check out this [lecture from Modern Brain-Computer Interface Design](https://www.youtube.com/watch?v=Y1at7yrcFW0) or the [LSL repository](https://github.com/sccn/labstreaminglayer)\n\n## Common Issues\n\n### Mac and Windows\n\n1. Connection issues with BLED112 dongle:\n\n- You may need to use the `--interface` argument to provide the appropriate COM port value for the BLED112 device. The default value is COM9. To setup or view the device's COM port go to your OS's system settings\n\n### Linux\n\n1. `pygatt.exceptions.BLEError: Unexpected error when scanning: Set scan parameters failed: Operation not permitted` (Linux)\n\n- This is an issue with pygatt requiring root privileges to run a scan. Make sure you [have `libcap` installed](https://askubuntu.com/questions/347788/how-can-i-install-libpcap-header-files-on-ubuntu-12-04) and run `` sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcitool` ``\n\n2. `pygatt.exceptions.BLEError: No characteristic found matching 273e0003-4c4d-454d-96be-f03bac821358` (Linux)\n\n- There is a problem with the most recent version of pygatt. Work around this by downgrading to 3.1.1: `pip install pygatt==3.1.1`\n\n3. `pygatt.exceptions.BLEError: No BLE adapter found` (Linux)\n\n- Make sure your computer's Bluetooth is turned on.\n\n4. `pygatt.exceptions.BLEError: Unexpected error when scanning: Set scan parameters failed: Connection timed out` (Linux)\n\n- This seems to be due to a OS-level Bluetooth crash. Try turning your computer's bluetooth off and on again\n\n5. `'RuntimeError: could not create stream outlet'` (Linux)\n\n- This appears to be due to Linux-specific issues with the newest version of pylsl. Ensure that you have pylsl 1.10.5 installed in the environment in which you are trying to run Muse LSL", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alexandrebarachant/muse-lsl/", "keywords": "muse lsl eeg ble neuroscience", "license": "BSD (3-clause)", "maintainer": "", "maintainer_email": "", "name": "muselsl", "package_url": "https://pypi.org/project/muselsl/", "platform": "", "project_url": "https://pypi.org/project/muselsl/", "project_urls": { "Homepage": "https://github.com/alexandrebarachant/muse-lsl/" }, "release_url": "https://pypi.org/project/muselsl/2.0.2/", "requires_dist": null, "requires_python": "", "summary": "Stream and visualize EEG data from the Muse headset.", "version": "2.0.2" }, "last_serial": 5316853, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "73eec3be2fe53ad52d3caf15d6791fed", "sha256": "7e16971b4ef2d562f5fb2d5024297dee85c59e4880662271c8368e2618bc7d1f" }, "downloads": -1, "filename": "muselsl-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "73eec3be2fe53ad52d3caf15d6791fed", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20736, "upload_time": "2018-06-12T18:41:52", "url": "https://files.pythonhosted.org/packages/fb/ca/3488eb3a7da2b13f23933a76262682bf94f721f88809b8593676008bfb37/muselsl-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2083532df18ac4725475113ddc85caa8", "sha256": "21cd8f1605d8efa1d87949441d1bd4ef75ea4ea3b70035732e246f3059febd10" }, "downloads": -1, "filename": "muselsl-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2083532df18ac4725475113ddc85caa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 113665, "upload_time": "2018-06-12T18:41:53", "url": "https://files.pythonhosted.org/packages/15/d8/c8cd9124490a5d919e68e167b3555eb948ed4d974e05a612bef34bc2e796/muselsl-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "84438868500a402a1f945c6d06a2e39e", "sha256": "5cf6a9b068371e2283f251b4ad8772fb29ddc6058051e588df00602159d08231" }, "downloads": -1, "filename": "muselsl-1.0.1.tar.gz", "has_sig": false, "md5_digest": "84438868500a402a1f945c6d06a2e39e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 114081, "upload_time": "2018-06-22T01:02:07", "url": "https://files.pythonhosted.org/packages/63/6a/971401d7b070048352964a0ce0dea16174fd56a4760b79720a68489fd041/muselsl-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "1f312b37e1937d42b0fb50027245d9ae", "sha256": "55b82a9ae8bf1108fceb98d5e6e2ed75fe4f3ea0103c31914679e4c24699ab42" }, "downloads": -1, "filename": "muselsl-1.0.2.tar.gz", "has_sig": false, "md5_digest": "1f312b37e1937d42b0fb50027245d9ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 114436, "upload_time": "2018-07-23T00:29:02", "url": "https://files.pythonhosted.org/packages/99/06/9246756db6b636480574224be9457d885332a84282667f79621d79bc8ae6/muselsl-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "9e1d8b6238d1376bbccf25a1cb516bbf", "sha256": "a6721e289ce6c777e6abec1a96ab6b1d45ce57f97be4091c98a343bc72853ebc" }, "downloads": -1, "filename": "muselsl-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9e1d8b6238d1376bbccf25a1cb516bbf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 21624, "upload_time": "2018-12-12T18:10:28", "url": "https://files.pythonhosted.org/packages/a7/2a/9963a9ce1d34aedbefd7f176232380ad2940a816c813380524e34c169fc7/muselsl-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5109949820f11ab8298cf9e11136cb22", "sha256": "856ce1b6f983860b7fc1e033c6185fe63eab3734453cd5afc7cb753cc052eb32" }, "downloads": -1, "filename": "muselsl-1.0.3.tar.gz", "has_sig": false, "md5_digest": "5109949820f11ab8298cf9e11136cb22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 114381, "upload_time": "2018-12-12T18:10:33", "url": "https://files.pythonhosted.org/packages/1b/ec/3a210b8e13646a46a045ec06ecf2bbe26fa7576dd53d2cb0efb60938b4c0/muselsl-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "9153e837621a31feca6a723b9b45c718", "sha256": "7e76b9eb587feeac52e52d0ce741dc72e971eff1f07a2cb31e1a5a51952998d6" }, "downloads": -1, "filename": "muselsl-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9153e837621a31feca6a723b9b45c718", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20548, "upload_time": "2019-01-28T11:10:37", "url": "https://files.pythonhosted.org/packages/32/4c/4d49960867bbfe6449a79c01df4448decbbe4c90c35e56bed221c1ef10af/muselsl-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac59c1231c88106a34d324e1f646ab7f", "sha256": "be6ab75bec8f13903d89e5fccc6568bcf808e3a46b93064d4f3f37795e8c7156" }, "downloads": -1, "filename": "muselsl-1.0.4.tar.gz", "has_sig": false, "md5_digest": "ac59c1231c88106a34d324e1f646ab7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 114376, "upload_time": "2019-01-28T11:10:38", "url": "https://files.pythonhosted.org/packages/8b/bc/8a1ca1c9a245c082c1b7afc355ec123f0d7760d0fca8d441209f32c17624/muselsl-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "b9f127a7b9cdad641d1d47e07e58e925", "sha256": "69a057d29d74c61fc3cdbf75afc53ef3cc36e1d160e533521b93195fa666ff5c" }, "downloads": -1, "filename": "muselsl-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b9f127a7b9cdad641d1d47e07e58e925", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20728, "upload_time": "2019-02-21T16:53:31", "url": "https://files.pythonhosted.org/packages/c3/59/e53c6a3c88b37a11f410c4665a7c97e6be6b871fb7d01f1eb3ee4ca84740/muselsl-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "204c03b53c739c3f221a7406d6ef3f14", "sha256": "256a65b03d785f1259f0188ae4efb712c03b1b428e93fca511162a0f9c8a2c91" }, "downloads": -1, "filename": "muselsl-1.0.5.tar.gz", "has_sig": false, "md5_digest": "204c03b53c739c3f221a7406d6ef3f14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 114303, "upload_time": "2019-02-21T16:53:33", "url": "https://files.pythonhosted.org/packages/74/41/72b234519065bea94c5bc52cf6d13757a26f2fb78244ff2506a66bfde663/muselsl-1.0.5.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "d2472f63e918afaa7c167e38e7b5f110", "sha256": "7d63754cc39285a8d0703cdf96235e845c888e85edb2b9ddfb41247fec1f345c" }, "downloads": -1, "filename": "muselsl-2.0.0.tar.gz", "has_sig": false, "md5_digest": "d2472f63e918afaa7c167e38e7b5f110", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 116037, "upload_time": "2019-05-17T23:11:21", "url": "https://files.pythonhosted.org/packages/32/32/1a3b6d239cc63e4ccfbf8dba4ab8839164693eebb8432c34853b1ad56de7/muselsl-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "ca3979c80f0a6935f79dd2b8395abf5f", "sha256": "c419e3a628e3b2a3c3640eccdd39589e623d170adab5237c6281c31dd780c0e0" }, "downloads": -1, "filename": "muselsl-2.0.1.tar.gz", "has_sig": false, "md5_digest": "ca3979c80f0a6935f79dd2b8395abf5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 116666, "upload_time": "2019-05-18T04:07:38", "url": "https://files.pythonhosted.org/packages/af/d6/2f1eee224ab9bdb7710210b7520be828c592eeefb1d51ddfe0f6f4cde4a5/muselsl-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "633390dc6979fbfa037d9921483118e7", "sha256": "239fbc71e590b826a91e6de6e5bc124421ee5d5a90f25de74461a201d2cc1185" }, "downloads": -1, "filename": "muselsl-2.0.2.tar.gz", "has_sig": false, "md5_digest": "633390dc6979fbfa037d9921483118e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 120425, "upload_time": "2019-05-25T16:45:53", "url": "https://files.pythonhosted.org/packages/21/31/bc2c0fcff2a01054df803bdf070def7ff835e58ee7ea829479bd29d97633/muselsl-2.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "633390dc6979fbfa037d9921483118e7", "sha256": "239fbc71e590b826a91e6de6e5bc124421ee5d5a90f25de74461a201d2cc1185" }, "downloads": -1, "filename": "muselsl-2.0.2.tar.gz", "has_sig": false, "md5_digest": "633390dc6979fbfa037d9921483118e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 120425, "upload_time": "2019-05-25T16:45:53", "url": "https://files.pythonhosted.org/packages/21/31/bc2c0fcff2a01054df803bdf070def7ff835e58ee7ea829479bd29d97633/muselsl-2.0.2.tar.gz" } ] }