Page 2 of 2
Re: Auto-Zero
Posted: Fri Feb 13, 2015 2:27 am
by Steve Bender
steve wrote:Copy and paste this code into the Nyquist Prompt text window and apply
I just tried it. It definitely works in that it fades to zero, but it looks like it actually reaches zero about 5-6 samples before the border of the clip. This is causing just a minor little audible "tick" when I loop it. Any idea why that might be happening? Can you get it to reach zero at the sample closest to the border?
Re: Auto-Zero
Posted: Fri Feb 13, 2015 3:29 am
by Steve Bender
Ya know, now I'm starting to doubt my last comment on this. I just tried to make the same type of loop, but doing the edits the way I have been doing it "by hand," without the Nyquist prompt, and I'm getting essentially the same results. So I don't think it's actually anything wrong with the script you wrote.
And it looks like I can fiddle with the fade length myself by adjusting the fade length in the code, so I can try out different things, see if any other value sounds better. Is there anything else in that code I can adjust to experiment?
So, can I save this particular Nyquist prompt as a setting somehow? Or would I have to paste it in every time I use it?
Re: Auto-Zero
Posted: Fri Feb 13, 2015 3:32 am
by steve
This is a slightly modified version that is accurate to the sample:
Code: Select all
(setq fade-length 0.005)
(setq dur (get-duration 1))
(abs-env
(control-srate-abs *sound-srate*
(let* ((fl fade-length)
(env (pwlv 0 fl 1 (- dur fl) 1 dur 0)))
(mult s env))))
As you can probably guess, the length of the fade is set by the first line.
Re: Auto-Zero
Posted: Fri Feb 13, 2015 4:05 am
by Steve Bender
steve wrote:This is a slightly modified version that is accurate to the sample
Sweet, it works. I think the first one actually works well, too. I was just getting odd results with that one sample for some reason. I've since tried a few others and the results are what I was expecting.
So, it works!
So, can I save this particular Nyquist prompt as a setting somehow? Or would I have to paste it in every time I use it?
Re: Auto-Zero
Posted: Fri Feb 13, 2015 5:48 am
by Robert J. H.
Steve Bender wrote:steve wrote:This is a slightly modified version that is accurate to the sample
Sweet, it works. I think the first one actually works well, too. I was just getting odd results with that one sample for some reason. I've since tried a few others and the results are what I was expecting.
So, it works!
So, can I save this particular Nyquist prompt as a setting somehow? Or would I have to paste it in every time I use it?
The oddity is due to different sample-rates.
A Sample at control-rate comprises 20 ordinary samples.
Thus, the initial number of samples is probably not divisible by 20 and this produces those offsets.
The second version that works at the track's sample-rate just needs to make more calculations.
However, that's not a problem because only the beginning and ending have to be calculated, anything else is 1.0.
It's fairly easy to embed the code in a plugin that can be accessed with e.g."0".
Steve will you guide thru this, I'm sure.
Re: Auto-Zero
Posted: Fri Feb 13, 2015 2:12 pm
by steve
Steve Bender wrote:So, can I save this particular Nyquist prompt as a setting somehow?
We can make this code into a "plugin", then it can be "installed" as an effect that will appear in the Effect menu, and (optionally) you can assign a keyboard shortcut to the effect.
As we are now getting into the detail of making a new plugin, I'll close this topic and start a new one in the "New Plugins" section.
I'll give you a link to the new topic when I've written it - back soon

Re: Auto-Zero
Posted: Fri Feb 13, 2015 2:47 pm
by Steve Bender
steve wrote: you can assign a keyboard shortcut to the effect.
Perfect. I’m all about keyboard shortcuts.
steve wrote: I'll give you a link to the new topic when I've written it
I’m looking forward to it. Thanks.
Re: Auto-Zero
Posted: Fri Feb 13, 2015 3:47 pm
by steve