Code: Select all
(do* (i 500 (setq i (500 + i))) ; DO* loop with var I
((eql i 2500) (stretch-abs 200.0 (hzosc 2500))) ; test and result
(stretch-abs 200.0 (hzosc i)) (const 0.0 [120])) Code: Select all
(do* (i 500 (setq i (500 + i))) ; DO* loop with var I
((eql i 2500) (stretch-abs 200.0 (hzosc 2500))) ; test and result
(stretch-abs 200.0 (hzosc i)) (const 0.0 [120])) You don't need 'setq' in the above line, but you do need annother '(' at the start of the bindings. http://www.audacity-forum.de/download/e ... ef-094.htmsmosco wrote:Code: Select all
(do* (i 500 (setq i (500 + i))) ; DO* loop with var I
Code: Select all
(do* ((i 500 (+ 500 i))) You can use "=" heresmosco wrote:Code: Select all
((eql i 2500) (stretch-abs 200.0 (hzosc 2500))) ; test and result
Code: Select all
((= i 2500) (stretch-abs 200.0 (hzosc 2500)))What are the square brackets? They are not legal.smosco wrote:Code: Select all
(stretch-abs 200.0 (hzosc i)) (const 0.0 [120]))
Code: Select all
(const 0 3)Code: Select all
(abs-env (const 0 3))Code: Select all
(s-rest 3)smosco wrote:Code: Select all
(stretch-abs 200.0 (hzosc i)) (const 0.0 [120]))
Code: Select all
(do* ((I 500 (+ 500 i)))Code: Select all
(setf snd (seq snd (seq (hzosc ...) (s-rest 3))))Thanks Robert, a typo on my part. I've corrected my previous post.Robert J. H. wrote:Hi Steve, a little correction, the step increase has to be:
Not necessary if it is a "generate" type plug-in.Robert J. H. wrote:And of course all embedded in abs-env to make the sound independent from the selection.
I assumed the nyquist prompt when I was referring to the abs-env since the effect has no plug-in header yet.steve wrote:Thanks Robert, a typo on my part. I've corrected my previous post.Robert J. H. wrote:Hi Steve, a little correction, the step increase has to be:
Not necessary if it is a "generate" type plug-in.Robert J. H. wrote:And of course all embedded in abs-env to make the sound independent from the selection.
"process" plug-ins automatically stretch the environment according the the selection length, but "generate" plug-ins don't. (This is one of the main reasons why I would like Audacity to have a "Nyquist Generate Prompt" effect built in, in addition to the "Nyquist Prompt" effect.)
Yes there is (and updated by myself), but it is implemented as a Nyquist plug-in, with all the limitations that that entails.Robert J. H. wrote:Am I mistaken or isn't there a Nyquist Generate Prompt already posted by Edgar?
Thanks! I don't believe how much I misread that..steve wrote:What are the square brackets? They are not legal.smosco wrote:Code: Select all
(stretch-abs 200.0 (hzosc i)) (const 0.0 [120]))
In the manual http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index329
the notation: (const value [duration]) means that duration is an optional argument. You don't use the square brackets.
For example, if you want to generate 3 seconds of silence (in a "generate" plug-in)or in a "process" effect it could be:Code: Select all
(const 0 3)but note that this is generated at the control rate *control-srate*Code: Select all
(abs-env (const 0 3))
Rather than using const to generate silence, you can use s-restCode: Select all
(s-rest 3)
I'm trying to generate 200 s of a monotone at frequency i (which varies) followed by 120 s of silence and then monotone at a new frequency again.steve wrote:
My question is, what exactly are you trying to do in this line:smosco wrote:Code: Select all
(stretch-abs 200.0 (hzosc i)) (const 0.0 [120]))
You were not far offsmosco wrote:I don't believe how much I misread that..
Code: Select all
(abs-env ; required if used in the 'Nyquist Prompt' effect.
(let ((result 0)) ; You cannot sum to NIL
(do* ((hz 500 (+ 500 hz))
(start 0 (+ 400 start)))
((= hz 2500) result) ; stop at 2500 and return 'result'
(setf result
(sum result
; OSC provides a 'duration' argument.
(at start (osc (hz-to-step hz) 200)))))))
Code: Select all
(abs-env ; required if used in the 'Nyquist Prompt' effect.
(let ((result 0)) ; You cannot sum to NIL
(do* ((hz 500 (+ 500 hz))
(start 0 (+ 400 start)))
((= hz 2500) result) ; stop at 2500 and return 'result'
(setf result
(sum result
; OSC provides a 'duration' argument.
(at start (osc (hz-to-step hz) 200))
(at start (s-rest 400)))))))
Code: Select all
(setq initial-hz 500)
(setq final-hz 2500)
; number of times to repeat must be an integer
(setq repeats (truncate (/ limit-hz final-hz)))
(abs-env
(seqrep (i repeats) (sim (s-rest 400)
(osc (hz-to-step (* (1+ i) 500)) 200))))