soundon ;; build the harmony argument for four frequencies to fourpart :basefreq local [a] make "a [] make "a fput list basefreq [[.9 50] [0 450]] a make "a fput list basefreq*2 [[.9 50] [0 450]] a make "a fput list basefreq*0.5 [[.9 50] [0 450]] a make "a fput list basefreq*3/2 [[.9 50] [0 450]] a output a end ;; here's a mapping function of the sort found in many functional ;; languages. an anonymous function is applied to list element by ;; element. to mapping :f.template :template.list ifelse (empty? :template.list) [ output [] ] [ output (fput (apply :f.template (list (first :template.list))) ~ (mapping :f.template (butfirst template.list))) ] end ;; here's a modified map function. the anonymous function is again ;; applied to each element in the list. however, nothing is returned ;; since the output of anonymous function has been sent to the sound ;; card. to sing :f.template :template.list ifelse (empty? :template.list) [ ] ~ [ apply :f.template (list (first :template.list)) sing :f.template (butfirst template.list) ] end ;; define a list of frequencies make "notes [440 494 554 587 659 739 830 880] ;; now put it altoghter sing [harmony fourpart ?] notes