I am trying to rewrite a simple piece of melody in MusixTEX. The problem is that bar lines and end line width does not automatically align the way they're supposed to.

I want them to be aligned like this:
Here is my code:
\documentclass[a4paper]{article}
\usepackage{musixtex}
\usepackage[a4paper]{geometry}
\begin{document}
\begin{music}%
\elemskip%
\normalmusicsize%
\instrumentnumber{1}%
\nobarnumbers%
\setstaffs1{1}%
\generalmeter{\meterfrac{4}4}%
\generalsignature{5}%
\parindent0pt%
\startpiece%
\NOtes\Dqbl{k}{j}\en\NOTesp\hup{g}\en\bar%
\NOtes\Dqbl{k}{j}\en\NOTesp\hup{g}\en\bar%
\NOtes\Dqbl{k}{j}\en\NOTesp\hup{g}\en\bar%
\NOTEs\pause\en\bar%
\NOtes\Dqbu{d}{c}\en\NOTesp\hup{N}\en\bar%
\NOtes\Dqbu{d}{c}\en\NOTes\hu{N}\en\NOtes\Dqbu{a}{b}\en\bar%
\NOtes\Dqbu{d}{c}\en\NOTes\ha{N}\en\bar%
\Endpiece%
\end{music}%
\end{document}
I have followed the instructions to compile accoringly to the MusiXTEX manual (http://ftp.acc.umu.se/mirror/CTAN/macros/musixtex/doc/musixdoc.pdf#page.145) and my compile script is:
#!/bin/sh
# tex file is main.tex
latex main.tex
musixtex -l -x main
latex main.tex
makeindex main
latex main.tex
latex main.tex
dvips -e0 main
ps2pdf main.ps
rm -f *.aux
rm -f *.ps
rm -f *.dvi
rm -f *.idx
rm -f *.ilg
rm -f *.ind
rm -f *.mx1
rm -f *.mx2
rm -f *.log
rm -f *.toc
rm -f *.bbl
rm -f *.blg
rm -f *.out
rm -f make/bib
I have tried several solutions, none of which has been working:
- MusiXTex problem with musixflx
- Musixtex end of line bar problem
- Harmonize width of MusiXTex extracts automatically
I have been extra careful to not have any spaces after the end of each line, hence the "%". I do not know where the problem lies not how to fix it. Any help is appreciated!.

