create_midi.py
def main(content):
    """
    Turn content into a song.
    """
    midi = Midi(1, tempo=200)

    global TIME
    lines = content.splitlines()
    for row in lines:

        chord = get_chord(row.split('<>')[-1].strip())
        if chord:
            for note in chord:
                midi.midi_data.addNote(0, 0, note.midi_number,
                                       TIME, note.dur, note.volume)
        TIME += DURATION*2
    midi.write("live.mid")

    Turn content into a song.
    
Turn content into a song.
Turn content into a song .
def main(content):
    midi = Midi(1, tempo=200)
    global TIME
    lines = content.splitlines()
    for row in lines:
        chord = get_chord(row.split('<>')[-1].strip())
        if chord:
            for note in chord:
                midi.midi_data.addNote(0, 0, note.midi_number,
                                       TIME, note.dur, note.volume)
        TIME += DURATION*2
    midi.write("live.mid")
def main ( content ) : midi = Midi ( 1 , tempo = 200 ) global TIME lines = content . splitlines ( ) for row in lines : chord = get_chord ( row . split ( '<>' ) [ - 1 ] . strip ( ) ) if chord : for note in chord : midi . midi_data . addNote ( 0 , 0 , note . midi_number , TIME , note . dur , note . volume ) TIME += DURATION * 2 midi . write ( "live.mid" )
Turn content into a song.
Turn content into a song .
"""
    Turn content into a song.
    """
content