rline is a sndkit algorithm, implemented as a literate program. A more up-to-date version can be found on the sndkit website here.
rline
literate program
sndkit