Skip to content

Zeyu-Li/Midi_interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Midi Interface by Andrew Li

A Python interface for MIDIUtil

Install with

python setup.py install

+

You need MIDIUtil, so

pip install MIDIUtil

Tests

To run a test, use the following command

py .\tests\test_1.py

Use

To use, import with

from Midi_interface.Midi import Midi

Functions you can use

def set_tempo(self, tempo, time = 0):
    ''' sets tempo of track at a given time given the time and the tempo, defaults to start of track '''
    
def set_track(self, track):
    ''' given new track (int) switch to that track '''
    
def set_instrument(self, instrument_number):
    ''' set the instrument of current track; use this website to find your instrument: https://www.midi.org/specifications/item/gm-level-1-sound-set '''
  
def notes_to_midi(self, string_notes):
    '''
    converts list of notes ie [G3, Ab5, f#2] (supports octaves 0 to 9 inclusive)
    to notes interpreted by this midi class
    '''
        
def push_notes(self, new_notes, duration):
    ''' 
    given list of note pitch and duration, push to notes and duration attribute
    (new note pitch can be a list or a single note, same with duration)
    '''
        
def encode_track(self):
    ''' encodes the entirety of a single track '''

def output_mid(self, name):
    '''
    given mid output name (.mid extension not needed),
    the .mid extension will be added
    *Note if the mid file of the same name already exists, it will be OVERWRITTEN
    '''

* Note, look at the tests if you need examples of how to implement things

Requires

But will install if you don't have it

License

MIT

About

A interface for MIDIUtil 🎹

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages