possible to make this plugin? ("auto draw wave")

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
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
steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Sun Apr 06, 2014 7:36 pm

If it is a reasonably short mono sound, then you could loop through the samples and compare the sample value with your selected "threshold" level.
You would then need to keep a note of the first time and the last time that the threshold was crossed.
The sample number divided by the sample rate gives you the time in seconds.

There are a number of things that make it a bit tricky, notably that you need to keep track of whether the waveform is above or below the threshold, then implement the logic to record the crossing times. In short, it's possible, but a bit tricky, so it's not something to knock up in 5 minutes.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Wed Apr 09, 2014 12:45 am

I see. I'll look for a work-around. There is (again..) another plugin I could use which may be less difficult to make..maybe :)
Is there a way to make "the average" of 2 recordings.

example:
recording 1 (7 samples with the following amplitudes: 0 0.2 0.4 0.8 0.5 0.3 0)
recording 2 (7 samples with the following amplitudes: 0 0.1 0.6 0.9 0.4 0.1 0)

result (7 samples: 0 0.15 0.5 0.85 0.45 0.2 0)

I understand I can only send one chunk of audio to the plugin, so I could paste them one after the other (making a total recording of 14 samples in this example): 0 0.2 0.4 0.8 0.5 0.3 0 0 0.1 0.6 0.9 0.4 0.1 0

So, the first part the plugin should do is count the amount of samples: 14 in this case. 14/2 = 7, so it has to compare sample 1 with sample 8 (=1+7); sample 2 with sample 9 (=2+7); sample 3 with sample 10 (=3+7);....

The resulting wave will be only half of the length, I don't care what happens with the second half (can be deleted or silenced). What do you think? : ) possible?

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Wed Apr 09, 2014 12:54 am

You don't need a plug-in to do that.
1) Combine the two tracks to create a stereo track (http://manual.audacityteam.org/o/man/sp ... racks.html)
2) Tracks menu > Stereo Track to Mono.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Wed Apr 09, 2014 1:13 am

thanks! Am I right the resulting sound will be different than just the 2 original sounds at the same time (=mix)? (not on my computer right now).

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: possible to make this plugin? ("auto draw wave")

Post by Robert J. H. » Wed Apr 09, 2014 5:33 am

N871 wrote:thanks! Am I right the resulting sound will be different than just the 2 original sounds at the same time (=mix)? (not on my computer right now).
No, it stays the same, just 6 dB quieter. That is, if you have two mono tracks playing at the same time.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Wed Apr 09, 2014 7:42 am

The result is what you asked for - the average of the two tracks, which as Robert said, is the same as a mix of the two tracks (the two tracks added together) then made 6 dB quieter (divided by two = average).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Vigilance
Posts: 4
Joined: Mon May 19, 2014 4:03 am
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by Vigilance » Mon May 19, 2014 4:11 am

N871 wrote:Hello,

I'm new to this forum and hoping someone can help me out with the following:
Is it possible to make a plugin in Nyquist that connects the first and last sample of a selection with a straight (or cosine-like) line (see picture).
The existence of such an effect would really make my day..I really could use a tool like this.

thank you for your time,

Nils
There is an old Mac OS program called SoundEffects 0.9.2 which has a waveform smoother plugin. The program is a proper waveform editor with a host of effects, a precursor to Audacity and a successor to the old Hypercard SoundEdit app. I'm surprised Audacity doesn't include this type of filter, or an enhanced version of it. This thing could smooth any length of the track unlike the short Click repair in Audacity and it was an incremental process filter so you could repeat the filter to enhance the smoothing effect. I'm not sure what they coded the plugin with, but it shouldn't be hard to find out and reproduce it. Get yourself a Mac OS emulator if you haven't one already and get your hands on a copy!

There's a copy of the program here, it appears:
http://macgui.net/downloads/?file_id=26247

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Mon May 19, 2014 12:55 pm

Vigilance wrote:
N871 wrote:Hello,

I'm new to this forum and hoping someone can help me out with the following:
Is it possible to make a plugin in Nyquist that connects the first and last sample of a selection with a straight (or cosine-like) line (see picture).
The existence of such an effect would really make my day..I really could use a tool like this.

thank you for your time,

Nils
There is an old Mac OS program called SoundEffects 0.9.2 which has a waveform smoother plugin.
but it does not do what Nils was asking for, so I don't understand why you posted that here as a reply to Nils' question :?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Vigilance
Posts: 4
Joined: Mon May 19, 2014 4:03 am
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by Vigilance » Tue May 20, 2014 1:35 am

steve wrote: but it does not do what Nils was asking for, so I don't understand why you posted that here as a reply to Nils' question :?
What he wants is to insert a waveform abruptly and then have it blend into a successive signal. It's already possible to produce waveforms, but he's looking for the second effect to transition the sound, and that's what the plugin I mentioned is all about. It performs the second half of the task and it does it well (albeit on an outdated program). Of course he wants to perform it from Nyquist console and he wants it to all happen at once, so in that respect it is different but the goal of shaping the wave is the same.

If you know of a solution that already exists to smooth out the waveform incrementally and is not limited to small sections of audio such as with the repair tool then that might actually be helpful to him, myself, and many others.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Tue May 20, 2014 8:18 am

Vigilance wrote:If you know of a solution that already exists to smooth out the waveform incrementally and is not limited to small sections of audio such as with the repair tool then that might actually be helpful to him, myself, and many others.
"Smoothing" a waveform can mean a variety of things.
Here is before / after "smoothing" that has been done by "down-sampling":
tracks004.png
tracks004.png (15.13 KiB) Viewed 3846 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply