Imported from https://github.com/roba91/melody-composer