Mido is a Python library for working with MIDI messages and ports. It’s designed to be as straight forward and Pythonic as possible
Questions tagged [mido]
54 questions
2
votes
1 answer
Multiple midi programs playing simultaneously?
I am using the mido library to control amsynth with python.
So far this is working beautifully...but I can only play one "preset" at a time however.
I'm trying to use "program_change" to switch instruments so I can play several instruments at…

cat pants
- 1,485
- 4
- 13
- 22
1
vote
0 answers
Why does a MIDI file's header change after being uploaded as a Flutter http.MultipartRequest?
I am working on a website for a project where the user uploads a MIDI file which is then sent to the backend to be processed, and the processed MIDI file is then sent back to the user. The issue is that after uploading the file through Flutter in an…

Marwan Sabry
- 85
- 3
- 9
1
vote
0 answers
Is there an automatic way to make a midi file have no instances of a single track being played multiple times at once?
I'm writing a python program that uses mido to interpret midi notes. The problem is, I don't know how to handle instances where a midi file has multiple notes played by the same track at a single moment.
My questions are:
A. Is there a way I could…

Gavinr1
- 11
- 1
1
vote
1 answer
coded with openai chart txt file to midi converter
I have created this code in OpenAI to convert a music notes .txt file into a MIDI file, but it is giving me some errors. If anyone could provide kind assistance to fix it, I would be very grateful.
import mido
# Function to convert a music chart…

Najib
- 13
- 3
1
vote
1 answer
MIDI - Can't read correct tempo information using mido in Python
I am using this dataset of MIDI files and would like to get the durations of each note as a fraction of the pulse (rather than MIDI clock ticks). As I'm using mido in Python 3, the method ticks_per_beat provides exactly the information I…

snaldi
- 101
- 1
- 2
- 9
1
vote
1 answer
Reduce Latency in MIDI GUI
I'm trying to create a simple MIDI display using mido and PySimpleGUI. I have it working decently well, but am hoping to reduce latency between the MIDI controller (i.e. a MIDI keyboard) and the interface display. Particularly, the display will…

jwol
- 41
- 2
1
vote
0 answers
Time conversion from 'time_signature' and BPM from an Ableton Live 11 MIDI file using python-mido
I have exported a MIDI file from Ableton Live 11 and I would like to extract the variation of the mod wheel in the form of a two-columns table with values and corresponding timestamp in seconds.
For this I have written a Python script using mido to…

Joël Tuberosa
- 11
- 1
1
vote
0 answers
Python: get correct start and end of note from midi file
i am playing with python mido library an I am trying to get notes data but I don't understand it.
my code:
# open midi file
midi = str(MidiFile('./midi/piano/WA_Mozart_Marche_Turque_Turkish_March_fingered.mid', clip=True))
# copy…

Michaelo
- 579
- 1
- 5
- 13
1
vote
0 answers
How can I split a whole MIDI file in multiple parts?
For a project I am working on, I would like to split all of the .mid files of my database in smaller parts, specifically 30 seconds each (so a 1min45s song would end up in 4 parts, respectively 30s, 30s, 30s and 15s long). I tried using mido to do…

Osa
- 13
- 2
1
vote
2 answers
Absolute MIDI tick value using mido library
I'm using the Mido library to read a simple MIDI file in python.
My MIDI file is the following: https://www.dropbox.com/s/t80kg9l2k525g0h/file.mid?dl=0
It's just a dummy MIDI file I created with basic notes.
I opened it with the Mido library and…

Mattia Surricchio
- 1,362
- 2
- 21
- 49
1
vote
1 answer
Select GM MIDI Level 2 instruments using the Python Mido library
I'm using the Python Mido
library to create MIDI files. I've figured out that to change the
instrument you add a program_change message to the track for the
given channel:
from mido import Message, MidiFile, MidiTrack
track =…

Björn Lindqvist
- 19,221
- 20
- 87
- 122
1
vote
1 answer
Why is clean Midi file playing differently? (with mido)
I have written a program that takes in a MIDI file, then using Mido, it cleans the data by removing particular types of meta data, repeat messages, etc. It also calculated the cumulative time (as the time in each midi message is in delta time). This…

staplegun
- 79
- 10
1
vote
1 answer
Mido midi - finds twice as many Note_On events if I play on my keyboard, as opposed to drawing notes in the piano roll...?
I have written a program to parse a midi file and find all the Note_On events.
I go into my DAW piano roll and draw in D4, D5, F4
My program correctly finds the Note_One events and identifies them correctly.
Then I go to my midi keyboard and play…

TableTop
- 79
- 8
1
vote
1 answer
How to handle duplicate note_on, note_off, tempo change in more than one tracks, and tracks without program_change in a midi file?
I'm using Mido for python, working on parsing midi files into tuples and met some problems.
Some files that I parse has multiple note_on, resulting in notes at the same pitch and same program being opened more…

xxbidiao
- 834
- 5
- 14
- 27
1
vote
1 answer
How do I vectorize a midi input?
I want to create an LSTM model(using Keras) that will be trained in music, but I am having a difficult time in vectorizing the midi input.
I tried using the 'Mido' library in python from where I was able to extract the data in the following…

Ayush
- 23
- 2