MIDI Input Histogram Capture / Random Play

This module allows random playback of up to 12 tones, with probability set by sampling midi hits and arranging them into 12 bins corresponding the the 12 tones in the chromatic scale. The octave for each note is maintained for playback to allow chord extensions beyond the 7th or below the root.

Demo image:

The module samples note values, clocked in by pulses at the “sample^” input—presumably signals from a MIDI keyboard—and organizes the samples into bins. A histogram is produced, the value in each bin being the count of hits for that tone. To facilitate playback over a multi-octave range, each bin also contains the octave of the last addition to that bin.

A “key” input (log f/A440 format) allows one to determine which bin shall carry hits at the tonic of a particular key (or equivalently, the root note of a chord).

A “Rec” button (with indicator light) allows the user to stop sampling and play at will. Red: sampling.

A “Reset” input performs a histogram reset if pulsed, resetting all counts and octave values to zero. Reset is inoperable unless the module is sampling (red light).

Playback is accomplished by creating a set of all bins whose probability value matches or exceeds a randomly set value (displayed by the bar display “P”). From this set a custom scale is produced (# output, integer format, with tonic=LSB.) Scale query functions are used grab info needed for playback, such as number of tones (output “N”) and the tone represented by each degree in that custom scale.

Play commences with a querying of the scale with an integer value between 1 and N at input “Q:Degree?,” which produces the corresponding output at “A:o!” (log f/A440) octave format.)

As each note is played back, its octave, which was captured in the sampling stage, is added back on and presented at output “A:o!”

A trigger at the “Roll!” input sets a new random value for P, generating a new scale for playback.

Note that if you arpeggiate by scale degree, as is done in the demo, you will hear all notes in scale order, with the flat ninth played immediately after the root, and so on. Presumably, in an application one could quickly sort the resulting tones by pitch to get a straight arpeggio, then clock those out for playback, but I’ve not tried it yet. Most of my work has used “process at play speed,” and I don’t know of an “Insta-sort plus wayback machine” algorithm I could use!

The module:
Random Tones by Histogram v12.07.18.2.audulus (377.1 KB)

Scale by Histogram polyoctave.audulus (673.8 KB)


Here’s an improved demo, with a button to latch in a new key, and with the red/green theme on the midi histo sampler (green means green light to soloing over a pattern. Red means we’re sampling the pattern).

Scale by Histogram polyoctave.audulus (677.1 KB)

I tried adding polyphonic soloing, but I obviously need to relook at that functionality in Audulus. Things were getting overloaded when I tried adding a midi keyboard in a poly mode to the soloing synth.

1 Like

This is awesome and wild as usual! Thanks for sharing @dcLargo! :slight_smile:

1 Like

Thanks! The gauntlet was kind of thrown with the marble thing. I just couldn’t leave it alone until I got the multi-octave part done.


We have an amazing user community! It’s really all the dedicated Audulus users that make this such an exciting product. It seems that no matter what area of musical synthesis you choose, someone is working on an Audulus patch. We all owe a debt to @Taylor for such a wonderful toolkit. I’m really looking forward to all the improvements in the pipeline.


I’ll say! Audulus is a lovely sandbox!


Audulus be praised!


Awesome! I’m happy this tool has it’s own thread. Thanks for posting this awesome module :slight_smile:

1 Like

I’m having fun playing with this thing! Here’s a two-voice demo, with all the messy counters grouped into neat little boxes. I was looking at effects, but these little synths are so awesome I settled on a little reverb instead.

Scale by Histogram polyoctave–2 voice.audulus (1.4 MB)


Exploring some possibilities. I added a clock divider for sampler #2 and tried clocking the playback on the 180 degree output. Gives a bit of a lilt to it. Alse added octave adjusters for each sampler output.

Scale by Histogram polyoctave–2 voice.audulus (1.5 MB)


Wow, I have no words.


I’m working on a version of this which sets a maximum count for any one bin and once that point is hit on a bin, subsequent hits on that bin instead toss hits from all other bins. This should make the sampler more responsive as you pile on hits. First hunch is that 25 hits should be the cutoff, giving a minimum change of like 4%.


This version of the module introduces a limit on bin size to maintain responsiveness as you play. Maximum bin size is set by applying an integer at binMax. Default is 100.

Random Tones by Histogram v12.12.18.1.audulus (425.3 KB)

When the count of hits in a bin reaches the value binMax, its count stops at binMax. If a bin sitting at that max number of hits receives another hit, the other bins are decreased by one, giving the bin just hit more prominence.

Here’s the demo:
Scale by Histogram polyoctave–2 voice.audulus (1.6 MB)

This demo used a minor mod to my tap tempo module, which sets the g output to zero initially, to avoid triggering playback before the tempo has established.

Don’s Tap Tempo v12.12.18.1.audulus (70.8 KB)