Nyquist Humour

Using Nyquist scripts in Audacity.
Post and download new plug-ins.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Nyquist Humour

Permanent link to this post Posted by dondiego929 » Tue May 18, 2010 9:26 pm

<<deleted by user>>
Last edited by dondiego929 on Mon Sep 13, 2010 2:18 am, edited 1 time in total.
dondiego929
 
Posts: 54
Joined: Mon May 17, 2010 4:40 am
Operating System: Please select

Re: Nyquist Humour

Permanent link to this post Posted by steve » Tue May 18, 2010 10:26 pm

Congratulations :)

To be strictly correct, you have one more ")" at the end than there should be. If you use the "Debug" button it should show you an error message to that effect.

Another way to do the same thing is:
Code: Select all
(list (list 2.0 "test"))


If you're using Audacity 1.3.x, try this:
Code: Select all
(list (list 1 8 ":=)"))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45640
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Nyquist Humour

Permanent link to this post Posted by dondiego929 » Sat May 22, 2010 10:31 pm

<<deleted by user>>
Last edited by dondiego929 on Mon Sep 13, 2010 2:18 am, edited 1 time in total.
dondiego929
 
Posts: 54
Joined: Mon May 17, 2010 4:40 am
Operating System: Please select

Re: Nyquist Humour

Permanent link to this post Posted by steve » Sat May 22, 2010 11:10 pm

That's a fun effect, but you may not have noticed that the (stretch-abs 1 x) at the end doesn't actually do anything.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45640
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Nyquist Humour

Permanent link to this post Posted by dondiego929 » Sun May 23, 2010 1:53 am

<<deleted by user>>
Last edited by dondiego929 on Mon Sep 13, 2010 2:19 am, edited 1 time in total.
dondiego929
 
Posts: 54
Joined: Mon May 17, 2010 4:40 am
Operating System: Please select

Re: Nyquist Humour

Permanent link to this post Posted by steve » Sun May 23, 2010 11:08 am

As I said - in your code (stretch-abs 1 x) does not do anything.

If you remove (stretch-abs ....) from the "regular" and "defun" code, they produce the same result as the "TerminatorX" code.

To make your "setq"/"TerminatorX" code the same as the other two, the sum/sim code needs to be inside the (stretch-abs 1 ...) function.

Laying out your code to make it a bit more readable:
Code: Select all
(setq x
      (sum s
            (at 0.5 (sum (cue s)
                     (at 0.5 (sum (cue s)
                              (at 0.5 (sum (cue s)
                                       (at 0.5 (sum (cue s)
                                                (at 0.5 (cue s))
                                       ))
                              ))
                     ))
            ))
      )
)


"x" is your new sound.
If the length of the original sound "s" is L, then the length of "x" is
L + (L/2) + (L/2) + (L/2) + (L/2) + (L/2) = 3.5(L)

(stretch-abs 1 ...) does not stretch the sound to 1 second, it maps each unit of logical time maps to 1 unit of real time.

probably easier to see with (stretch-abs 2 ...)
(stretch-abs 2 ...) does not stretch the sound to 2 seconds, it maps each unit of logical time maps to 2 unit of real time.

As it says in the manual:
(stretch-abs factor beh)
Evaluates beh with *warp* set to a linear time transformation where each unit of logical time maps to factor units of real time. The effect is to stretch the nominal behavior of beh (under the default global environment) by factor.

http://www.audacity-forum.de/download/e ... l#index410

So in your code, the logical time is 3.5(L), and mapping each unit of logical time to one unit of real time will produce a length of 3.5(L). You will see no change.
Also, (stretch ...) and (stretch-abs ...) should be applied to behaviours and not sounds, so strictly (though in this case it doesn't make any difference) I think your code should be (stretch-abs 1 (cue x)).

If we take the examples that use "defun",
(stretch-abs ...) is applied to the function, which means that each "0.5" in the (at 0.5 ...) functions get mapped to 0.5 seconds.

Taking your code, but modified to (stretch-abs 1 (your_code))
then again, each "0.5" will be 0.5 seconds, so the final length will be:
L + 0.5 + 0.5 + 0.5 + 0.5 + 0.5 = L + 2.5

Code: Select all
(stretch-abs 1
      (sum s
            (at 0.5 (sum (cue s)
                     (at 0.5 (sum (cue s)
                              (at 0.5 (sum (cue s)
                                       (at 0.5 (sum (cue s)
                                                (at 0.5 (cue s))
                                       ))
                              ))
                     ))
            ))
      )
)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45640
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Nyquist Humour

Permanent link to this post Posted by dondiego929 » Fri Jun 04, 2010 12:47 pm

<<deleted by user>>
Last edited by dondiego929 on Mon Sep 13, 2010 2:19 am, edited 1 time in total.
dondiego929
 
Posts: 54
Joined: Mon May 17, 2010 4:40 am
Operating System: Please select

Re: Nyquist Humour

Permanent link to this post Posted by steve » Sat Jun 05, 2010 7:40 pm

dondiego929 wrote:so I guess that must mean that it is pretty long

No, quite the reverse. It means that the internal structure is very short/simple, just one sound.


From the manual:
(snd-print-tree sound)
Prints an ascii representation of the internal data structures representing a sound.

http://www.audacity-forum.de/download/e ... l#index172

Try running this:
Code: Select all
(setq mysound
  (mult 0.4
    (sim
      (osc 60)
      (osc 40)
)))

(SND-PRINT-TREE mysound)


The debug output will indicate the two sound sources that make up "mysound"
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45640
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu


Return to Nyquist



Who is online

Users browsing this forum: No registered users and 1 guest