Question about time and Nyquist

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about time and Nyquist

David R. Sky
Roger,

I'm still a bit confused about moving chunks of audio - is it true that I
cannot move a chunk of audio (which is, say, between 3.0 and 4.0
sedconds) anywhere before a chunk of audio (which is between 2.0 and 3.0
seconds)? I thought I understood your previous post on this matter, which
I interpreted meant that if I moved the chunk (between 3 and 4 seconds)
forward 1 second, then an earlier chunk (between 2 and 3 seconds) forward
by 3 seconds,, I could have a later part of audio be before an earlier
part.

If I remember correctly, you wrote that Nyquist "assumes" some things,
including time not running backward in this way - was this "assumption"
deliberately built into Nyquist, and if so why? There are possibilities
for some interesting effects plug-ins if this were not the case.

Thanks for any clarification,

David




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
rbd
Reply | Threaded
Open this post in threaded view
|

RE: Question about time and Nyquist

rbd
David,
        I wish I had a simple answer for you. The limitations are mainly
that when Nyquist is generating sounds, it works in chronological order.
Every expression has a default start time, and sometimes Nyquist delays
evaluating that expression until the start time to save on memory. When the
expression is evaluated, previous output may have already been written or
played, so if the sound actually starts prior to the start time, Nyquist
will have lost its opportunity to use those samples correctly. The simplest
case is mixing (adding) samples -- if Nyquist expects a sound to start at
time 10, it can output samples up to time 10 before evaluating the sound
expression. If the sound has a starting time of 9, then we're in trouble
because the samples from 9 to 10 have already been computed, written,
played, etc. One of the only ways to get time to go backwards is using
either AT with a negative shift amount or AT-ABS.
        In your case, I think you tried to build a sequence (SEQ) where the
second sound came earlier than the first sound. This is an example of a
non-causal expression that Nyquist cannot handle. So instead of, say,
creating a sequence of sounds starting at times 0 and -1, you can start the
sounds at times 1 and 0, and then reverse the order so that they start at
times 0 and 1. This will then be computable in time order.


If you want detailed information about what's going on, you can wrap sounds
in a print function like this one:

(defun debug-start-time (msg snd)
  (let (start)
    (setf start (snd-t0 snd))
    (format t "~A: start = ~A~%" msg start)
    Snd))


This takes two argument, a string and a sound. It prints the string followed
by the start time and returns the sound. In a sequence, you could write:

(seq (debug-start-time "my-sound-1" (my-sound-1))
     (debug-start-time "my-sound-2" (at -2 (my-sound-2))))

And you would get a printout something like:

My-sound-1: start = 0
My-sound-2: start = -1

(This is an example of something Nyquist can probably *not* compute
"correctly.")

-Roger






-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist