A cadence is a harmonization of one of the melodic cadences:

                (all of the above in minor or Major scales)

SI/RE - DO should be harmonized as V/V7/vii/vii7♭ - I/i with any fitting triad for LA/MI/MI♭. The fuller the harmony, the better the cadence. Components may be missing, e.g. I/i may be reduced to tonic only, V7 played without third or fifth – and the grade of the cadence reduced accordingly.
Such cadences may appear by chance in the counterpoint – they are not part of the design. However, if none is found, the program will fail, and restart with a different random seed.
The common melodic cadences DO SI DO and DO RE DO may also be there, although a single melodic dodecaphonic line should not contain them. In any case, I ignore DO SI DO and DO RE DO.

Notice that the cadence harmony is not influenced by the noise_ parameter (the overall harmony chosen). A cadence is always a tonal cadence.



(not the historical term)

A hocket is the replacement of a long note by several shorter notes and rests. It may appear as a pure stylistic choice, or because the instrument chosen has no sostenuto (drums, pizzicato, even piano). It also may present the note in different octaves, e.g. :

The hocket is created by considering the three values in the parameter hocket_lo,mid,hi, the duration of the note (in 16th) and the instrument that plays the note:

very long duration, any instrument:
duration > hi

even short duration, if the instrument lacks sostenuto:
duration > lo

with probability 30% for rather long piano notes:
duration > mid

Remember, the defaults for lo,mid,hi are 10,15,20