Skip to main content

A simple class for sending MIDI messages

Project description

fts-rtmidi

My name is Ferdinand Tonby-Strandborg, and I am creating this library as I want an easy, quick class for sending midi messages.

Installation

Available on PyPi

pip install fts-rtmidi

Usage

To check what MIDI ports are available, use the rtmidi library. To send messages, use the ftsmidi library.

from rtmidi  import MidiOut
from ftsmidi import MidiSender
from time    import sleep

## Print available MIDI channels using rtmidi class
print(MidiOut().get_ports())


## Connect to MIDI channel "Microsoft GS Wavetable Synth 0"
midi = MidiSender("Microsoft GS Wavetable Synth 0")


## Trigger note middle-C with velocity 120 for 1 second
midi.note_on(60, 120)
sleep(1)
midi.note_off(60)

MIDI protocol

For an in-depth explanation of the MIDI format, please see: https://www.cs.cmu.edu/~music/cmsip/readings/davids-midi-spec.htm

Note on implementation

A lot of the functions are implemented in a way that is unnecessarily hard to read. This is simply as I wanted to test features of Python I haven't used before.

rtmidi

This uses the python-rtmidi library, which is currently available through pypi. All classes here simply wrap the rtmidi classes, and handle formatting the messages.
To learn more about RtMidi, visit their PyPi page or their GitHub repository.

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

fts-rtmidi-0.0.6.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

fts_rtmidi-0.0.6-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

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