def __init__(self, number_tracks=1, tempo=60, instrument=0, channel=None):

        self.number_tracks = number_tracks
        self.midi_data = MIDIFile(number_tracks)

        for track in range(number_tracks):
            self.midi_data.addTrackName(track, 0, "Track {0}".format(track))
            self.midi_data.addTempo(track, 0, tempo)
            instr = instrument[track] if isinstance(instrument, list) else instrument
            if channel is None:
                _channel = track
            elif isinstance(channel, list):
                _channel = channel[track]
            else:
                _channel = channel
            self.midi_data.addProgramChange(track, _channel, 0, instr)
Return the directory component of a pathname
dataset/ETHPy150Open kroger/pyknon/pyknon/genmidi.py/Midi.__init__--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/javapath.py/dirname