All Projects → mik3y → pymidi

mik3y / pymidi

Licence: MIT license
Python library for building RTP-MIDI / AppleMIDI clients and servers

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pymidi

Pedalino
Smart wireless MIDI foot controller for guitarists and more.
Stars: ✭ 105 (+200%)
Mutual labels:  midi, applemidi, rtp-midi
jamhub
low-latency jamming space for musicians
Stars: ✭ 29 (-17.14%)
Mutual labels:  midi
Raspberry-MIDI-Controller
A python script that sends MIDI signals from the Raspberry (client) to a Computer (host)
Stars: ✭ 44 (+25.71%)
Mutual labels:  midi
ADLMIDI-Player-Java
Simple MIDI-player for Android based on libADLMIDI library
Stars: ✭ 24 (-31.43%)
Mutual labels:  midi
midi-eye
Ruby MIDI input event listener
Stars: ✭ 24 (-31.43%)
Mutual labels:  midi
alsa-midi-latency-test
Measure the roundtrip time of MIDI messages.
Stars: ✭ 20 (-42.86%)
Mutual labels:  midi
midibus.js
🚌💨🎶 Web MIDI API wrapper based on themidibus
Stars: ✭ 24 (-31.43%)
Mutual labels:  midi
Neothesia
Flashy Synthesia Like Software For Linux,Windows and MacOs
Stars: ✭ 483 (+1280%)
Mutual labels:  midi
microfreak-reader
An application to read and display the presets stored in the Arturia MicroFreak memory.
Stars: ✭ 32 (-8.57%)
Mutual labels:  midi
drum-machine-patterns
Transcription of the book 200 Drum machine patterns by René-Pierre Bardet
Stars: ✭ 49 (+40%)
Mutual labels:  midi
HitNotes
Rhythm-based mobile game
Stars: ✭ 24 (-31.43%)
Mutual labels:  midi
synthrs
Toy audio synthesizer library in Rust with basic MIDI support.
Stars: ✭ 73 (+108.57%)
Mutual labels:  midi
osci-render
〰📺🔊 Software for making music by drawing objects on an oscilloscope using audio.
Stars: ✭ 135 (+285.71%)
Mutual labels:  midi
node-keyboard
A REPL where music is simply streams of input in node (using soundfonts). Supports optional MIDI input and Rx.
Stars: ✭ 50 (+42.86%)
Mutual labels:  midi
midi-recorder
🎹 The easiest way to record MIDI. No install. Automatically records.
Stars: ✭ 38 (+8.57%)
Mutual labels:  midi
Kazedan
A Synthesia styled MIDI visualization.
Stars: ✭ 18 (-48.57%)
Mutual labels:  midi
Robatim
a hard-coded music generator
Stars: ✭ 29 (-17.14%)
Mutual labels:  midi
esp32 multitrack looper
ESP32 Audio Kit based multitrack looper
Stars: ✭ 43 (+22.86%)
Mutual labels:  midi
mdxtools
A bunch of tools for handling the MDX music format (music for the Sharp x68000)
Stars: ✭ 44 (+25.71%)
Mutual labels:  midi
rtmidi2
python bindings to rtmidi allowing to listen to multiple ports simultaneously
Stars: ✭ 16 (-54.29%)
Mutual labels:  midi

pymidi

A python RTP-MIDI / AppleMIDI implementation. You can use this library to build a network attached virtual MIDI device.

Build Status

Latest release: v0.4.0 (2018-12-26) (changelog)

Table of Contents

Quickstart

$ pip install pymidi

or

poetry install pymidi

See Using in Another Project and the Developer Setup wiki for more information.

Developer Setup

Set up your workspace with the very excellent Poetry:

$ poetry install

Once installed, you'll probably find it useful to work in a poetry shell, for ease of testing and running things:

$ poetry shell
(pymidi-tFFCbXNj)
$ python pymidi/server.py

Compatibility

pymidi requires Python 3. It has been tested against Python 3.6 and Python 3.7.

Running tests

Tests are run with pytest:

$ pytest

Developing against something else

If you're working on a project that uses pymidi and want to develop both concurrently, leverage the setuptools develop command:

$ cd ~/git/otherproject
$ poetry shell
$ pushd ~/git/pymidi && python setup.py develop && popd

This creates a link to ~/git/pymidi within the environment of ~/git/otherproject.

Demo Server and Examples

The library includes a simple demo server which prints stuff.

$ python pymidi/examples/example_server.py

See --help for usage. See the examples/ directory for other examples.

Using in Another Project

Most likely you will want to embed a server in another project, and respond to MIDI commands in some application specific way. The demo serve is an example of what you need to do.

First, create a subclass of server.Handler to implement your policy:

from pymidi import server

class MyHandler(server.Handler):
    def on_peer_connected(self, peer):
        print('Peer connected: {}'.format(peer))

    def on_peer_disconnected(self, peer):
        print('Peer disconnected: {}'.format(peer))

    def on_midi_commands(self, peer, command_list):
        for command in command_list:
            if command.command == 'note_on':
                key = command.params.key
                velocity = command.params.velocity
                print('Someone hit the key {} with velocity {}'.format(key, velocity))

Then install it in a server and start serving:

myServer = server.Server([('0.0.0.0', 5051)])
myServer.add_handler(MyHandler())
myServer.serve_forever()

See the Developer Setup wiki for ways to test with real devices.

Project Status

What works:

  • Exchange packet parsing
  • Timestamp sync packet parsing
  • Exchange & timestamp sync protocol support
  • MIDI message parsing

Not (yet) implemented:

  • Journal contents parsing
  • Verification of peers on the data channel
  • Auto-disconnect peers that stop synchronizing clocks

References and Reading

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].