Refactor midi path creation