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
Built Distribution
Hashes for fts_rtmidi-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7e49ed72572f4c37d307807ebd3de40e822a8dc84a63ff3e763a9df642a4e82 |
|
MD5 | 42546f6132df8f7e93d1033ea925f72a |
|
BLAKE2b-256 | 0c228a864ea0855714527d18663ee9ed666fd7407b72680a738e56f68a354e64 |