Update mid2chart.cpp