Introduction to the Mellite computer music environment. Part 13: Stream - streams are "expanded" patterns that persist their internal state. And towards the end, showing the new Oscilloscope view.
This is based on Mellite v2.47.1. See https://www.sciss.de/mellite/ for details.
Try the following more interesting patterns: Brown(60, 108, 2).sliding(4).flatMap(a => a.distinct)
or (ArithmSeq(0, 1) % 12 + 72).grouped(12).flatMap(a => a.shuffle)
.
The first takes the brownian walk and creates a sliding window of four elements (advancing always one element after each window), where the windows are then filtered to contain no duplicates ("distinct" values). For example, if the brownian would produce [100, 99, 100, 99, 98, 99, 97, 95, 96, 97]
, then the sliding(4) transforms it into [[100, 99, 100, 99], [99, 100, 99, 98], [100, 99, 98, 99], [99, 98, 99, 97], [98, 99, 97, 95], [99, 97, 95, 96], [97, 95, 96, 97]]
, and the flatMap which is short for map.flatten filters the groups of four elements to contain no duplicates, so [[100, 99], [99, 100, 98], [100, 99, 98], [99, 98, 97], [98, 99, 97, 95], [99, 97, 95, 96], [97, 95, 96]]
or flattened [100, 99, 99, 100, 98, 100, 99, 98, 99, 98, 97, 98, 99, 97, 95, 99, 97, 95, 96, 97, 95, 96]
.
The second produces the wrapped counter 0, 1, 2, ... 11, 0, 1, 2, etc., adds 72 to go into the range of 72 until 84, then randomly shuffles the positions within each group of twelve elements, effectively giving you an "urn" of the twelve pitches of an octave, but always in random order.