M-VARI-PULSE

[GENERIC-FUNCTION]


OMTimePack
Function Reference
ARGUMENTS:
  - pulse-map list of sublists, each of form (time-sig pulse-1 pulse-2 ...)  
  - ptable probability table (flat or nested list) controls random process  
  - empty-bars time signatures representing empty bars  
  - init-conds context for first few random choices  

Description:


Makes random selections from PULSE-MAP in order to fill EMPTY-BARS with
a pulse that varies according to the possibilities found in PULSE-MAP.
The result is structured as a list of durations. Random selections are
controlled by the probabilities in PTABLE.

There are several requirements for the input parameters:
- The PULSE-MAP must cover every time signature found in EMPTY-BARS.
(This is checked by an input-checking routine.)
- For each time signature covered in the PULSE-MAP, at least one pulse
must have an onset at the beginning of the bar.
(This is checked by an input-checking routine.)
- Each time a pulse in the PULSE-MAP includes a rest, at least one other
pulse in PULSE-MAP must include the onset of a note at the same point.
(This is NOT checked; the user is responsible for handling it.)
- Probabilities in PTABLE may be small but should never be zero.
(However, the user may specify zero probabilities and these will be
replaced internally with small non-zero values.)

At each step in the production of a result, a pulse is chosen at random
from the portion of PULSE-MAP matching the current time signature.
Durations are drawn from the chosen pulse until one of two conditions
is met: (1) a rest (as opposed to a note) occurs in the chosen pulse;
(2) a note in the current pulse coincides with a note in at least one
other pulse. Whenever either of these conditions is met, another pulse
is chosen at random, until all the EMPTY-BARS have been filled.

Random choices are controlled by PTABLE, but at each decision point
only pulses that include the onset of a note at the same point may be
chosen.

BPF-driven interpolation is possible on the PTABLE as in M-RHYTHM.

The first output is the resulting list of durations, and the second
reports the end context, which may serve as initial conditions for the
next in a cascaded series of M-VARI-PULSE functions.



Auto doc generation by OpenMusic 6.3 © 2010 IRCAM