Re: [Audacity-nyquist] Re: selection for analyzer plugs
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Domonkos N. <na...@ya...> - 2004-11-24 11:33:02
|
Roger, I agree with Dominic's solution that sounds start at zero, it is clear design, the problem is however when you zoom in to the selection to a level where you can see individual samples then although nyquist gets 0.0 as the start of the sound, however when this 0.0 is returned from nyquist for the label track this 0.0 refers to the start of the selection, which is in between the first selected sample and the first "unselected one". an ascii drawing for digest receivers (David, apologies, it probably won't work with a screen reader): asterices are the samples, '+' indicates selection boundaries): 1 * * * * * ----+-----------------------+------ ^2 ^ selection start selection end Nyquist gets the first sample (marked with 1) at 0.0. However if you return a list of (time, label) pairs for the label track, 0.0 will be shown at selection start (marked with 2). It can be confirmed with the following nyquist plug (zoom in enough to see individual samples and select just a few of them): ;nyquist plug-in ;version 1 ;type analyze ;name "Mark individual samples" ;control debug "debug" int "%" 0 0 0 ;author "Domonkos Nagy <na...@ya...>" (setf s1 (if (arrayp s) (snd-add (aref s 0) (aref s 1)) s)) (setf sample-rate (snd-srate s1)) (setf time-increment (/ 1 sample-rate)) (do ((c 0.0) (l NIL) (curr (snd-fetch s1))) ((not curr) (print l) l) (setq l (cons (list c "S") l)) (setq c (+ c time-increment)) (setq curr (snd-fetch s1))) I hope this make sense now. I think a good solution would be to start selection on the first sample itself which would fix this problem and would be consistent with "select-all" too. BTW is Dominic (or one of the main developers) following this list at all? best, Domonkos On Tue, Nov 23, 2004 at 01:58:02PM -0500, Roger B. Dannenberg wrote: > I get the digested version of this list, and the images and sounds Domonkos > included arrived here as hex rather than attachments I could easily view. > Anyway, I gather the problem is that the plug-in does not get information > about the location of the selection. > > I'm not sure what is the best solution. Nyquist sounds are more than just > samples; they contain a scale factor, a start time, a logical stop time (the > start time of the next element in a sequence), and a physical stop time > (after this point, all samples are zero). It would make sense for Audacity > to pass the selection to Nyquist with a start time that reflects the offset > from the beginning of the file. It would also make sense to set up the > Nyquist environment to indicate the start time of the selection (see the > AT-ABS behavior). I think Dominic and I talked about these possibilities > long ago and Dominic wanted to keep things simpler by just having sounds > start at time zero. I'll be the first to admit that while Nyquist does a > pretty good job of doing the "right thing" with all these time offsets and > transformations, it can be very confusing and counterintuitive. Since people > usually test Nyquist code without time offsets, it's easy to create bugs > that don't show up until you test it under a time transformation. A lot of > users might be confused when their code stops working when applied to a > selection because the selection runs their code with a time offset or > stretch factor corresponding to the selection. > > An easy solution is simply to pass in selection information by setting some > globals and let the plug-in deal with it. This would inelegantly bypass some > nifty features in Nyquist already set up to handle such problems, but on the > other hand, it might make life easier overall. > > This is probably at least a good time to revisit the original design and > make sure it's still a good idea we want to perpetuate. > > -Roger > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Audacity-nyquist mailing list > Aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-nyquist |