All Projects → gesellkammer → rtmidi2

gesellkammer / rtmidi2

Licence: MIT license
python bindings to rtmidi allowing to listen to multiple ports simultaneously

Programming Languages

C++
36643 projects - #6 most used programming language
cython
566 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to rtmidi2

Omnimidi
A software MIDI synthesizer for professional use.
Stars: ✭ 181 (+1031.25%)
Mutual labels:  midi, realtime
multipiano
A vuejs application which allow users to play piano with friends!
Stars: ✭ 33 (+106.25%)
Mutual labels:  midi, realtime
Score
ossia score, an interactive sequencer for the intermedia arts.
Stars: ✭ 808 (+4950%)
Mutual labels:  creative-coding, midi
Fluidsynth
Software synthesizer based on the SoundFont 2 specifications
Stars: ✭ 811 (+4968.75%)
Mutual labels:  midi, realtime
microbium-app
Draw new worlds
Stars: ✭ 89 (+456.25%)
Mutual labels:  creative-coding, realtime
Eternal
👾~ music, eternal ~ 👾
Stars: ✭ 323 (+1918.75%)
Mutual labels:  creative-coding, midi
Libossia
A modern C++, cross-environment distributed object model for creative coding and interaction scoring
Stars: ✭ 133 (+731.25%)
Mutual labels:  creative-coding, midi
ADLMIDI-Player-Java
Simple MIDI-player for Android based on libADLMIDI library
Stars: ✭ 24 (+50%)
Mutual labels:  midi
barracuda-style-transfer
Companion code for the Unity Style Transfer blog post, showcasing realtime style transfer using Barracuda.
Stars: ✭ 126 (+687.5%)
Mutual labels:  realtime
HitNotes
Rhythm-based mobile game
Stars: ✭ 24 (+50%)
Mutual labels:  midi
fastapi websocket pubsub
A fast and durable Pub/Sub channel over Websockets. FastAPI + WebSockets + PubSub == ⚡ 💪 ❤️
Stars: ✭ 255 (+1493.75%)
Mutual labels:  realtime
UPPERCASE
실시간성에 특화된 풀스택 프레임워크 ✨
Stars: ✭ 30 (+87.5%)
Mutual labels:  realtime
tideflow
Building extensible automation. Tideflow is a Realtime, open source workflows execution and monitorization web application.
Stars: ✭ 101 (+531.25%)
Mutual labels:  realtime
drum-machine-patterns
Transcription of the book 200 Drum machine patterns by René-Pierre Bardet
Stars: ✭ 49 (+206.25%)
Mutual labels:  midi
2d-diffusion-limited-aggregation-experiments
Visual experiments exploring diffusion-limited aggregation (DLA) as a 2D morphogenesis tool.
Stars: ✭ 41 (+156.25%)
Mutual labels:  creative-coding
Robatim
a hard-coded music generator
Stars: ✭ 29 (+81.25%)
Mutual labels:  midi
awesome-processing
🎨 Creative Coding @processing Resources that u like
Stars: ✭ 39 (+143.75%)
Mutual labels:  creative-coding
ngrx-realtime-app
Demo to build a realtime Angular app with a Vert.x backend and distributed event bus
Stars: ✭ 45 (+181.25%)
Mutual labels:  realtime
css-art-gallery
A collection of CSS Arts.
Stars: ✭ 127 (+693.75%)
Mutual labels:  creative-coding
MiDispositivoMIDI V3
Open source Arduino MIDI controller.
Stars: ✭ 49 (+206.25%)
Mutual labels:  midi

rtmidi2

Python wrapper for RtMidi, the lightweight, cross-platform MIDI I/O library. For Linux, Mac OS X and Windows.

Based on rtmidi-python

Installation

pip install rtmidi2

This module is compatible with Python 3 >= 3.7

Documentation

https://rtmidi2.readthedocs.io


Usage Examples

rtmidi2 uses a very similar API as RtMidi

Print all in and out ports

import rtmidi2
print(rtmidi2.get_in_ports())
print(rtmidi2.get_out_ports())

Send messages

import rtmidi2

midi_out = rtmidi2.MidiOut()
# open the first available port
midi_out.open_port(0)
# send C3 with vel. 100 on channel 1
midi_out.send_noteon(0, 48, 100)

Get incoming messages - blocking interface

midi_in = rtmidi.MidiIn()
midi_in.open_port(0)

while True:
    message, delta_time = midi_in.get_message()  # will block until a message is available
    if message:
         print(message, delta_time)

Get incoming messages using a callback -- non blocking

def callback(message, time_stamp):
    print(message, time_stamp)

midi_in = rtmidi2.MidiIn()
midi_in.callback = callback
midi_in.open_port(0)

Open multiple ports at once

# get messages from all available ports
midi_in = MidiInMulti()
midi_in.open_ports("*")

def callback(msg, timestamp):
    msgtype, channel = splitchannel(msg[0])
    print(msgtype2str(msgtype), msg[1], msg[2])

midi_in.callback = callback

You can also get the device which generated the event by changing your callback to:

def callback(src, msg, timestamp):
    # src will hold the name of the device
    print("got message from", src)

Send multiple notes at once

# send a cluster of ALL notes with a duration of 1 second
midi_out = MidiOut()
midi_out.open_port()
notes = range(127)
velocities = [90] * len(notes)
midi_out.send_noteon_many(0, notes, velocities)
time.sleep(1)
midi_out.send_noteon_many(0, notes, [0] * len(notes))

License

rtmidi2 is licensed under the MIT License, see LICENSE.

It uses RtMidi, licensed under a modified MIT License, see RtMidi/RtMidi.h.

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