This is the code companion with the following paper: Li Su, "Vocal melody extraction using patch-based CNN," in 2018 IEEE International Conference of Acoustics, Speech, and Signal Processing. To run the code, please see MelodyExt.py for details.