Update
This is a bug related to MusiXTeX(c) 1.27 <2017-12-26>, fixed in MusiXTeX(c) 1.28 <2018-05-07>. You should update that package.
In case you can't update, you can fix this bug manually in your document. Add the following to your preamble and ignore my original answer:
\usepackage{regexpatch}
\makeatletter
\regexpatchcmd{\C@Inter}{=}{<}{}{}
\xpatchcmd{\C@Inter}{\thr@@}{\f@ur}{}{}
\makeatother
Full MWE (version 1.27):
\documentclass{article}
\usepackage{amsmath}
\usepackage{musixtex}
\usepackage{graphicx}
% to fix a bug in musixtex version <1.28
\usepackage{regexpatch}
\makeatletter
\regexpatchcmd{\C@Inter}{=}{<}{}{}
\xpatchcmd{\C@Inter}{\thr@@}{\f@ur}{}{}
\makeatother
% end fix
% Emits a pitchless duration (stems up). Hides the ugliness of musixtex.
% Usage: \beat{duration}
% Where: duration in [1, 2, 4, 8, 16, 32, 64].
\def\beat#1{
\ifnum#1=1
{\wh{i}} % whole
\else{
\ifnum#1=2
{\hu{i}} % half
\else{
\ifnum#1=4
{\qu{i}} % quarter
\else{
\ifnum#1=8
{\cu{i}} % eighth
\else{
\ifnum#1=16
{\ccu{i}} % sixteenth
\else{
\ifnum#1=32
{\cccu{i}} % thirty-second
\else{{\ccccu{i}}}\fi % sixty-fourth
}\fi
}\fi
}\fi
}\fi
}\fi
}
% Emits a single measure.
% Usage: \measure{notes}
% Where: notes is a sequence of \beat{?} or \rest{?}
\def\measure#1{\Notes #1\en\bar}
\def\measuree#1{\Notes #1\en}
% Null clef.
\def\nullclef{\raise2\internote\hbox{\keychar77}}
% Emits a single-line staff rhythmic example with one or
% more measures.
% Usage: \rhythm{num}{den}{measures}
% Where: num, den are the meter.
% measures is one or more \measure{notes}
\def\rhythm#1#2#3{\begin{music}
\nobarnumbers
\instrumentnumber{1}
\generalmeter{\meterfrac{#1}{#2}}
\setstaffs1{1}
\setclefsymbol1{\nullclef}
\setlines1{1}
\sepbarrules
\startextract
#3%
\endextract
\end{music}}
\begin{document}
\title{Rhythmic Whatnot}
\maketitle
\begin{abstract}
Stuff about rhythmic structure with machine learning.
\end{abstract}
\section{Introduction}
Waffle on forever. For example, with $n = 4$ and $\left\{2, 1, 1\right\}$, then:
\rhythm{2}{4}{%
\measure{\beat{4}\beat{8}\beat{8}}
\measure{\beat{8}\beat{4}\beat{8}}
\measuree{\beat{8}\beat{8}\beat{4}}%
}
Therefore, it is obvious.
\end{document}

The technical details: Reading helps, as in the 1.28 changelog is written
% version 1.28
% defined
% \z[left|right|leftright]repeat, for use within a bar
% \zz...repeat, to force to the end of a system
% corrected definition of \C@Inter for \nblines < 4
If one looks up the definition
\def\C@Inter{% RDT: corrected to work if \nblines > 6 (version 1.23)
in line 1831 (v1.27) or in line 1838 (v1.28), one finds the following diff
< \ifnum\nblines=\thr@@
---
> \ifnum\nblines<\f@ur
Hence I consider this a bug and one should update, but as a workaround, my presented solution seems to work.
Original answer
Not sure why @egreg seems to get the desired (?) result already, but I found a fix for MusiXTeX(c) 1.27 <2017-12-26>:
\documentclass{article}
\usepackage{amsmath}
\usepackage{musixtex}
\usepackage{graphicx}
% Emits a pitchless duration (stems up). Hides the ugliness of musixtex.
% Usage: \beat{duration}
% Where: duration in [1, 2, 4, 8, 16, 32, 64].
\def\beat#1{
\ifnum#1=1
{\wh{i}} % whole
\else{
\ifnum#1=2
{\hu{i}} % half
\else{
\ifnum#1=4
{\qu{i}} % quarter
\else{
\ifnum#1=8
{\cu{i}} % eighth
\else{
\ifnum#1=16
{\ccu{i}} % sixteenth
\else{
\ifnum#1=32
{\cccu{i}} % thirty-second
\else{{\ccccu{i}}}\fi % sixty-fourth
}\fi
}\fi
}\fi
}\fi
}\fi
}
% Emits a single measure.
% Usage: \measure{notes}
% Where: notes is a sequence of \beat{?} or \rest{?}
\def\measure#1{\Notes #1\en\bar}
\def\measuree#1{\Notes #1\en} % <-- added
% Null clef.
\def\nullclef{\raise2\internote\hbox{\keychar77}}
% Emits a single-line staff rhythmic example with one or
% more measures.
% Usage: \rhythm{num}{den}{measures}
% Where: num, den are the meter.
% measures is one or more \measure{notes}
\def\rhythm#1#2#3{\begin{music}
\nobarnumbers
\instrumentnumber{1}
\generalmeter{\meterfrac{#1}{#2}}
\setstaffs1{1}
\setclefsymbol1{\nullclef}
\setlines1{1}
\sepbarrules
\startextract\setlines1{5}% <-- added
#3%
\endextract
\end{music}}
\begin{document}
\title{Rhythmic Whatnot}
\maketitle
\begin{abstract}
Stuff about rhythmic structure with machine learning.
\end{abstract}
\section{Introduction}
Waffle on forever. For example, with $n = 4$ and $\left\{2, 1, 1\right\}$, then:
\rhythm{2}{4}{%
\measure{\beat{4}\beat{8}\beat{8}}
\measure{\beat{8}\beat{4}\beat{8}}
\measuree{\beat{8}\beat{8}\beat{4}}% <-- changed
}
Therefore, it is obvious.
\end{document}

It seems that \bar creates the bar depending on the height of the lines. If you change that after \startextract, you're able to modify the bars without affecting the printed lines. Not sure if this is a feature though.
I also created a new macro \measuree for "measure end" without a bar to remove the double bar at the end.
\barwhich I presume was redefined bymusictexis not working as you are expecting it to. – Steven B. Segletes Jul 27 '18 at 20:25\breve, perhaps), but certainly not with\barwhich is redefined in amusicenvironment. I'm usingMusiXTeX(c) 1.28 <2018-05-07>. On the other hand, the problem is reproducible withMusiXTeX(c) 1.27 <2017-12-26>– egreg Jul 27 '18 at 20:44generic/musixtex.tex. With a quick look at the diff, I sadly cannot see the reason what is causing the different\barbehavior. – nox Jul 27 '18 at 21:26amsmath. – egreg Jul 28 '18 at 05:19