;; sets.sal -- example using set operations
;;
;; (c) 2008 by Roger B. Dannenberg
begin
with s6-Z36 = {0 1 2 3 4 7},
s6-Z3 = {0 1 2 3 5 6},
s5-Z38 = {0 1 2 5 8},
s7-Z38 = {0 1 2 4 5 7 8},
common-set1 = make-heap(
intersection(s6-Z36, s6-Z3)),
common-set2 = make-heap(
intersection(s5-Z38, s7-Z38)),
inclusive-set1 = make-cycle(
union(s6-Z36, s6-Z3)),
inclusive-set2 = make-cycle(
union(s5-Z38, s7-Z38))
exec score-gen(save: quote(sets-example),
score-len: 15,
pitch: next(common-set1) + 60,
vel: 10 + next(inclusive-set1) * 10,
ioi: max(next(common-set2) * 0.5, 0.05),
dur: max(next(inclusive-set2) * 0.5, 0.05))
end
exec score-play(sets-example)