%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %% Example: all-interval series, series represented by %% sequence of notes. local fun {AllDistanceSeries L} proc {$ MyScore} L1 = L-1 Pitches Intervals in MyScore = {Score.makeScore seq(items: {LUtils.collectN L fun {$} note(duration: 4 offsetTime: 0 %% timeUnit is 16th notes timeUnit:beats(4) pitch: {FD.int 60#60+L1} amplitude: 80) end} startTime: 0 offsetTime:0) unit} %% explicit param units (for output): all timing param units are %% unified with each other. Pitches = {MyScore map($ getPitch test:isNote)} Intervals = {FD.list L1 1#L1} for Pitch1 in {List.take Pitches L1} % butlast of Pitches Pitch2 in Pitches.2 % tail of Pitches Interval in Intervals do {FD.distance Pitch1 Pitch2 '=:' Interval} end {FD.distinctB Pitches} % no pitch class repetition {FD.distinctB Intervals} % no (abs) interval repetition %% Specify search strategy %{FD.distribute ff Pitches} {FD.distribute generic(order:size % value:fun {$ D} % DL = {FD.reflect.domList D} % N = {GUtils.random {Length DL}-1}+1 % in % {Nth DL N} % end value:mid ) Pitches} end end in {Explorer.one {AllDistanceSeries 4}} end