Skip to main content

Interactive MIDI in Jupyter

Project description

logo

IpyMIDI

Interactive MIDI in Jupyter

IpyMIDI exposes the Web MIDI interface (Web MIDI API) to Python as Jupyter widgets via WEBMIDI.js. 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.

import ipymidi

Get access to the Web MIDI interface.

midi = ipymidi.get_interface()

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

midi.enable()

Get the list of all connected MIDI input devices.

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).

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipymidi-0.0.1.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

ipymidi-0.0.1-py2.py3-none-any.whl (26.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ipymidi-0.0.1.tar.gz.

File metadata

  • Download URL: ipymidi-0.0.1.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ipymidi-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d64cb18a4895ab299442ebe196518ed03bcff78e5085a9bd926af4a2ed6b488e
MD5 eadadff5a68cbfa8cef484d9c65e9bcb
BLAKE2b-256 bc22391daed0e1d8eea2d5d21d46dc8a7559cddf285c731d8726e50ae4b7d7bc

See more details on using hashes here.

File details

Details for the file ipymidi-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ipymidi-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ipymidi-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e7ccab80e043b61a7b595fd9d86626a2cf411c2b08a490e7620aec19a22dcaaf
MD5 a65a60a68769927e3703149118a96004
BLAKE2b-256 f746c658a31296d569efca197c215a334b163c9d45a91460f58c530dd74cc77e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page