Skip to content

Instantly share code, notes, and snippets.

@sjktje
Created April 23, 2015 13:52
Show Gist options
  • Save sjktje/063592ec372c827631a3 to your computer and use it in GitHub Desktop.
Save sjktje/063592ec372c827631a3 to your computer and use it in GitHub Desktop.
nmap <leader>ap :call Abc2midi()<CR>
function! Abc2midi()
let midi_file_name = shellescape(expand("%:p:r").'.mid')
let abc_file_name = shellescape(expand("%:p"))
let cmd = 'abc2midi '.abc_file_name.' -o ' . midi_file_name
silent call system(cmd)
let play_cmd = 'timidity '.midi_file_name
silent call system(play_cmd)
let rm_cmd = 'rm '.midi_file_name
silent call system(rm_cmd)
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment