Last Updated: 2021-05-16
In my midi to mp3 conversion project, very many functions acted on the
MidiFile itself, therefore required this as a parameter, along with something
else specific to that particular function (e.g.
Unfortuantely, my method signatures sometimes had the midi file argument first
and sometimes they had it last:
def set_bpm(bpm, midi_data): ... def extract_channel(midi_data, channel_number): ...
This lead to an inconsistent and difficult to use API.
I should have established a convention upfront and stuck to it. In this case,
midi_file - or the part that was needed in many contexts - first,
makes sense, since it makes it easier to
curry the function and reduce the