You should smelt them under argon. You need to construct dedicated furnace for it. Crucible from magnesia (MgO) is best for the job. Load crucible with mixture of pieces of metals in right proportion. Temperatures in range 1000*C.
If both oxygen and nitrogen are excluded, titanium should dissolve in molten Mg.
Your alloy in all probabilities will be useless (issues with grain size, impurities etc). There is much more in metallurgy than smelting few elements together and hoping for the best.