ipymidi


Nameipymidi JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryInteractive MIDI in Jupyter
upload_time2023-12-15 15:25:52
maintaineripymidi contributors
docs_urlNone
authorBenoît Bovy
requires_python
licenseBSD-3-Clause
keywords midi jupyter widget
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![logo](https://user-images.githubusercontent.com/4160723/290532327-283f5234-2f8c-4b4e-9e59-79b9551f11d0.svg)

# IpyMIDI

_Interactive MIDI in Jupyter_

IpyMIDI exposes the Web MIDI interface ([Web MIDI
API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API)) to Python
as [Jupyter widgets](https://ipywidgets.readthedocs.io) via
[WEBMIDI.js](https://webmidijs.org/). Connect your MIDI devices (e.g., keyboards,
controllers, etc.) and start interacting with them in Jupyter!

**Note: this is very much work in progress (nothing much to see yet)!**

## Usage Example

Create a Jupyter notebook and import the library.

```python
import ipymidi
```

Get access to the Web MIDI interface.

```python
midi = ipymidi.get_interface()
```

Enable the MIDI interface (your Web browser may ask you the permission to access it).

```python
midi.enable()
```

Get the list of all connected MIDI input devices.

```python
midi.inputs
```

```
MIDI Inputs (2)
0:
    id: 92212230
    name: Virtual MIDI
    manufacturer: Apple Inc.
    connection: open
    state: connected
1:
    id: -1491552641
    name: Arturia KeyStep 37
    manufacturer: Arturia
    connection: open
    state: connected
```

Track a specific MIDI event emitted from one input device (e.g., the "noteon"
event emitted from a MIDI keyboard).

```python
ev = midi.inputs["Arturia KeyStep 37"].track_event("noteon", ["note_identifier"])
```

Use the `ev` object like any other Jupyter widget, e.g., to print in an output
widget the MIDI note that has just been played on the input device.

```python
import ipywidgets

output = ipywidgets.Output()

@ev.observe
def print_message(change):
    output.clear_output()
    with output:
        print(f"Note {change["owner"].note_identifier} played!")

output
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ipymidi",
    "maintainer": "ipymidi contributors",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "MIDI,jupyter,widget",
    "author": "Beno\u00eet Bovy",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/bc/22/391daed0e1d8eea2d5d21d46dc8a7559cddf285c731d8726e50ae4b7d7bc/ipymidi-0.0.1.tar.gz",
    "platform": null,
    "description": "![logo](https://user-images.githubusercontent.com/4160723/290532327-283f5234-2f8c-4b4e-9e59-79b9551f11d0.svg)\n\n# IpyMIDI\n\n_Interactive MIDI in Jupyter_\n\nIpyMIDI exposes the Web MIDI interface ([Web MIDI\nAPI](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API)) to Python\nas [Jupyter widgets](https://ipywidgets.readthedocs.io) via\n[WEBMIDI.js](https://webmidijs.org/). Connect your MIDI devices (e.g., keyboards,\ncontrollers, etc.) and start interacting with them in Jupyter!\n\n**Note: this is very much work in progress (nothing much to see yet)!**\n\n## Usage Example\n\nCreate a Jupyter notebook and import the library.\n\n```python\nimport ipymidi\n```\n\nGet access to the Web MIDI interface.\n\n```python\nmidi = ipymidi.get_interface()\n```\n\nEnable the MIDI interface (your Web browser may ask you the permission to access it).\n\n```python\nmidi.enable()\n```\n\nGet the list of all connected MIDI input devices.\n\n```python\nmidi.inputs\n```\n\n```\nMIDI Inputs (2)\n0:\n    id: 92212230\n    name: Virtual MIDI\n    manufacturer: Apple Inc.\n    connection: open\n    state: connected\n1:\n    id: -1491552641\n    name: Arturia KeyStep 37\n    manufacturer: Arturia\n    connection: open\n    state: connected\n```\n\nTrack a specific MIDI event emitted from one input device (e.g., the \"noteon\"\nevent emitted from a MIDI keyboard).\n\n```python\nev = midi.inputs[\"Arturia KeyStep 37\"].track_event(\"noteon\", [\"note_identifier\"])\n```\n\nUse the `ev` object like any other Jupyter widget, e.g., to print in an output\nwidget the MIDI note that has just been played on the input device.\n\n```python\nimport ipywidgets\n\noutput = ipywidgets.Output()\n\n@ev.observe\ndef print_message(change):\n    output.clear_output()\n    with output:\n        print(f\"Note {change[\"owner\"].note_identifier} played!\")\n\noutput\n```\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Interactive MIDI in Jupyter",
    "version": "0.0.1",
    "project_urls": {
        "Repository": "https://github.com/benbovy/ipymidi"
    },
    "split_keywords": [
        "midi",
        "jupyter",
        "widget"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f746c658a31296d569efca197c215a334b163c9d45a91460f58c530dd74cc77e",
                "md5": "a65a60a68769927e3703149118a96004",
                "sha256": "e7ccab80e043b61a7b595fd9d86626a2cf411c2b08a490e7620aec19a22dcaaf"
            },
            "downloads": -1,
            "filename": "ipymidi-0.0.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a65a60a68769927e3703149118a96004",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 26942,
            "upload_time": "2023-12-15T15:25:50",
            "upload_time_iso_8601": "2023-12-15T15:25:50.994252Z",
            "url": "https://files.pythonhosted.org/packages/f7/46/c658a31296d569efca197c215a334b163c9d45a91460f58c530dd74cc77e/ipymidi-0.0.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc22391daed0e1d8eea2d5d21d46dc8a7559cddf285c731d8726e50ae4b7d7bc",
                "md5": "eadadff5a68cbfa8cef484d9c65e9bcb",
                "sha256": "d64cb18a4895ab299442ebe196518ed03bcff78e5085a9bd926af4a2ed6b488e"
            },
            "downloads": -1,
            "filename": "ipymidi-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "eadadff5a68cbfa8cef484d9c65e9bcb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25449,
            "upload_time": "2023-12-15T15:25:52",
            "upload_time_iso_8601": "2023-12-15T15:25:52.495033Z",
            "url": "https://files.pythonhosted.org/packages/bc/22/391daed0e1d8eea2d5d21d46dc8a7559cddf285c731d8726e50ae4b7d7bc/ipymidi-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-15 15:25:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "benbovy",
    "github_project": "ipymidi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ipymidi"
}
        
Elapsed time: 3.02849s