Randomization and probability (MayBe, RandomiZe)

What it is#

Letting the tracker decide: notes that play only sometimes, table hops that happen with a probability, and command values with a random offset. Cheap variation for hi-hats, fills and long loops — every pass sounds slightly different, which fights the "unchanging repetition" problem (arrangement).

How to do it#

LSDj#

  • Bxy MayBe in a phrase: probability that the note (or kit sample) to its left plays — first digit for the left kit, second for notes and the right kit. B00 never, B0F always, B08 about half the time.
  • Bxy in a table: a hop to row y that only happens with probability x (BF5 15 times out of 16, B84 about 50 %) — a table that sometimes takes a different path.
  • Zxy RandomiZe: repeats the last command that is not Z or H, adding a random 0..x to its first digit and 0..y to its second (Z02 adds 0, 1 or 2; Z22 any of 0,1,2,10,11,12,20,21,22). Put it after a V, P, E or F command for humanised vibrato, pitch, volume or sample offset.

(source: s-lsdj-manual)

  • Worked Z examples from hypnogram's 2016 post as rewritten by defense-mechanism for intense-tech (source: s-intense-tech-03-dont-sleep-on-z): random vibratoV00 on the note, Z03 on every repeat of the note, each acting as V00V03; random dutyW values count 00 = 12.5 %, 01 = 25 %, 02 = 50 %, 03 = 75 %, and Z02 beats Z03 because 25 % and 75 % "effectively sound identical"; random panningO values count OLR = 00, O__ = 01, OL_ = 02, O_R = 03, so OL_ followed by Z02 chooses among left, right and both while a start from OLR would include the mute; for these four-valued commands an added value wraps to the remainder after dividing by 4 (Z11 = 17 acts as 01); since version 6 Z also works in tables, and alternating OLR/O__ in an Automate table gives a random gate; random melodyFxy's first digit is PU2's transpose in semitones, so ZF0 after an F re-pitches pulse 2 anywhere up to an octave plus a major third above the note; random chordsC37 with Z10 yields minor or major, possible since version 6 made the digits independent (in version 4 they were not); random sweep — Hypnogram's signature lead (Phantasm Dragon, at 1:30) randomises a sweep, which only pulse 1 can do. A Z never randomises another Z.
  • Version notes: B arrived with version 7 (toured at 7.7.4 in January 2020) with the values B05 never hops, B85 about half the time, BF5 about 15 times in 16, and on notes B04 25 %, B08 50 %; on kit instruments the digits are the left and right samples separately — B48 = left 25 %, right 50 % (source: s-intense-tech-12-scoping-out-new-features). Since version 8 Z works with every command except H (and Z), which makes randomised straight-or-swung grooves possible (source: s-intense-tech-14-lets-appreciate-version-8). Contradiction: the version-6 manual said Z does not work with Hop, Groove and Delay; article 03's later footnote claims it does "as of version 8.1.9" including Hop, while article 14 and the 9.2.6 manual (s-lsdj-manual, above) exclude H (sources: s-intense-tech-03-dont-sleep-on-z, s-intense-tech-14-lets-appreciate-version-8).
  • Z on noise shapes for random crash cymbals (a trick defense-mechanism credits to an Exploring Chip Tunes video): because Z randomises each digit independently, the variation can be confined to one loop mode and octave — first digit +0…4 at most so it never wraps past F to 0 (silence), some rows with a first digit of 0, second digit F for a completely random divisor (source: s-intense-tech-17-the-joys-of-noise). "Probability sequencing" is one of the features johan-kotlinski lists for the stable LSDj 8 (source: s-intense-tech-13-kotlinski-interview).

Impulse Tracker#

Instruments have volume swing and panning swing — a random variation applied to every note. Zinc uses a small volume swing on hi-hats ("even if you've already changed your hi hat volumes to go 64-24-32-20") and panning swing for barely noticeable movement (source: s-tw075-it-percussion-tips); Pinion turns volume swing up to 100 % on a channel full of scale notes with NNA note-fade and "lets the laws of chaos do the composing" — a novelty, but a real generative tool (source: s-tw081-it-tip-of-the-week).

More IT randomness: the instrument's random volume variation is the volume swing Zinc and Pinion use, but the format doc marks random panning variation "not implemented yet" (so panning swing may not have worked in the versions of the time); S33/S43/S53 set the vibrato/tremolo/panbrello waveform to random — with random panbrello the speed digit becomes a delay in frames between new positions (Y14 fast, Y44 slower) (sources: s-ittech, s-it-manual).

In openmpt the instrument's Random Variation section has volume swing and pan swing (a random percentage of the global volume, a random pan offset) for every format with instruments, and MPTM adds cutoff swing and resonance swing on the resonant filter; the IT-compatible rule is that volume variation is a percentage of the instrument's global volume, not of the note volume (sources: s-openmpt-manual-instruments, s-openmpt-manual-compatible-playback). The random LFO waveform (S33/S43/S53 in IT, E43/E73 in MOD/XM) "is not supported by ProTracker and FastTracker" and should be avoided in those formats (source: s-openmpt-manual-effect-reference).

The SID's noise generator as a random source#

The sid has no probability commands, but it has a hardware random source: voice 3's noise waveform can be read back from register $1B. asger-alstrup's 1995 measurements show what it is — a 23-bit shift register (feedback bit 22 XOR bit 17; output bits 22, 20, 16, 13, 11, 7, 4, 2), shifted every 2^20 ÷ Fn cycles and restarted from $7FFFF8 by the test bit; every 8-bit value comes up equally often, but the stream repeats after about 8 million values and is identical after every reset. His rules for using it in a game or a generative player: reset it only once (at load), start reading after a key or fire press so the offset is unpredictable, read no faster than the shift rate (every 32 cycles at Fn = $8000), or precompute a table of $2000 values so that voice 3 stays free for music (source: s-sidmusic-alstrup-waveform-examinations). The datasheet's own suggestion is the musical version — OSC 3 noise added to the cutoff as "sample and hold" (filter-programming).

Other trackers#

(unverified) SID-Wizard has no probability or swing commands; fake variation with alternating patterns in the orderlist.

Oscillator 3 as a random source in a 1988 driver#

The modules driver (Ivan Del Duca) has a pattern command $95 src dst that copies SID register $D4src into $D4dst every tick — Tognon: "for copying the oscilator 3 value to one other register for putting a random value in it"; pat34 uses $95,$1B,$0F to feed oscillator 3's output ($D41B) into voice 3's own frequency high byte, and pat36 $95,$1C,$16 to run envelope 3 into the filter cutoff (source: s-sidin07-inside-modules; filter-programming).

  • A 1987 game did exactly this: Martin Walker's hunters-moon effect engine has a per-effect "frequency effect 2" whose mode 4 adds $D41B AND $0F — voice 3's noise output — to the frequency high byte every frame, a pitch jitter no table could store (source: s-sidin14-hunters-moon).

Tips & pitfalls#

  • Probabilities on ghost notes (hi-hat 16ths, snare ghosts) give the most realism for the least risk.
  • Keep the downbeats certain; randomise the weak rows (rhythm-and-groove).
  • Size the Z digits to the command's value range: Z02 for duty and panning, Z10 for major/minor, ZF0 for a PU2 melody (source: s-intense-tech-03-dont-sleep-on-z).

rhythm-and-groove · instrument-tables · arrangement · sid · ring-modulation-and-sync

Sources#

s-lsdj-manual · s-intense-tech-17-the-joys-of-noise · s-intense-tech-13-kotlinski-interview · s-openmpt-manual-instruments · s-openmpt-manual-compatible-playback · s-openmpt-manual-effect-reference · s-intense-tech-03-dont-sleep-on-z · s-intense-tech-12-scoping-out-new-features · s-intense-tech-14-lets-appreciate-version-8 · s-sidmusic-alstrup-waveform-examinations · s-sidin07-inside-modules · s-sidin14-hunters-moon · s-tw075-it-percussion-tips · s-tw081-it-tip-of-the-week · s-ittech · s-it-manual

source file wiki/techniques/randomization-and-probability.md · 1 unverified · graph