Overview
Looking to emulate the following sinusoidal wave having random variations in both its filled and outline thickness:

The wave has two parts: a variably thick filling and a variably thick outline. The MetaPost function function allows creating paths from function calls, such as sin. The initial curve can be created using something like:
path wave;
wave := curved function( 1, "sin(x)", "x", 1, 10, 1 ) xyscaled( 1cm, 1cm );
This produces a fairly close result:

Problem
I have tried to make a variably thick pen:
pen variably_thick;
variably_thick := pencircle yscaled uniformdeviate( 1mm ) rotated 10;
Yet that sets the initial pen thickness -- there are no callbacks to increase or decrease the pen's thickness as the path is drawn.
Code
A working example:
\setupcolors[state=start]
\definecolor[BaseColour][h=66CEF1]
% Randomize the seed without having to delete the tuc file.
\ctxlua{math.randomseed( os.time() )}
% Draws three waves, somewhat evenly spaced, with two inflection points
% per line.
\startuseMPgraphic{page:ThemeElementWave}
color base_colour;
base_colour := \MPcolor{BaseColour};
% The wavy shape used for creating the wave and its border.
path wave;
% The wave "path"
path underwave;
% The wave "fill"
path overwave;
% Create the base path
wave := curved function( 1, "sin(x)", "x", 1, 10, 1 ) xyscaled( 1cm, 1cm );
% Draw the "path" for the wave (the outside edges)
underwave := wave rotated 90 xscaled 5 yscaled .45;
draw underwave withpen pencircle scaled 1.25cm withcolor (.7[base_colour,white]);
% "Fill" the wave.
overwave := wave rotated 90 xscaled 5 yscaled .5;
draw overwave withpen pencircle scaled 1cm withcolor base_colour;
\stopuseMPgraphic
\defineoverlay[page:ThemeElementWave][\uniqueMPgraphic{page:ThemeElementWave}]
\starttext
\setupbackgrounds[page][background={page:ThemeElementWave}]
\startchapter
\input knuth
\stopchapter
\stoptext
Question
How would you create a curve in MetaPost that produces a variably thick line?
Ideas
From the MetaPost examples:
path p;
p =
(0,u)
for i=.1 step .1 until 10:
hide( pair A; A = (i*u, (sind (i*180/3.14))/i *u);
draw A withpen pencircle scaled 2pt )
.. A
endfor;
draw p;
It should be possible to use the code above (i.e., loop over a sine wave) to draw the curve while varying the pen's thickness throughout the loop, but I was hoping there was cleaner solution.

