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: 80679
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 02, 2014 8:52 pm

N871 wrote:they all need to have the same length up to the sample to work well in my max msp program
Not a problem.
If you get the audio as close as possible to the required length with perfect complete samples (as described in my previous post) then you can stretch the entire track a little to fit the required length using this code:

Code: Select all

(setq new-length 100000) ; required length is samples
(force-srate (* (/ new-length len) *sound-srate*) s)
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 02, 2014 9:34 pm

wow,..interesting, so you can use this plugin as a high-quality speed shifter?

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 02, 2014 10:03 pm

oh and one other thing: do you now a way to "update" the audio when you change the sample rate in a project.
If I change it I have to export all audio and import it again before I see some change in the sample amount per wave cycle.

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

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

Post by steve » Thu Apr 03, 2014 2:55 am

I think you may be looking for "Tracks > Resample".
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 » Thu Apr 03, 2014 7:25 am

Thanks, audacity is more powerful than I thought :) If you can just let me now if I can use your last plugin as a high quality speed shifter I'm done.

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

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

Post by steve » Thu Apr 03, 2014 10:58 am

N871 wrote:If you can just let me now if I can use your last plugin as a high quality speed shifter I'm done.
It's not particularly "high quality". Audacity's "Change Speed" effect is higher quality, particularly for higher frequency signals, but this one allows very precise (sample accurate) length stretching and the quality is quite good enough for low frequency signals.

Code: Select all

(setq new-length 100000) ; required length is samples
(force-srate (* (/ new-length len) *sound-srate*) s)
Not much to say about it really. Use it in the Nyquist Prompt as before. In the first line replace "100000" with the actual duration that you want (in samples).
If you've not noticed, the Selection Toolbar at the bottom can be set to show the number of samples: http://manual.audacityteam.org/o/man/se ... olbar.html
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 » Thu Apr 03, 2014 6:19 pm

Ok, thank you!

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 » Thu Apr 03, 2014 10:33 pm

this may sound like a strange request, but does someone know how to make a plugin that copies the first half of a selection, deletes it and pastes it back right after the selection.
example: selection = 10 samples in length, the sample order 1 2 3 4 5 6 7 8 9 10 becomes 6 7 8 9 10 1 2 3 4 5 after using the plugin. (1 to 5 was copied, deleted and pasted at the end of the selection)...might sound stupid but very practical to me.
I'm probably making too many demands :) but preferably the plugin shouldn't join the 2 resulting parts. This way I can see where the "cut" is made (between 10 and 1 in my example).

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

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

Post by steve » Fri Apr 04, 2014 12:03 am

N871 wrote:preferably the plugin shouldn't join the 2 resulting parts
That part can't be done at present.
Audacity send one lump of audio (the "selection") to Nyquist, and Nyquist can return one lump of audio back to Audacity. Nyquist has no concept of audio clips or anything else about Audacity tracks.
N871 wrote:how to make a plugin that copies the first half of a selection, deletes it and pastes it back right after the selection.
Are we still talking about mono tracks?
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 » Fri Apr 04, 2014 8:13 am

Yes, mono tracks! I will always use the entire track as a selection. Not sure if it is easy to program
the plugin so that it auto-detects the length of a track. If so I could select the full project and have
the plugin processing all tracks ( with different lengths) at once : )

Post Reply