Description:
Generates a rhythm in the form of a list of durations. Operates by repeatedly
selecting a duration or duration-pattern at random from POOL and appending it
to the result until a total duration of at least TOT-TIME is reached. Random
selections are made according to a Markov process of low order specified in
PTABLE. The context at the beginning of the process is determined by INIT-CONDS.
The first output is the resulting rhythm. The second output parses the resulting
rhythm into its constituent patterns. The third output reports the context at
the end of the process.
POOL is a length-M list of durations and duration-patterns; duration-patterns
are lists of durations. A duration is encoded as a positive number if it is a
note and a negative number if it is a rest. POOL can also have a special format
to allow bpf-driven interpolation between two contrasting length-M lists; see
'INTERPOLATION' below.
PTABLE is a flat or nested list:
- If the Markov process is of order 0, PTABLE is a length-M list specifying the
fixed probability of each item in the POOL.
- If the Markov process is of order 1, PTABLE is a length-M list of length-M
lists representing an M x M probability table.
- If the Markov process is of order greater than 1, PTABLE is a more deeply
nested list representing an M x M x ... x M probability table.
- PTABLE can also have a special format to allow bpf-driven interpolation
between two contrasting tables; see 'INTERPOLATION' below.
INTERPOLATION
POOL and PTABLE can be structured in the form (BPF START MIN MAX), where BPF
is an OpenMusic breakpoint function, START indicates what x-value of the BPF
corresponds to the start time of the resulting rhythm, MIN is the POOL or
PTABLE to use when BPF is at its minimum value, and MAX is the POOL or PTABLE
to use when BPF is at its maximum value. When BPF is at other values between
its minimum and maximum, the effective POOL or PTABLE is determined by
interpolation between MIN and MAX.
PATTERN BOUNDARIES
- If PATTERN-BOUNDARY-MODE is set to 'NOTE then the pattern (A B C) will lead
to the number |A| + |B| + |C| as an element of the second output.
- If the setting is 'NOTE+RESTS then the pattern (A B C) will lead instead to
the list of three numbers (|A| -|B| -|C|) as an element of the second output.
TARGET-BASED WEIGHTING
The optional TARGET-POINTS and TARGET-HIT-WEIGHT parameters provide (limited)
control over coincidences between the resulting rhythm and a predefined set of
timepoints. TARGET-POINTS specifies these timepoints; it is a list in which
each sublist is either a list of timepoints or a special list of the form
(:PERIODIC period begin end). At each step, M-RHYTHM tests every duration and
duration-pattern in POOL; each time it finds an element whose endpoint would
coincide with a timepoint in TARGET-POINTS, it multiplies the probability of
that element by TARGET-HIT-WEIGHT. Thus a TARGET-HIT-WEIGHT value greater than
1 favors coincidences with TARGET-POINTS, a value less than 1 disfavors them.
Normally, points must be exactly aligned to account as a coincidence, but if
the optional parameter TARGET-DISTANCE is set to a value above its default of
0, then points within this distance of one another count as coincidences.
|