2010-08-31 5 views
0

Ceci est une suite sur mon previous question.Construction d'un fichier midi - Python

J'ai réussi à extraire un ensemble de fréquences de l'audio d'entrée, maintenant que recommanderiez-vous pour construire un fichier MIDI?


Merci pour votre aide.

+0

double: http://stackoverflow.com/questions/569321/simple- cross-platform-midi-library-for-python –

Répondre

2

Je suis partielle http://www.mxm.dk/products/public/pythonmidi

Un exemple simple de comment l'utiliser:

from MidiOutFile import MidiOutFile 

    out_file = 'song.mid' 
    midi = MidiOutFile(out_file) 
    midi.header() 
    midi.start_of_track() 
    midi.update_time(0) 
    midi.note_on(channel=0, note=0x40) 
    midi.update_time(192) 
    midi.note_off(channel=0, note=0x40) 
    midi.update_time(0) 
    midi.end_of_track() 
    midi.eof()