midi

Need Loop Function to Analyze the key of MIDI files

Need Loop Function to Analyze the key of MIDI files Question: I’m working on code for a research project where I need to analyze the key of each file in a folder full of MIDI files and then output the name of each file in an excel sheet in one column and the key of …

Total answers: 1

MIDIutil write MIDI File to boto3 API server via Flask [Python]

MIDIutil write MIDI File to boto3 API server via Flask [Python] Question: struggling with trying to write a MIDIUtil file in my Flask App connecting to an s3 server. In a local instance, it’s no sweat: LOCAL_UPLOAD_FOLDER = ‘./_static/uploads/MIDI_files/’ file_name = "NAME.mid" file_path = f'{LOCAL_UPLOAD_FOLDER}{file_name}’ MyMIDI = MIDIFile(1) with open(file_path, "wb") as output_file: MyMIDI.writeFile(output_file) However, …

Total answers: 2

Python Pygame.midi get note octave

Python Pygame.midi get note octave Question: Have a code that reads what note pressed on the midi: import pygame.midi def number_to_note(number): notes = [‘c’, ‘c#’, ‘d’, ‘d#’, ‘e’, ‘f’, ‘f#’, ‘g’, ‘g#’, ‘a’, ‘a#’, ‘b’] return notes[number%12] def readInput(input_device): while True: if input_device.poll(): event = input_device.read(1)[0] data = event[0] timestamp = event[1] note_number = data[1] …

Total answers: 1

Problem with MultiPort use in python mido MIDI package

Problem with MultiPort use in python mido MIDI package Question: I am working in a program that autosaves MIDI messages as they are played, and everything is working really well when using a single input port. I want to extend to use 2 or 3 simultaneous ports (the app is aimed at VST piano players, …

Total answers: 1

Serial communication between python, arduino and hairless MIDI

Serial communication between python, arduino and hairless MIDI Question: I want to send a message from python via serial to arduino uno and then from arduino to hairless MIDI to control LMMS software. The problem is that the communication in both cases goes through port COM4. Is it somehow possible to get data from python …

Total answers: 1

How can I write a MIDI file with Python?

How can I write a MIDI file with Python? Question: I am writing a script to convert a picture into MIDI notes based on the RGBA values of the individual pixels. However, I cannot seem to get the last step working, which is to actually output the notes to a file. I have tried using …

Total answers: 3

play MIDI files in python?

play MIDI files in python? Question: I’m looking for a method to play midi files in python. It seems python does not support MIDI in its standard library. After I searched, I found some python midi librarys such as pythonmidi. However, most of them can only create and read MIDI file without playing function. I …

Total answers: 5

Simple, Cross Platform MIDI Library for Python

Simple, Cross Platform MIDI Library for Python Question: I want to do build a small app that creates MIDI sounds. I’ve never dealt with sound in programming so I’d like to start with something that’s basic and has good documentation. I want to stick with Python since I’m the most comfortable with it and don’t …

Total answers: 7