Questions tagged [mido]

Mido is a Python library for working with MIDI messages and ports. It’s designed to be as straight forward and Pythonic as possible

54 questions
0
votes
1 answer

MIDO: ValueError: variable int must be a positive integer

In my code I get Traceback (most recent call last): File "Midi Projects/symbolToChord_v1.py", line 160, in mo.save("songWithChords.mid") File…
chikitin
  • 762
  • 6
  • 28
0
votes
0 answers

MIDI messages in Python are confusing?

I am currently working on the MIDI data set maestro-v2.0.0 (see). I load my files in python with from mido import MidiFile Then I work on the files from the data set (for example on…
0
votes
0 answers

Cannot change tempo in midi with "Set_Tempo"

I am trying to change a tempo in a midi file with the mido library using the MetaMessage('set_tempo', tempo=tempo, time=tiem) attribute to the tempotrack. When setting the initial tempo to 552528 with time = 0, the bpm is correctly set to 108.59178.…
Ky6000
  • 103
  • 1
  • 9
0
votes
0 answers

Edit messages in midi file without re-encoding

I'm using the mido library. I have a midi file and I want to change its messages. I don't want to encode messages using the Message() function because I already have it encoded in the form: .…
0
votes
1 answer

adding MIDI chords at specific MetaMessage time

I have a MIDI file with marker as meta-messages. fname = "avm.mid" mid = MidiFile(fname) # input file of type 0 metas = [m for m in mid.tracks[0] if m.is_meta] I have stored the meta marker times in the list "chordTimes". The first maker ( chord…
chikitin
  • 762
  • 6
  • 28
0
votes
0 answers

Can't run mido and keyboard modules within conda virtual env (python2.7)

On Ubuntu 18.04, I am trying to create a conda virtual env which has mido and keyboard modules installed. This is successfully done using conda create -n my_env python=2.7 and pip install for mido and keyboard. No errors are raised when I run python…
Hano
  • 1
  • 1
  • 5
0
votes
2 answers

How to grab the note attribute from Message in mido?

I'm trying to print out the note attribute in each message output by mido in a .mid file. Right now, my code looks like this: for msg in mid.tracks[1]: if not msg.is_meta: print(msg.note) But, upon running the code, I get the…
0
votes
1 answer

Python add/subtract counter by comparing last to second-to-last values

I am trying to count the number of items in a list by adding/subtracting depending on certain conditions. For a bit more context: I have Midi controller that outputs Midi data whenever a knob is turned. Regardless of where the knob is, I want to…
NewbCake
  • 433
  • 2
  • 7
  • 22
0
votes
0 answers

Extract info from json file, Python

I am trying to extract information out of a JSON file that I dumped. I used Mido module to get the information I need, and the only way I've found to get these features is by dumping it as a JSON. But, after some search, I've tried and not managed…
1 2 3
4